cmake找不到oneapi库mkl_gf_lp64和mkl_gnu_thread

发布于 2025-01-20 14:56:50 字数 1955 浏览 1 评论 0原文

我正在尝试调整最初为英特尔MKL编写的源代码,并将其编译为 macos

我已经修改了Cmakelists,以找到这样的Oneapi库:

    option (USE_ONEAPI "Enable MKL solver support via OneAPI Base Toolkit" ON)
    ...
    if (USE_ONEAPI)
    message(STATUS "Seeking OneAPI libraries...")
    list(APPEND MKL_LIBS "mkl_core" "mkl_gf_lp64" "mkl_gnu_thread" "pthread")
    foreach (f ${MKL_LIBS})
        if (INTEL_ONEAPI_DIR)
            # user provided OneAPI directory
            set(oneapiMklDir "${INTEL_ONEAPI_DIR}/mkl/latest")
            message(STATUS "    Seeking for ${f} in custom path: ${oneapiMklDir}...")
            find_library (${f}_LIB ${f} PATH "${INTEL_ONEAPI_DIR}/mkl/lib/intel64/" DOC "MKLPARDISO (library)")
            include_directories ("${INTEL_ONEAPI_DIR}/mkl/include")
        else ()
            set(oneapiDir "/opt/intel/oneapi")
            set(oneapiMklDir "${oneapiDir}/mkl/latest")
            message(STATUS "    Seeking for ${f} in default path: ${oneapiMklDir}...")
            find_library (${f}_LIB ${f} HINTS "${oneapiMklDir}/lib" DOC "MKLPARDISO (library)")
            include_directories ("${oneapiMklDir}/include")
        endif ()
        if (${${f}_LIB} STREQUAL "${f}_LIB-NOTFOUND")
            message (FATAL_ERROR "OneAPI ${f} library not found")
        else()
            message (STATUS "OK: ${f} library successfully found")
        endif ()
        list (APPEND EXT_LIBS ${${f}_LIB})
    endforeach ()
    list (APPEND MODULE_LIST "MKLPARDISO")
    endif ()

这就是结果:

-- Seeking OneAPI libraries...
--     Seeking for mkl_core in default path: /opt/intel/oneapi/mkl/latest...
-- OK: mkl_core_LIB library successfully found
--     Seeking for mkl_gf_lp64 in default path: /opt/intel/oneapi/mkl/latest...
CMake Error at CMakeLists.txt:379 (message):
OneAPI mkl_gf_lp64 library not found

我不确定Cmake为什么未能找到这些库。它们不是使用Oneapi基础和HPC工具包安装吗?

I am trying to adapt a source code originally written for Intel MKL to the latest OneAPI and compile it under MacOS.

I have modified the CMakeLists to find OneAPI libraries like this:

    option (USE_ONEAPI "Enable MKL solver support via OneAPI Base Toolkit" ON)
    ...
    if (USE_ONEAPI)
    message(STATUS "Seeking OneAPI libraries...")
    list(APPEND MKL_LIBS "mkl_core" "mkl_gf_lp64" "mkl_gnu_thread" "pthread")
    foreach (f ${MKL_LIBS})
        if (INTEL_ONEAPI_DIR)
            # user provided OneAPI directory
            set(oneapiMklDir "${INTEL_ONEAPI_DIR}/mkl/latest")
            message(STATUS "    Seeking for ${f} in custom path: ${oneapiMklDir}...")
            find_library (${f}_LIB ${f} PATH "${INTEL_ONEAPI_DIR}/mkl/lib/intel64/" DOC "MKLPARDISO (library)")
            include_directories ("${INTEL_ONEAPI_DIR}/mkl/include")
        else ()
            set(oneapiDir "/opt/intel/oneapi")
            set(oneapiMklDir "${oneapiDir}/mkl/latest")
            message(STATUS "    Seeking for ${f} in default path: ${oneapiMklDir}...")
            find_library (${f}_LIB ${f} HINTS "${oneapiMklDir}/lib" DOC "MKLPARDISO (library)")
            include_directories ("${oneapiMklDir}/include")
        endif ()
        if (${${f}_LIB} STREQUAL "${f}_LIB-NOTFOUND")
            message (FATAL_ERROR "OneAPI ${f} library not found")
        else()
            message (STATUS "OK: ${f} library successfully found")
        endif ()
        list (APPEND EXT_LIBS ${${f}_LIB})
    endforeach ()
    list (APPEND MODULE_LIST "MKLPARDISO")
    endif ()

And this is the outcome:

-- Seeking OneAPI libraries...
--     Seeking for mkl_core in default path: /opt/intel/oneapi/mkl/latest...
-- OK: mkl_core_LIB library successfully found
--     Seeking for mkl_gf_lp64 in default path: /opt/intel/oneapi/mkl/latest...
CMake Error at CMakeLists.txt:379 (message):
OneAPI mkl_gf_lp64 library not found

I am not sure why CMake fails to find those libraries. Are they not installed with OneAPI base and HPC toolkits?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

み格子的夏天 2025-01-27 14:56:50

这已经很旧了,所以您可能已经找到了解决方案,但由于我正在处理 oneapi 问题,我想我会为下一个人回答。

不包括 mkl_gf_lp64,但包括 mkl_intel_lp64。两者并不等同,因此您可能需要 mkl_intel_thread。

您还可以使用 oneAPI MKL Library Link Line Advisor 来准确确定您需要什么。

https:// www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-link-line-advisor.html

This is old so likely you already found a solution, but since I'm going through oneapi questions I figured I'd answer for the next person.

The mkl_gf_lp64 is not included but mkl_intel_lp64 is. The two are not equivalent so you would likely need mkl_intel_thread.

You can also use the oneAPI MKL Library Link Line Advisor to figure out exactly what you need.

https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-link-line-advisor.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文