错误原因:无法找到 cblas

错误原因:无法找到 cblas

我正在尝试运行BdG-TMAT 代码。此处的文件夹包含 Fortran 和 python 文件,因为主运行文件 BDG_K.py 使用了一些 fortran 函数。因此,为了运行 fortran 代码,我使用转换器 f2py,它将 tmatf.f90 转换为 tmatf.so。(f2py 随 numpy 自动安装)。我正在运行 BdG-Tmat 文件夹的 make,出现以下错误:

gfortran:f77: /tmp/tmpQErUyR/src.linux-x86_64-2.7/potsub-f2pywrappers.f
/usr/bin/gfortran -Wall -Wall -shared /tmp/tmpQErUyR/tmp/tmpQErUyR/src.linux-x86_64-2.7/potsubmodule.o /tmp/tmpQErUyR/tmp/tmpQErUyR/src.linux-x86_64-2.7/fortranobject.o /tmp/tmpQErUyR/potsub.o /tmp/tmpQErUyR/tmp/tmpQErUyR/src.linux-x86_64-2.7/potsub-f2pywrappers.o potsubi.o -lgsl -llapack -lcblas -lgslcblas -lgfortran -o ./potsub.so
/usr/bin/ld: error: cannot find -lcblas
collect2: error: ld returned 1 exit status
/usr/bin/ld: error: cannot find -lcblas
collect2: error: ld returned 1 exit status
error: Command "/usr/bin/gfortran -Wall -Wall -shared /tmp/tmpQErUyR/tmp/tmpQErUyR/src.linux-x86_64-2.7/potsubmodule.o /tmp/tmpQErUyR/tmp/tmpQErUyR/src.linux-x86_64-2.7/fortranobject.o /tmp/tmpQErUyR/potsub.o /tmp/tmpQErUyR/tmp/tmpQErUyR/src.linux-x86_64-2.7/potsub-f2pywrappers.o potsubi.o -lgsl -llapack -lcblas -lgslcblas -lgfortran -o ./potsub.so" failed with exit status 1
make: *** [potsub.so] Error 1

因此,在运行此文件夹中的 python 文件时,出现以下错误:

     $python BDG_K.py 
Traceback (most recent call last):
  File "BDG_K.py", line 29, in <module>
    import tmatf
ImportError: /home/arpit/Desktop/BdG-Tmat/tmatf.so: undefined symbol: dsbevx_

所提到的符号在原始文件中不存在(其中是 dsbevx 而不是 dsbevx_)

请指导如何正确安装 CBLAS 以消除第一个错误,以及第二个错误是否与第一个错误有关。我尝试创建 CBLAS 源文件夹,但无法正常工作。我遵循了以下操作:http://vibrationdata.wordpress.com/2011/11/07/install-cblas-in-ubuntu/

答案1

为了消除这些错误,您需要安装 lapack 和 atlas。我在以下网站上找到了说明数值线性代数。您可以使用 synaptic 或apt-get安装该页面上列出的软件包,然后您的转换库将会编译。

相关内容