我正在尝试安装包 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
我安装了自制软件。然后通过 gcc fortran 走到这一步。
我发现许多帮助链接都说类似的话:
您将需要更改您的编译语句~/.R/Makevars
到海湾合作委员会使用:
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
我找不到~/.R/Makevars
在我的Mac上!!我有 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)
但这与 RcppArmadillo 有关。
我已经读过这些(甚至更多)很多遍:
- https://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html#Installation-of-source-packages https://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html#Installation-of-source-packages
- Mac OS X R 错误“ld:警告:找不到选项的目录” https://stackoverflow.com/questions/35999874/mac-os-x-r-error-ld-warning-directory-not-found-for-option
- https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Clang https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Clang
- https://nistara.net/post/compile-issues-r/ https://nistara.net/post/compile-issues-r/
- 创建文件夹
/Users/YOURNAME/.R
- 创建文本文件
/Users/YOURNAME/.R/Makevars
- 将其放入该文件中:
FC = /usr/local/opt/gcc/bin/gfortran
F77 = /usr/local/opt/gcc/bin/gfortran
FLIBS = -L/usr/local/opt/gcc/lib
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)