RcppCore / RcppEigen

Rcpp integration for the Eigen templated linear algebra library
Other
110 stars 40 forks source link

Installation issues in a conda environment #137

Closed ccnawrocki closed 4 months ago

ccnawrocki commented 4 months ago

Hello, I am trying to set up a conda environment with a specific version of Seurat in order to reproduce some old workflows' results. To do this, I must first install Rcpp and RcppEigen. When I try installing from github, I get the following error:

> remotes::install_github("RcppCore/RcppEigen")
Downloading GitHub repo RcppCore/RcppEigen@HEAD
Running `R CMD build`...
* checking for file ‘/private/var/folders/_6/qhytbgh10k5cp65dy9zhhcym0000gp/T/Rtmp7miQSJ/remotes31fc82e5059/RcppCore-RcppEigen-e6fd4a1/DESCRIPTION’ ... OK
* preparing ‘RcppEigen’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* running ‘cleanup’
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building ‘RcppEigen_0.3.4.0.0.tar.gz’
* installing *source* package ‘RcppEigen’ ...
** using staged installation
** libs
arm64-apple-darwin20.0.0-clang++ -std=gnu++14 -I"/Users/cnawrocki/anaconda3/envs/sc-pipeline1/lib/R/include" -DNDEBUG  -I'/Users/cnawrocki/anaconda3/envs/sc-pipeline1/lib/R/library/Rcpp/include' -D_FORTIFY_SOURCE=2 -isystem /Users/cnawrocki/anaconda3/envs/sc-pipeline1/include -mmacosx-version-min=11.0 -I/Users/cnawrocki/anaconda3/envs/sc-pipeline1/include  -I../inst/include -fPIC  -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -isystem /Users/cnawrocki/anaconda3/envs/sc-pipeline1/include -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/r-base-split_1694680520510/work=/usr/local/src/conda/r-base-4.1.3 -fdebug-prefix-map=/Users/cnawrocki/anaconda3/envs/sc-pipeline1=/usr/local/src/conda-prefix  -c RcppEigen.cpp -o RcppEigen.o
In file included from RcppEigen.cpp:22:
In file included from ../inst/include/RcppEigen.h:25:
In file included from ../inst/include/RcppEigenForward.h:28:
In file included from ../inst/include/Eigen/Dense:1:
In file included from ../inst/include/Eigen/Core:171:
../inst/include/Eigen/src/Core/MathFunctions.h:743:16: error: no member named 'Rlog1p' in namespace 'std'; did you mean 'log1p'?
    using std::log1p;
          ~~~~~^~~~~
               log1p
/Users/cnawrocki/anaconda3/envs/sc-pipeline1/lib/R/include/Rmath.h:71:15: note: expanded from macro 'log1p'
#define log1p Rlog1p
              ^
/Users/cnawrocki/anaconda3/envs/sc-pipeline1/bin/../include/c++/v1/cmath:448:9: note: 'log1p' declared here
using ::log1p _LIBCPP_USING_IF_EXISTS;
        ^
1 error generated.
make: *** [/Users/cnawrocki/anaconda3/envs/sc-pipeline1/lib/R/etc/Makeconf:177: RcppEigen.o] Error 1
ERROR: compilation failed for package ‘RcppEigen’
* removing ‘/Users/cnawrocki/anaconda3/envs/sc-pipeline1/lib/R/library/RcppEigen’
Warning message:
In i.p(...) :
  installation of package ‘/var/folders/_6/qhytbgh10k5cp65dy9zhhcym0000gp/T//Rtmp7miQSJ/file31fcae947/RcppEigen_0.3.4.0.0.tar.gz’ had non-zero exit status

When I install from CRAN I get:

> install.packages("RcppEigen")
trying URL 'https://mirror.las.iastate.edu/CRAN/src/contrib/RcppEigen_0.3.4.0.0.tar.gz'
Content type 'application/x-gzip' length 1765714 bytes (1.7 MB)
==================================================
downloaded 1.7 MB

* installing *source* package ‘RcppEigen’ ...
** package ‘RcppEigen’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
arm64-apple-darwin20.0.0-clang++ -std=gnu++14 -I"/Users/cnawrocki/anaconda3/envs/sc-pipeline1/lib/R/include" -DNDEBUG  -I'/Users/cnawrocki/anaconda3/envs/sc-pipeline1/lib/R/library/Rcpp/include' -D_FORTIFY_SOURCE=2 -isystem /Users/cnawrocki/anaconda3/envs/sc-pipeline1/include -mmacosx-version-min=11.0 -I/Users/cnawrocki/anaconda3/envs/sc-pipeline1/include  -I../inst/include -fPIC  -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -isystem /Users/cnawrocki/anaconda3/envs/sc-pipeline1/include -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/r-base-split_1694680520510/work=/usr/local/src/conda/r-base-4.1.3 -fdebug-prefix-map=/Users/cnawrocki/anaconda3/envs/sc-pipeline1=/usr/local/src/conda-prefix  -c RcppEigen.cpp -o RcppEigen.o
In file included from RcppEigen.cpp:22:
In file included from ../inst/include/RcppEigen.h:25:
In file included from ../inst/include/RcppEigenForward.h:28:
In file included from ../inst/include/Eigen/Dense:1:
In file included from ../inst/include/Eigen/Core:171:
../inst/include/Eigen/src/Core/MathFunctions.h:743:16: error: no member named 'Rlog1p' in namespace 'std'; did you mean 'log1p'?
    using std::log1p;
          ~~~~~^~~~~
               log1p
/Users/cnawrocki/anaconda3/envs/sc-pipeline1/lib/R/include/Rmath.h:71:15: note: expanded from macro 'log1p'
#define log1p Rlog1p
              ^
/Users/cnawrocki/anaconda3/envs/sc-pipeline1/bin/../include/c++/v1/cmath:448:9: note: 'log1p' declared here
using ::log1p _LIBCPP_USING_IF_EXISTS;
        ^
1 error generated.
make: *** [/Users/cnawrocki/anaconda3/envs/sc-pipeline1/lib/R/etc/Makeconf:177: RcppEigen.o] Error 1
ERROR: compilation failed for package ‘RcppEigen’
* removing ‘/Users/cnawrocki/anaconda3/envs/sc-pipeline1/lib/R/library/RcppEigen’

The downloaded source packages are in
    ‘/private/var/folders/_6/qhytbgh10k5cp65dy9zhhcym0000gp/T/RtmpwtPbNt/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("RcppEigen") :
  installation of package ‘RcppEigen’ had non-zero exit status

Any help would be much appreciated.

Session info:

> sessionInfo()
R version 4.1.3 (2022-03-10)
Platform: aarch64-apple-darwin20.0.0 (64-bit)
Running under: macOS 14.2.1

Matrix products: default
BLAS:   /Users/cnawrocki/anaconda3/envs/sc-pipeline1/lib/R/lib/libRblas.dylib
LAPACK: /Users/cnawrocki/anaconda3/envs/sc-pipeline1/lib/R/lib/libRlapack.dylib

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

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

loaded via a namespace (and not attached):
[1] compiler_4.1.3 tools_4.1.3   
eddelbuettel commented 4 months ago

Your R is too old: R 4.1.3 from March 2022 is dated. We just got R 4.4.0 this morning, and I recommend you try at least R 4.3.3. We use Seurat etc a ton at work too (I am at TileDB by day) so that is not issue, and Conda does have RcppEigen packages too.

I will close this now. If you really think there are issues at the repo, and can show reproducible example under standard current R versions then please reopen.