sourceCpp()无法在R 3.4.3中工作:clang错误

时间:2018-03-17 14:53:56

标签: r macos rcpp

我刚刚在我的iMac上更新了R到最新版本。

当尝试从RStudio通过sourceCpp()获取Rcpp文件时,我收到错误

ld: warning: directory not found for option '-  L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0'
ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
ld: library not found for -lquadmath
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [sourceCpp_3.so] Error 1
clang++  -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I../inst/include   -    I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/RcppArmadillo/i  nclude" -I"/Users/jarrett/Desktop/HAC simulation" -I/usr/local/include   -fPIC  -Wall -g -O2  -c accumulate.cpp -o accumulate.o
clang++ -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o sourceCpp_3.so accumulate.o -L/Library/Frameworks/R.framework/Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
Error in sourceCpp("accumulate.cpp") : 
Error 1 occurred building shared library.

有关如何解决问题的任何想法?

1 个答案:

答案 0 :(得分:0)

查看以下与您发布的问题相符的文章并提出解决方案:Rcpp, RcppArmadillo and OS X Mavericks "-lgfortran" and "-lquadmath" error