Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Robert_Bielik
Beginner
102 Views

Link problem on Ubuntu 10.04

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
102 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
102 Views

Problem is how to specify that with CMakeLists.txt files...
Robert_Bielik
Beginner
102 Views

Or rather, which library contains symbol 'mkl_dft_commit_node_s_r2c_md_omp' ??
TIA
/Rob
Robert_Bielik
Beginner
102 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
102 Views

that's exactly what Victor ( post #1) recommended to do and Linker Adviser recommend the similar things
Reply