在macOS High Sierra上安装R包BASiCS

时间:2017-10-25 19:47:36

标签: r homebrew gfortran

我正在尝试在macOS High Sierra的R 3.4.2中安装BASiCS。我通过homebrew安装了R.我还通过gfortrangcc中安装了brew install gcc。 不过,我收到以下错误。有没有人知道如何解决这个问题?

谢谢,

R中的错误信息

Downloading GitHub repo catavallejos/BASiCS@master
from URL https://api.github.com/repos/catavallejos/BASiCS/zipball/master
Installing BASiCS
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ  \
  --no-save --no-restore --quiet CMD INSTALL  \
  '/private/var/folders/xk/dfj20kgd56xg8796xh874tjr0000gn/T/RtmpW243tu/devtools3375bbc3c81/catavallejos-BASiCS-407caff'  \
  --library='/Library/Frameworks/R.framework/Versions/3.4/Resources/library'  \
  --install-tests

* installing *source* package ‘BASiCS’ ...
** libs
clang++  -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/RcppArmadillo/include" -I/usr/local/include   -fPIC  -Wall -g -O2  -c BASiCS_CPPcode.cpp -o BASiCS_CPPcode.o
In file included from BASiCS_CPPcode.cpp:12:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/RcppArmadillo/include/RcppArmadillo.h:31:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/RcppArmadillo/include/RcppArmadilloForward.h:26:
In file included from /Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include/RcppCommon.h:122:
/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include/Rcpp/exceptions.h:103:53: warning: all paths through this function will call itself
      [-Winfinite-recursion]
    inline void warning(const std::string& message) {        // #nocov start
                                                    ^
1 warning generated.
clang++  -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/RcppArmadillo/include" -I/usr/local/include   -fPIC  -Wall -g -O2  -c RcppExports.cpp -o RcppExports.o
clang++ -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o BASiCS.so BASiCS_CPPcode.o RcppExports.o -L/Library/Frameworks/R.framework/Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
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: *** [BASiCS.so] Error 1
ERROR: compilation failed for package ‘BASiCS’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BASiCS’
Installation failed: Command failed (1)

1 个答案:

答案 0 :(得分:1)

似乎您需要从CRAN安装gfortran,而不是通过homebrew安装。 我遇到了同样的问题,并使用this github建议解决了这个问题。