首页 > 解决方案 > 由于 fortran 无法安装 R 包

问题描述

我正在尝试在 R 中安装这个包

install.packages('rmutil')

gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tbZjLv/r-base-4.1.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c cutil.c -o cutil.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tbZjLv/r-base-4.1.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c dist.c -o dist.o
77 -fno-optimize-sibling-calls  -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-tbZjLv/r-base-4.1.0=. -fstack-protector-strong  -c gettvc.f -o gettvc.o
/bin/bash: 77: command not found
make: *** [/usr/lib/R/etc/Makeconf:191: gettvc.o] Error 127
ERROR: compilation failed for package ‘rmutil’
* removing ‘/home/alessandro/R_libs/rmutil’
Warning in install.packages :
  installation of package ‘rmutil’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpOZ5A2U/downloaded_packages’

我不明白的是,我的 ubuntu 上确实安装了 gfortran。

欢迎任何帮助

标签: rcompiler-errorsgfortran

解决方案


好的,我似乎安装了 2 个版本的 R

/usr/bin/R
/usr/R

我摆脱了这两个并正确重新安装了R。

我也不得不删除这个

rm ~/.R/Makevars

该文件向 R 提供了有关 gfortran 位置的错误说明。我刚刚删除了它。


推荐阅读