Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.

Link problem on Ubuntu 10.04

Robert_Bielik
Beginner
179 Views
Hi all, I have a CMake based crossplatform application which uses MKL, and builds on Windows/OSX and Linux. On the latter, I have one link problem left:
/opt/intel/mkl/lib/ia32/libmkl_core.a(_def_dfti_create_srmd.o): In function `commit':
../../../../dft/kernel/0ref/dfti_create_srmd.c:(.text+0x15): undefined reference to `mkl_dft_commit_node_s_r2c_md_omp'
/opt/intel/mkl/lib/ia32/libmkl_core.a(_def_dfti_create_srmd.o): In function `commit':../../../../dft/kernel/0ref/dfti_create_srmd.c:(.text+0x15): undefined reference to `mkl_dft_commit_node_s_r2c_md_omp'
[...snip...]
What library am I missing ? The libraries linked to are (output from the FindMKL.cmake script):
-- MKL_LIBRARIES: /opt/intel/mkl/lib/ia32/libmkl_intel.a;/opt/intel/mkl/lib/ia32/libmkl_intel_thread.a;/opt/intel/mkl/lib/ia32/libmkl_core.a;/opt/intel/lib/ia32/libiomp5.a;/opt/intel/mkl/lib/ia32/libmkl_cdft_core.a
Help ? :)
TIA
/Rob
0 Kudos
5 Replies
barragan_villanueva_
Valued Contributor I
179 Views
Hi,

To link with MKL static libraries on Linux it needs to use -Wl,--start-group ... -Wl,--end-group ld-options.
Please use Intel MKL Link Line Advisor
Robert_Bielik
Beginner
179 Views
Problem is how to specify that with CMakeLists.txt files...
Robert_Bielik
Beginner
179 Views
Or rather, which library contains symbol 'mkl_dft_commit_node_s_r2c_md_omp' ??
TIA
/Rob
Robert_Bielik
Beginner
179 Views
Actually I solved it by enclosing my libraries using MKL, and the MKL libraries within the start-group, end-group like so:
TARGET_LINK_LIBRARIES(Application -Wl,--start-group MyLibA MyLibB ${MKL_LIBRARIES} -Wl,--end-group)
and that seems to take care of things :)
/Rob
Gennady_F_Intel
Moderator
179 Views
that's exactly what Victor ( post #1) recommended to do and Linker Adviser recommend the similar things
Reply