RcppCore / RcppEigen

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

Unable to install: `in dyn.load(file, DLLpath = DLLpath, ...)` #108

Closed alexWhitworth closed 2 years ago

alexWhitworth commented 2 years ago

See below. Any help appreciated!

Error

From a clean R session

R> install.packages('RcppEigen')
...
installing to /Library/Frameworks/R.framework/Versions/4.1/Resources/library/00LOCK-RcppEigen/00new/RcppEigen/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘RcppEigen’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Library/Frameworks/R.framework/Versions/4.1/Resources/library/00LOCK-RcppEigen/00new/RcppEigen/libs/RcppEigen.so':
  dlopen(/Library/Frameworks/R.framework/Versions/4.1/Resources/library/00LOCK-RcppEigen/00new/RcppEigen/libs/RcppEigen.so, 6): Symbol not found: __Z19RcppEigen_Eigen_SSEv
  Referenced from: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/00LOCK-RcppEigen/00new/RcppEigen/libs/RcppEigen.so
  Expected in: flat namespace
 in /Library/Frameworks/R.framework/Versions/4.1/Resources/library/00LOCK-RcppEigen/00new/RcppEigen/libs/RcppEigen.so
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/RcppEigen’
Warning in install.packages :
  installation of package ‘RcppEigen’ had non-zero exit status

Session Info, etc

R> sessionInfo(); sessioninfo::sessioninfo()

version  R version 4.1.3 (2022-03-10)
 os       macOS Big Sur 11.6.5
 system   x86_64, darwin17.0
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 date     2022-04-10

Matrix products: default
BLAS:   /usr/local/Cellar/openblas/0.3.20/lib/libopenblasp-r0.3.20.dylib
LAPACK: /usr/local/Cellar/r/4.1.3/lib/R/lib/libRlapack.dylib

$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

$ gfortran --version
GNU Fortran (Homebrew GCC 11.2.0_3) 11.2.0

$ which brew, gcc, gfortran, gettext
/usr/local/bin/brew
/usr/bin/gcc
/usr/local/bin/gfortran
/usr/local/bin/gettext

llvm 13.0.1_1 is already installed and up-to-date.
libomp 14.0.0 is already installed and up-to-date.

makevars

CBASE=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
GCCBASE=/usr/local/opt/gcc
GETTEXT=/usr/local/bin/gettext
GCCVERSION=11
LOC_FORTRAN=/usr/local/opt/gfortran
LOC_LLVM=/usr/local/opt/llvm

LDFLAGS=-L/usr/local/opt/llvm/lib
CPPFLAGS=-I$(LOC_LLVM)/include
LDFLAGS=-I$(LOC_LLVM)/include
CPPFLAGS += -fopenmp
# LDFLAGS += -lomp

CC=$(GCCBASE)/bin/g++-${GCCVERSION}
CXX=$(GCCBASE)/bin/g++-${GCCVERSION}
CXX11=$(GCCBASE)/bin/g++-${GCCVERSION}
CXX14=$(GCCBASE)/bin/g++-${GCCVERSION}
CXX17=$(GCCBASE)/bin/g++-${GCCVERSION}
CXX1X=$(GCCBASE)/bin/g++-${GCCVERSION}

FC=$(LOC_FORTRAN)
F77=$(LOC_FORTRAN)
FLIBS=-L$(GCCBASE)/lib/gcc/${GCCVERSION}/ -lm -lgfortran
eddelbuettel commented 2 years ago

Please check with r-sig-mac and other macOS experts. On systems that are set-up correctly, the package installs and checks correctly as you can see at the CRAN status page. This includes the macOS platforms. I don't work on, or with, macOS so I really cannot help. Truly sorry. The package as such is fine.

eddelbuettel commented 2 years ago

You could also post and ask on the (generally friendly and low-volume) rcpp-devel list (subscribe first to post) where other macOS users should be able to help you with the setup.