我正在尝试安装包 glmnet。我收到此错误:
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
Run Code Online (Sandbox Code Playgroud)
我安装了自制软件。然后通过 gcc fortran 达到这个目的。我找到了很多帮助链接,上面写着类似的东西:
“您需要使用以下命令将 ~/.R/Makevars/ 中的编译语句更改为 gcc:
VER=-5.3.0
CC=gcc$(VER)
CXX=g++$(VER)
CFLAGS=-mtune=native -g -O2 -Wall -pedantic -Wconversion
CXXFLAGS=-mtune=native -g -O2 -Wall -pedantic -Wconversion
FLIBS=-L/usr/local/Cellar/gcc/5.3.0/lib/gcc/5
Run Code Online (Sandbox Code Playgroud)
我在 Mac 上找不到 ~/.R/Makevars/ !!我有 macOS Catalina 10.15.1。
我找到了两个 Makevars 文件。它们与 Rcpp 相关联,并且与上面列出的代码完全不同。
抱歉,这个看似基本的问题,但两个小时后,我找不到与 ~/.R/Makevars/ 相关的任何内容
这是我找到的一个文件的状态:
## With R 3.1.0 or later, you can uncomment the following line to tell R to
## enable compilation with C++11 (where available)
##
## Also, OpenMP support in Armadillo prefers C++11 support. However, for wider
## availability of the package we do not yet enforce this here. It is however
## recommended for client packages to set it.
##
## And with R 3.4.0, and RcppArmadillo 0.7.960.*, we turn C++11 on as OpenMP
## support within Armadillo prefers / requires it
CXX_STD = CXX11
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS)
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
Run Code Online (Sandbox Code Playgroud)
但这与 RcppArmadillo 有关。
我已经多次阅读这些(更多):https : //cran.r-project.org/bin/macosx/RMacOSX-FAQ.html#Installation-of-source-packages
https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Clang
小智 2
/Users/YOURNAME/.R/Users/YOURNAME/.R/MakevarsFC = /usr/local/opt/gcc/bin/gfortran
F77 = /usr/local/opt/gcc/bin/gfortran
FLIBS = -L/usr/local/opt/gcc/lib
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6615 次 |
| 最近记录: |