DNABarcodes-Installation Issue
1
0
Entering edit mode
nk130 • 0
@827907e5
Last seen 11 weeks ago
United States

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
DNABarcodes Install • 319 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 1 day ago
United States

It's apparently been deprecated in C++14 and made defunct in C++17, replaced by std::shuffle. You could presumably download the sources, change the calls to std::random_shuffle and then compile. Or alternatively you could complain to the maintainer, but it's not been building on MacOS since Bioc 3.17, so the package might be orphaned? I don't see any commits to the git log that aren't version bumps, so it looks like the package hasn't been touched in years.

Or maybe you can specify C++14 or C++11 when building the package? That might be the easiest fix.

0
Entering edit mode

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!

ADD REPLY
0
Entering edit mode

I think you can just uncomment the last line in the /src/Makevars for the package:

#PKG_CXXFLAGS = $(CXX1XSTD) $(SHLIB_OPENMP_CXXFLAGS)
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS)
PKG_CFLAGS = $(SHLIB_OPENMP_CFLAGS)
PKG_LIBS = $(SHLIB_OPENMP_CFLAGS)
#CXX_STD = CXX11

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.

ADD REPLY
0
Entering edit mode

That worked!

ADD REPLY

Login before adding your answer.

Traffic: 453 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