如何解决问题"A required library with BLAS API not found"?

How to solve the issue "A required library with BLAS API not found"?

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

我从这里安装了 Cygwin (Windows, x64): https://cygwin.com/install.html . And I also believe that I have installed necessary libraries, listed here: 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 调用中使用什么其他选项吗?

谢谢!

解决方法是:

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

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

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