0

尝试安装 'rworldmap' 时,我收到一条错误消息,提示“没有名为 'fields' 的包”。所以我尝试安装“字段”,当我这样做时,它说解压成功并检查了 MD5 总和,但随后出现错误说编译失败。有什么建议吗?这正是出现的情况:

There is a binary version available but the source version
  is later:
       binary source needs_compilation
fields    9.0    9.6              TRUE

Do you want to install from sources the package which needs compilation?
y/n: y
installing the source package ‘fields’

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0100 3188k  100 3188k    0     0  3720k      0 --:--:-- --:--:-- --:--:-- 3720k
* installing *source* package ‘fields’ ...
** package ‘fields’ successfully unpacked and MD5 sums checked
** libs
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include    -fPIC  -Wall -mtune=core2 -g -O2  -c ExponentialUpperC.c -o ExponentialUpperC.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include    -fPIC  -Wall -mtune=core2 -g -O2  -c addToDiagC.c -o addToDiagC.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include    -fPIC  -Wall -mtune=core2 -g -O2  -c compactToMatC.c -o compactToMatC.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include    -fPIC  -Wall -mtune=core2 -g -O2  -c expfnC.c -o expfnC.o
gfortran-4.8   -fPIC  -g -O2  -c fieldsF77Code.f -o fieldsF77Code.o
make: gfortran-4.8: No such file or directory
make: *** [fieldsF77Code.o] Error 1
ERROR: compilation failed for package ‘fields’
* removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/fields’
Warning in install.packages :
  installation of package ‘fields’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/vx/ffhh4_sj0hj810kjht02f9bc0000gn/T/RtmpncjRcs/downloaded_packages’
4

1 回答 1

0

看来你没有 gfortran正确安装。我猜这是在 Mac 上,所以如果您想从源代码编译,请转到安装页面并更正您的设置。这是 Mactools页面的链接:https ://cran.r-project.org/bin/macosx/tools

自从我尝试从字段版本安装以来,我承认为什么会抛出这个错误有点困惑。R 版本 3.4.3 中的 9.6 源代码显示没有可见的“努力”来编译任何 fortran 代码。也许 Fortran 消息没有发送到控制台?也让我担心你可能使用的是过时的 R (3.2) 版本。那是两年前的事情,可能与当前版本的软件包不兼容。旧版本pkg::fields在这里: https ://cran.r-project.org/src/contrib/Archive/fields/

于 2018-02-14T17:11:44.220 回答