我試圖從源代碼安裝的R包,但得到一個錯誤:的Mac OS XR錯誤「LD:警告:目錄沒有找到選項」
* installing *source* package ‘mclust’ ...
** package ‘mclust’ successfully unpacked and MD5 sums checked
** libs
gfortran-4.8 -fPIC -g -O2 -c mclust.f -o mclust.o
gfortran-4.8 -fPIC -g -O2 -c mclustaddson.f -o mclustaddson.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 mclust.so mclust.o mclustaddson.o -L/Library/Frameworks/R.framework/Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2 -lgfortran -lquadmath -lm -L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2 -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: directory not found for option '-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2'
ld: warning: directory not found for option '-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2'
ld: library not found for -lquadmath
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mclust.so] Error 1
ERROR: compilation failed for package ‘mclust’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/mclust’
Warning in install.packages :
installation of package ‘mclust’ had non-zero exit status
我沒有/usr/local/lib/gcc/x86_64-apple-darwin13.0.0
,所以它有道理,它不能被發現。我有/usr/local/lib/gcc/i686-apple-darwin11
和/usr/local/lib/gcc/4.8
(符號鏈接到Homebrew安裝)。 x86_64-apple-darwin13.0.0
從哪裏來?
有很多在線提及類似的錯誤。但是,它們都與編譯Xcode有關,並通過更新項目設置來解決,這在這裏不適用。
「官方R核心」不支持自制軟件安裝。在http://r.research.att.com/上有一個Fortran包,但我認爲它可能與「授權」版本的靜態鏈接結合在「框架」樹中。我不是這方面的專家,有一些SO的用戶(思考@ hrbrmstr)認爲自制軟件「很好」。搜索「user:1457051 homebrew」並查看是否找到比我提供的更多支持。 –