我正在尝试通过使用]在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
我已经尝试过this thread和this thread的答案。
根据这些线程,我已经使用]安装了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上。
如果有人能够帮助我,我将非常感激。谢谢
我正在尝试通过使用install.packages(“ gradientForest”,repos =“ http://R-Forge.R-project.org”)在R中安装gradientForest软件包,并且出现此错误ld:警告:找不到目录...
下面是R官方文档中的有关如何在Mac上安装R以及相关错误的摘录:
CC = /usr/local/clang7/bin/clang
CXX = /usr/local/clang7/bin/clang++
CXX11 = $CXX
CXX14 = $CXX
CXX17 = $CXX
CFLAGS = -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion
CXXFLAGS = -g -O2 -Wall -pedantic -Wconversion -Wno-sign-conversion
CXX11FLAGS = $CXXFLAGS
CXX14FLAGS = $CXXFLAGS
CXX17FLAGS = $CXXFLAGS
and gfortran by (El Capitan)
FC = /usr/local/gfortran/bin/gfortran
FLIBS = -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0
-L/usr/local/gfortran/lib -lgfortran -lquadmath -lm
or (Sierra or High Sierra)
FC = /usr/local/gfortran/bin/gfortran
FLIBS = -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin16/6.3.0
-L/usr/local/gfortran/lib -lgfortran -lquadmath -lm
or (Mojave or later)
FC = /usr/local/gfortran/bin/gfortran
FLIBS = -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0
-L/usr/local/gfortran/lib -lgfortran -lquadmath -lm
(with lines broken here for legibility).
If using the C/C++ compilers from the Command Line Tools (which do not have OpenMP support) one will need to include
SHLIB_OPENMP_CFLAGS =
SHLIB_OPENMP_CXXFLAGS =