将英特尔的MKL(BLAS&LAPACK)连接到GCC
Linking Intel's MKL (BLAS & LAPACK) to GCC
我正在尝试编译一个巨大的软件包,而这似乎是我无法解决的最后一个障碍。
我得到如下错误:
RNDiracDeterminantBase.cpp:(.text+0x22bf): undefined reference to `dgetrf_'
RNDiracDeterminantBase.cpp:(.text+0x2524): undefined reference to `dgetri_'
RNDiracDeterminantBase.cpp:(.text+0x3005): undefined reference to `dgetri_'
../../lib/libqmcwfs.a(RNDiracDeterminantBase.cpp.o): In function `qmcplusplus::RNDiracDeterminantBase::ratio(qmcplusplus::ParticleSet&, int, qmcplusplus::ParticleAttrib<qmcplusplus::TinyVector<double, 3u> >&, qmcplusplus::ParticleAttrib<double>&)':
RNDiracDeterminantBase.cpp:(.text+0x4156): undefined reference to `dgemv_'
RNDiracDeterminantBase.cpp:(.text+0x420f): undefined reference to `dger_'
Google透露,这些引用是英特尔的MKL库。但是,我不知道我需要链接什么文件。我试过libmkl_core。libmkl_gnu_thread。libmkl_blacs_intelmpi_lp64。一个,等等。
里面有很多文件/mkl/lib/intel64/
可以根据需要发布更多信息
我不知道我需要链接什么文件。我试过libmkl_core。libmkl_gnu_thread。libmkl_blacs_intelmpi_lp64。一个,等等。在:
中有大量的文件/mkl/lib/intel64/
事实上有大量的文件并不意味着你必须依次尝试每个库。
要找出哪个库定义了你想要的符号,运行这个命令:
cd /mkl/lib/intel64
nm -A *.a | egrep '[TWBD] (dger_|dgemv_|dgetrf_|dgetri_)$'
还要确保将库放在链接行的末尾,因为命令行上归档库的顺序很重要。
根据您提供的不完整信息,您很可能需要libmkl_intel_lp64。libmkl_gnu_thread。A和libmkl_core.a。
英特尔MKL有一个内置的工具来帮助你找出链接:/MKL/tools/mkl_link_tool。这个工具也可以在网站上找到:http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor。使用此工具可以根据您的情况获得确切的链接行。
你应该在MKL官方论坛(http://software.intel.com/en-us/forums/intel-math-kernel-library)上提出你的问题。你可以在几小时内得到这类问题的答案,而不是几天。
我在windows上设置mingw时遇到了类似的问题。
下面的库链接顺序为我工作与gcc:
- mkl_intel_thread
- mkl_rt
- mkl_core
- mkl_intel_lp64
- 当套接字连接断开时检测C/C++Unix
- 无法在windows上使用mingw将sqlite3与c连接
- 到连接组件算法的问题(递归)
- QTcpSocket在不阻塞GUI的情况下重新连接到服务器
- 无法在C++中建立与MySQL数据库的连接
- PC中的程序和PHONE中的本机描述应用程序之间的数据连接
- 在Qt Creator中,如何在连接到正在运行的进程后查看控制台输出
- 连接 dockerized 模型和 dockerized 数据库时出现"无法 SQLConnect"错误
- 使用 bfs 解决连接组件问题时得到错误的答案
- 在C++的两个字符串中连接以逗号分隔的唯一值
- 如何修复valgrind启动时的致命错误(与libc6-dbg和libc6-dbg:i386连接)
- C++应用程序 MySQL odbc 数据库连接错误:在引发"otl_tmpl_exception<>"实例后终止调用
- OSX蓝牙打开RFCOMMChannelAsync声称已连接,但未建立连接,并且从未调用过委托
- 在 libcurl 连接池中预创建连接
- 套接字连接"Operation not permitted"错误,甚至使用升压/平发器根.cpp
- libcurl 和 DNS ttl 中的内部连接管理
- 直接在RcppArmadillo中调用LAPACK例程
- 如何应用 libcurl 的持久连接选项
- 提升 ASIO - io_service 不要等待连接到线程
- WinSock2:connect() 提供"连接被拒绝"