Reputation: 4145
I am getting the error message below when I try to compile any code. Below is an example and the output from sessionInfo()
. The example used to work but I had problems with RcppArmadillo
. So I installed the for HPC version of the gfortran
compiler, which was a mistake. R just crashed when I tried to compile something (CRAN also warns about the HPC version). In the end, I installed the version on CRAN here but now any call to cppFunction
or sourceCpp
produces the error below. I have already tried to uninstall gfortran, R, Rcpp and install them again. Same error. The output from gfortran -v
is a little confusing. Any ideas?
Example code
require("Rcpp")
cppFunction('
int add(int x, int y, int z) {
int sum = x + y + z;
return sum;
}'
)
Error message
Error in dyn.load(context$dynlibPath) :
unable to load shared object '/var/folders/cc/_mskgpdd6f77hrg4rsp4zq1h0000gq/T//RtmpHRb5JV/sourcecpp_24fb5226c6fc/sourceCpp_96369.so':
dlopen(/var/folders/cc/_mskgpdd6f77hrg4rsp4zq1h0000gq/T//RtmpHRb5JV/sourcecpp_24fb5226c6fc/sourceCpp_96369.so, 6): Symbol not found: ___emutls_get_address
Referenced from: /usr/local/lib/libstdc++.6.dylib
Expected in: /usr/local/lib/libgcc_s.1.dylib
in /usr/local/lib/libstdc++.6.dylib
Output from session info
R version 2.15.2 (2012-10-26)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
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
other attached packages:
[1] Rcpp_0.10.1 boot_1.3-7 xtable_1.7-0 stringr_0.6.1
[5] mi_0.09-18 arm_1.5-08 abind_1.4-0 R2WinBUGS_2.1-18
[9] coda_0.14-7 lme4_0.999999-0 Matrix_1.0-9 lattice_0.20-10
[13] car_2.0-15 nnet_7.3-5 MASS_7.3-22 plyr_1.7.1
[17] foreign_0.8-51
loaded via a namespace (and not attached):
[1] grid_2.15.2 nlme_3.1-105 stats4_2.15.2 tools_2.15.2
versions of compiler
> gcc -v
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
> gfortran -v
Using built-in specs.
Target: i686-apple-darwin8
Configured with: /Builds/unix/gcc/gcc-4.2/configure --prefix=/usr/local --mandir=/share/man --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --build=i686-apple-darwin8 --host=i686-apple-darwin8 --target=i686-apple-darwin8 --enable-languages=fortran
Thread model: posix
gcc version 4.2.3
Upvotes: 3
Views: 2123
Reputation: 4145
Somehow I ended up with a version of libstdc++.6.dylib
in /usr/local/lib
. This version is picked up when I compile certain code with Rcpp or inline and produces the error. It seems to overwrite the the system version in /usr/lib
. For now, I just renamed /usr/local/lib/libstdc++.6.dylib
to .../libstdc++.6-SAVE
. I am not sure whether that will create other problems but Rcpp is running again and the ?cfunction
examples also work!
EDIT: It's actually still screwed up. Here are the steps to solve the problem for the current R session. 1) start R with /usr/local/lib/libstdc++.6.dylib
unchanged, 2) rename /usr/local/lib/libstdc++.6.dylib
, 3) happily use Rcpp
. When I now restart R, however, I still get the old error message. I have to go through the three steps again to make it work in the current R session.
Upvotes: 1