如何解决“找不到具有BLAS API的必需库”的问题?

时间:2018-06-19 12:49:01

标签: terminal compiler-errors cygwin lapack blas

我只是按照http://jdftx.org/CompilingBasic.html页上的说明尝试安装JDFTx。

我已经从此处(Windows,x64)安装了Cygwin:https://cygwin.com/install.html。而且我也相信我已经安装了必要的库,在这里列出:http://jdftx.org/Dependencies.html

现在,当我在Cygwin64终端中输入命令时:

cmake ../jdftx-VERSION/jdftx

我收到以下消息:

CMake Error at /usr/share/cmake-3.6.2/Modules/FindBLAS.cmake:690 (message):
  A required library with BLAS API not found.  Please specify library
  location.
Call Stack (most recent call first):
  /usr/share/cmake-3.6.2/Modules/FindLAPACK.cmake:165 (find_package)
  CMake-Modules/FindLAPACK_ATLAS.cmake:20 (find_package)
  CMakeLists.txt:85 (find_package)


-- Configuring incomplete, errors occurred!
See also "/cygdrive/c/jdftx/build/CMakeFiles/CMakeOutput.log".
See also "/cygdrive/c/jdftx/build/CMakeFiles/CMakeError.log".

解决方案是改用此命令,从而显式指定库的位置:

cmake -DLAPACK_LIBRARIES=/usr/lib/liblapack.dll.a ../jdftx-1.4.1/jdftx

但是,现在我得到以下输出,其中包含另一个错误消息:

    -- Forcing static linking for Cygwin/Windows
-- Found GSL: /lib/libgsl.dll.a
-- Found FFTW3:  /lib/libfftw3_threads.dll.a /lib/libfftw3.dll.a
-- Found LAPACK: /usr/lib/liblapack.dll.a
-- Found CBLAS: /usr/lib/libgslcblas.dll.a
-- Found MPI_C: /usr/lib/libmpi.dll.a;/usr/lib/libopen-rte.dll.a;/usr/lib/libope                                                     n-pal.dll.a;/usr/lib/libm.a;/usr/lib/w32api/libgdi32.a
CMake Warning at /usr/share/cmake-3.6.2/Modules/FindMPI.cmake:420 (message):
  Unable to find MPI library mpi_cxx
Call Stack (most recent call first):
  /usr/share/cmake-3.6.2/Modules/FindMPI.cmake:610 (interrogate_mpi_compiler)
  CMakeLists.txt:93 (find_package)


CMake Error at /usr/share/cmake-3.6.2/Modules/FindPackageHandleStandardArgs.cmak                                                     e:148 (message):
  Could NOT find MPI_CXX (missing: MPI_CXX_LIBRARIES)
Call Stack (most recent call first):
  /usr/share/cmake-3.6.2/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA                                                     _FAILURE_MESSAGE)
  /usr/share/cmake-3.6.2/Modules/FindMPI.cmake:628 (find_package_handle_standard                                                     _args)
  CMakeLists.txt:93 (find_package)


-- Configuring incomplete, errors occurred!
See also "/cygdrive/c/jdftx/build/CMakeFiles/CMakeOutput.log".
See also "/cygdrive/c/jdftx/build/CMakeFiles/CMakeError.log".

有人会知道在cmake通话中我还应该使用其他哪个选项?

谢谢!

1 个答案:

答案 0 :(得分:1)

解决方案是:

cmake -DLAPACK_LIBRARIES=/usr/lib/liblapack.dll.a -DMPI_CXX_LIBRARIES=/usr/lib/libmpi_mpifh.dll.a ../jdftx-1.4.1/jdftx

现在我意识到,这不是第二种错误的解决方案...

实际的解决方案是卸载所有相关的库并安装以前的版本(而不是最新的版本)。完成后,一切正常。