简体   繁体   English

无法使用Revolution R Open 3.2.2在macOS上安装软件包psych

[英]Unable to install package psych on macOS using Revolution R Open 3.2.2

I try to install the psych package on macOS with Revolution R Open 3.2.2. 我尝试使用Revolution R Open 3.2.2在macOS上安装psych软件包。 I used install.packages("psych") and all the dependencies are going to be downloaded. 我使用install.packages("psych") ,所有依赖项都将被下载。 The first dependency was successfully unzipped. 第一个依赖项已成功解压缩。

The following happens afterwards: 之后发生以下情况:

gfortran -arch x86_64   -fPIC  -g -O2  -c biv-nt.f -o biv-nt.o

gfortran -arch x86_64   -fPIC  -g -O2  -c sadmvnt.f -o sadmvnt.o

clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/Users/Shared/Jenkins/workspace/External-R-3.3.2/vendor/build/lib -o mnormt.so biv-nt.o sadmvnt.o -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/x86_64 -L/usr/local/lib/x86_64 -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3 -L/usr/local/lib -lgfortran -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation

ld: warning: directory not found for option '-L/Users/Shared/Jenkins/workspace/External-R-3.3.2/vendor/build/lib'

ld: warning: directory not found for option '-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/x86_64'

ld: warning: directory not found for option '-L/usr/local/lib/x86_64'

ld: warning: directory not found for option '-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3'

ld: library not found for -lgfortran

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make: *** [mnormt.so] Error 1

ERROR: compilation failed for package ‘mnormt’

* removing ‘/Users/sebastian/Library/R/3.3/library/mnormt’

Warning in install.packages :
  installation of package ‘mnormt’ had non-zero exit status

ERROR: dependency ‘mnormt’ is not available for package ‘psych’

* removing ‘/Users/sebastian/Library/R/3.3/library/psych’

Warning in install.packages :

  installation of package ‘psych’ had non-zero exit status

The downloaded source packages are in

  /private/var/folders/8d/tdsm42091lz926w1q2lx77c40000gn/T/RtmpHxWPQe/downloaded_packages

My system: 我的系统:

R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.1

This also happens for other packages, but not for all. 其他软件包也会发生这种情况,但并非所有情况都如此。 I installed ggplot2, dplyr or tidyr and everything just worked fine. 我安装了ggplot2,dplyr或tidyr,一切正常。

I had the same issue with many other R packages when I switched to MRO on MacOS . 当我在MacOS上切换到MRO时,我对许多其他R包也遇到了相同的问题。 It could be two things: 可能有两件事:

  1. You are missing gfortran , like @hrbrmstr mentioned in the comments. 您缺少gfortran ,就像评论中提到的@hrbrmstr一样。
  2. Or, you have gfortran , but the link library path was not specified by the compiler, as you can see in the error messages before it bummed out at the gfortran line. 或者,您具有gfortran ,但是编译器未指定链接库路径,正如您在错误消息中看到的那样,它在gfortran行中gfortran

The solution to 2, which worked for me, is to edit ~/.R/Makevars to add your GCC/GFortran libraries. 对我~/.R/Makevars 2解决方案是编辑~/.R/Makevars以添加您的GCC/GFortran库。 For GCC5 : 对于GCC5

LDFLAGS=-L/usr/local/lib/gcc/5

Installing gfortran alone did not help in my case. 就我而言,单独安装gfortran并没有帮助。 Make sure that XCode is installed and uptodate. 确保XCode已安装且已更新。 This helped me. 这对我有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM