GOfuncR fails to build on Mac OS
1
0
Entering edit mode
@mgierlinski-7369
Last seen 4 months ago
United Kingdom

Installation of GOfuncR fails with an error:

clang++ -arch x86_64 -std=gnu++17 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library/Rcpp/include' -I/opt/R/x86_64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c genes.cc -o genes.o
genes.cc:100:9: error: use of undeclared identifier 'random_shuffle'
        random_shuffle( gene_vec.begin(), gene_vec.end(), rng ) ;
        ^
1 error generated.
make: *** [genes.o] Error 1

There are no Mac Intel binaries available on Bioconductor, and Bioconductor's build results web page show error on Mac OS Monterey. Any ideas how to circumvent these issues?

My session info:

> sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: x86_64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.5.1

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: Europe/London
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] BiocManager_1.30.22 compiler_4.3.1      tools_4.3.1
GOfuncR • 907 views
ADD COMMENT
0
Entering edit mode
Mike Smith ★ 6.6k
@mike-smith
Last seen 7 hours ago
EMBL Heidelberg

I think this is because the random_shuffle() function was deprecated in C++17, which is now the default for R. I'm not really sure why it still compiles on the other platforms, so this is only a hunch, but that seems likely to me. There's some more details at https://en.cppreference.com/w/cpp/algorithm/random_shuffle

I'd suggest opening an issue at https://github.com/sgrote/GOfuncR/issues to let the package author know. I think they should be able to specify using an older C++ standard for their package, which might restore the original functionality, but probably it'd be better to update to a non-deprecated function.

There's some details in https://cran.r-project.org/doc/manuals/R-exts.html#Using-C_002b_002b-code If you're feeling adventurous you could always get the source version of the package, trying making the required changes, and then installing your new copy.

ADD COMMENT
0
Entering edit mode

Thank you, I saw some comments on the web about random_shuffle() being deprecated. I have submitted an issue to the author.

ADD REPLY
1
Entering edit mode

Hi, thanks for reporting. I fixed the bug in devel and just added the fix also to the current release. Should hopefully be solved with the new build.

ADD REPLY

Login before adding your answer.

Traffic: 614 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6