cmake可以在MSYS上找到Blas2

发布于 2025-01-18 13:11:32 字数 1645 浏览 1 评论 0 原文

我正在尝试在Windows上的MSYS2环境中编译此软件。这是查找包的行:

FIND_PACKAGE(BLAS REQUIRED)
FIND_PACKAGE(LAPACK REQUIRED)
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})

我已经使用安装了 BLAS/LAPACK 依赖项

pacman -S make msys/cmake msys/gcc-fortran mingw64/mingw-w64-x86_64-openblas64

,但收到错误消息:

CMake Error at /usr/share/cmake-3.22.1/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find BLAS (missing: BLAS_LIBRARIES)
Call Stack (most recent call first):
  /usr/share/cmake-3.22.1/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.22.1/Modules/FindBLAS.cmake:1337 (find_package_handle_standard_args)
  CMakeLists.txt:403 (FIND_PACKAGE)

您可能会找到修改后的 CMakeLists.txt 文件 这里(我已经注释掉了所有与MPI、MMG、MKL和APPLE相关的条目),可以看到完整的输出此处

我可能可以按照此处此处

SET(BLAS_LIBRARIES /c/tools/msys64/mingw64/lib/libopenblas_64.a)
SET(LAPACK_LIBRARIES /c/tools/msys64/mingw64/lib/libopenblas_64.a)

但我希望 CMake 自动查找这些依赖项。如果您能帮助我了解在 MSYS2 下安装 BLAS/LAPACK 库并让 CMAKE 使用 FIND_PACKAGE() 函数或其他方式自动查找它们的规范方法,我将不胜感激。

I am trying to compile this software in the MSYS2 environment on Windows. This is the line looking for the packages:

FIND_PACKAGE(BLAS REQUIRED)
FIND_PACKAGE(LAPACK REQUIRED)
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})

I have installed the BLAS/LAPACK dependencies using

pacman -S make msys/cmake msys/gcc-fortran mingw64/mingw-w64-x86_64-openblas64

but I get the error messages:

CMake Error at /usr/share/cmake-3.22.1/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find BLAS (missing: BLAS_LIBRARIES)
Call Stack (most recent call first):
  /usr/share/cmake-3.22.1/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.22.1/Modules/FindBLAS.cmake:1337 (find_package_handle_standard_args)
  CMakeLists.txt:403 (FIND_PACKAGE)

You may find the modified CMakeLists.txt file here (I have commented out all the MPI, MMG, MKL, and APPLE-related entries), and the complete output can be seen here.

I can probably specify the locations explicitly as described here and here

SET(BLAS_LIBRARIES /c/tools/msys64/mingw64/lib/libopenblas_64.a)
SET(LAPACK_LIBRARIES /c/tools/msys64/mingw64/lib/libopenblas_64.a)

but I want CMake to find these dependencies automatically. I would appreciate it if you could help me know what is the canonical way to get BLAS/LAPACK libraries installed under MSYS2 and get CMAKE to find them automatically with the FIND_PACKAGE() functions or otherwise.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文