提问人:sunxd 提问时间:10/27/2023 最后编辑:Cris Luengosunxd 更新时间:10/27/2023 访问量:51
错误:从 C 链接到 Fortran 库失败(从源代码编译八度音阶)
error: linking to Fortran libraries from C fails (compile octave from source)
问:
我尝试按照此处的说明在 Ubuntu 20.04 上从源代码编译八度音阶:
https://wiki.octave.org/Building
在此之前,我已经根据以下位置安装了依赖项:https://wiki.octave.org/Octave_for_Debian_systems
然后我收到以下错误
checking g++ compiler version number... 9.4.0
checking whether stl_algo.h is broken... no
checking gcc compiler version number... 9.4.0
configure: defining __NO_MATH_INLINES avoids buggy GNU libc exp function
checking for sin in -lm... yes
checking for gfortran... gfortran
checking whether the compiler supports GNU Fortran 77... yes
checking whether gfortran accepts -g... no
checking whether a usable Fortran compiler was found... yes
checking how to get verbose linking output from gfortran... -v
checking for Fortran 77 libraries of gfortran... -L/home/linuxbrew/.linuxbrew/Cellar/gcc/13.2.0/bin/../lib/gcc/current/gcc/x86_64-pc-linux-gnu/13 -L/home/linuxbrew/.linuxbrew/opt/glibc/lib -L/home/linuxbrew/.linuxbrew/lib/gcc/current -L/home/linuxbrew/.linuxbrew/lib -lgfortran -lm -lquadmath
checking for dummy main to link with Fortran 77 libraries... unknown
configure: error: in `/home/sunxd/octave-8.3.0/.build':
configure: error: linking to Fortran libraries from C fails
在config.log中,我发现
configure:18457: gcc -o conftest -g -O2 conftest.c -lm -L/home/linuxbrew/.linuxbrew/Cellar/gcc/13.2.0/bin/../lib/gcc/current/gcc/x86_64-pc-linux-gnu/ 13 -L/home/linuxbrew/.linuxbrew/opt/glibc/lib -L/home/linuxbrew/.linuxbrew/lib/gcc/current -L/home/linuxbrew/.linuxbrew/lib -lgfortran -lm -lquadmath >&5 ¬
2160 /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':¬
2161 (.text+0x16): undefined reference to `__libc_csu_fini'¬
2162 /usr/bin/ld: (.text+0x1d): undefined reference to `__libc_csu_init'¬
2163 collect2: error: ld returned 1 exit status¬
2164 configure:18457: $? = 1¬
2165 configure: failed program was:¬
2166 | /* confdefs.h */¬
使用(弗拉基米尔的建议)env |grep PATH
MANPATH=/home/linuxbrew/.linuxbrew/share/man:/home/linuxbrew/.linuxbrew/share/man::
WINDOWPATH=2
INFOPATH=/home/linuxbrew/.linuxbrew/share/info:/home/linuxbrew/.linuxbrew/share/info:
PATH=/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/sunxd/
我已经从 .profile 中注释掉了 linuxbrew 的脚本,但 linuxbrew 仍然存在。
# eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
注销并重新登录 Linux Brew 现已离开。
根据 Ian 的建议,我摆脱了 f2c alreay。
现在配置通过了。
答: 暂无答案
评论
env
grep