ATLAS-LAPACK没有链接到BLAS

时间:2015-06-24 22:40:57

标签: c lapack blas atlas

我参加了标准的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_'

它一直在继续,抱怨像dscal_,dcopy_等缺少BLAS功能。我已经截断了输出。为什么会这样?

1 个答案:

答案 0 :(得分:0)

解决了这一点。需要链接到lgfortran。