编译RcppArmadillo时出现问题-未找到库gfortran
运行:编译RcppArmadillo时出现问题-未找到库gfortran,r,rcpparmadillo,R,Rcpparmadillo,运行: install.packages("RcppArmadillo") 我得到以下错误: 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
install.packages("RcppArmadillo")
我得到以下错误:
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 -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [RcppArmadillo.so] Error 1
ERROR: compilation failed for package ‘RcppArmadillo’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppArmadillo’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppArmadillo’
The downloaded source packages are in
‘/private/var/folders/x8/mrn18h_50g78zbq2jrxcwkx00000gn/T/RtmpK4nz32/downloaded_packages’
Warning messages:
1: In install.packages(update[instlib == l, "Package"], l, repos = repos, :
installation of package ‘coin’ had non-zero exit status
2: In install.packages(update[instlib == l, "Package"], l, repos = repos, :
installation of package ‘Matrix’ had non-zero exit status
3: In install.packages(update[instlib == l, "Package"], l, repos = repos, :
installation of package ‘RcppArmadillo’ had non-zero exit status
所以它毕竟没有安装它。我读了这个链接,但我不能做的解决方案,因为我不知道该怎么做。你能评论一下吗
我甚至试过这么做
install.packages("https://cran.r-project.org/src/contrib/Archive/RcppArmadillo/RcppArmadillo_0.6.100.0.0.tar.gz", repos=NULL, type="source")
同样的错误也出现了
多亏了JPR,我找到了这个答案,帮助我解决了这个问题。因此,如果您使用linux,请使用他的命令行;如果您使用Mac,请按照本文安装运行库
您的计算机上缺少运行时库。试一试
sudo apt-get install libgfortan5 libgfortan-8-dev
我使用的是Mac而不是linux