I am running into issues setting up DNABarcodes. Is this because the function std_random_shuffle()
has been deprecated for C++? Should I do something else to avoid installation from source?
> BiocManager::install("DNABarcodes")
'getOption("repos")' replaces Bioconductor standard repositories, see 'help("repositories", package =
"BiocManager")' for details.
Replacement repositories:
CRAN: https://cran.rstudio.com/
Bioconductor version 3.18 (BiocManager 1.30.22), R 4.3.2 (2023-10-31)
Installing package(s) 'DNABarcodes'
Package which is only available in source form, and may need compilation of C/C++/Fortran:
'DNABarcodes'
Do you want to attempt to install these from sources? (Yes/no/cancel) Yes
installing the source package 'DNABarcodes'
greedyevolution.cpp:83:10: error: no member named 'random_shuffle' in namespace 'std'
std::random_shuffle(chromosomes.begin(), chromosomes.end(), randWrapper);
~~~~~^
1 error generated.
make: *** [greedyevolution.o] Error 1
ERROR: compilation failed for package 'DNABarcodes'
* removing '/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/DNABarcodes'
The downloaded source packages are in
'/private/var/folders/3z/9hr4vx517kvcr0gnf5kffwzr0000gn/T/RtmpJ6l5Kl/downloaded_packages'
Warning message:
In install.packages(...) :
installation of package 'DNABarcodes' had non-zero exit status
> sessionInfo()
R version 4.3.2 (2023-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Sonoma 14.1.2
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-arm64/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: America/Los_Angeles
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.2 tools_4.3.2
I have the sources and could likely change the calls. If I wanted to specific the version of C++ for building the package, how would I go about that? My R is very rusty!
I think you can just uncomment the last line in the /src/Makevars for the package:
And then it will hopefully use C++11. But my C knowledge borders on non-existent, so you might have to Google around if that doesn't help.
That worked!