我正在尝试使用R语言安装gradientForest包
install.packages("gradientForest", repos="http://R-Forge.R-project.org")
我遇到了这个错误。
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:
brew install gcc
我的Makevars文件看起来像这样:
## With Rcpp 0.11.0 and later, we no longer need to set PKG_LIBS as there is
## no user-facing library. The include path to headers is already set by R.
#PKG_LIBS =
## With R 3.1.0 or later, you can uncomment the following line to tell R to
## enable compilation with C++11 (or even C++14) where available
CXX_STD = CXX17
VER=-9
CC=gcc$(VER)
CXX=g++$(VER)
CXX11=g++$(VER)
CXX14=g++$(VER)
CXX17=g++$(VER)
CFLAGS=-mtune=native -g -O2 -Wall -pedantic -Wconversion
CXXFLAGS=-mtune=native -g -O2 -Wall -pedantic -Wconversion
FLIBS=-L`gfortran -print-file-name=libgfortran.dylib | xargs dirname`
但是不幸的是,它对我的错误没有任何影响。 我的 R 版本是 3.6.1,我使用的是 MacOS Catalina 操作系统。
如果有人能帮助我,我将非常感激。 谢谢。