ATLAS-LAPACK 未链接到 BLAS

ATLAS-LAPACK not linking to BLAS

我进行了标准的 ATLAS 编译。所有测试都通过了,但是当我尝试使用以下命令进行编译时:

gcc prog.c -o prog -I/home/atlas_build/include -L/home/atlas_build/lib -llapack -lcblas -lm

它给出了一大堆错误:

dsyevr.f:(.text+0xbb): undefined reference to `lsame_'
dsyevr.f:(.text+0xe3): undefined reference to `lsame_'
dsyevr.f:(.text+0x102): undefined reference to `lsame_'
dsyevr.f:(.text+0x125): undefined reference to `lsame_'
dsyevr.f:(.text+0x148): undefined reference to `lsame_'
/home/atlas_build/lib/liblapack.a(dsyevr.o):dsyevr.f:(.text+0x1ac): more undefined references to `lsame_' follow
/home/atlas_build/lib/liblapack.a(dsyevr.o): In function `dsyevr_':
dsyevr.f:(.text+0x39e): undefined reference to `xerbla_'
dsyevr.f:(.text+0x742): undefined reference to `dscal_'
dsyevr.f:(.text+0x7cb): undefined reference to `dscal_'
dsyevr.f:(.text+0x9cb): undefined reference to `dcopy_'
dsyevr.f:(.text+0xa15): undefined reference to `dcopy_'
dsyevr.f:(.text+0xa84): undefined reference to `dcopy_'
dsyevr.f:(.text+0xac2): undefined reference to `dcopy_'
dsyevr.f:(.text+0x1146): undefined reference to `dscal_'
dsyevr.f:(.text+0x124b): undefined reference to `dswap_'

它一直在抱怨 BLAS 函数缺失,如 dscal_、dcopy_ 等。我截断了输出。为什么会这样?

已解决此问题。需要 link 对抗 lgfortran。