You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 20下安装igraph等R库遇gfortran编译错误求助

Ubuntu 20下安装R的igraph/mclust库编译错误的解决方法

问题现象

在Ubuntu 20环境中安装R语言的igraph库时,反复出现编译错误;安装mclust库时也遇到完全相同的问题。尝试通过devtools从GitHub安装igraph同样失败,检测阶段提示:

checking whether the compiler supports GNU Fortran... no
checking whether gfortran accepts -g... no

具体错误信息

编译时的报错内容如下:

gfortran -fno-optimize-sibling-calls -fvisibility=hidden -fpic  -g -O2  -c vendor/arpack/dgetv0.f -o vendor/arpack/dgetv0.o
Inconsistency detected by ld.so: dl-call-libc-early-init.c: 37: _dl_call_libc_early_init: Assertion `sym != NULL' failed!
make: *** [/opt/R/4.2.2/lib/R/etc/Makeconf:192: vendor/arpack/dgetv0.o] Error 127
ERROR: compilation failed for package ‘igraph’
* removing ‘/home/ajaimes/R/x86_64-pc-linux-gnu-library/4.2/igraph’
Warning message:
In i.p(...) :
  installation of package ‘/tmp/Rtmp8AlBTM/file24591376be44/igraph_1.4.99.9024.tar.gz’ had non-zero exit status

问题根源与解决方案

经排查,问题是Ubuntu环境中安装的Homebrew引发了编译冲突。卸载Homebrew后,igraph和mclust库的编译错误消失,可正常完成安装。

卸载Homebrew的命令:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"

内容的提问来源于stack exchange,提问作者Abraham JA

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.19 09:48:28