Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6957 Discussions

Help with static linking linux - MKL 10.0.3.24 - gcc 4.2 - Lapack lib

regis_vincent
Beginner
233 Views
Hi,

I have being trying to create a static library containing some of Intel MKL libs for my application.
Here my link command:
g++ -shared -o libtest.so src/test/*.o ../../../3rdParty/ipp/Linux/5.3.2.068/ia32/lib/libippcvemerged.a ../../../3rdParty/ipp/Linux/5.3.2.068/ia32/lib/libippiemerged.a ../../../3rdParty/ipp/Linux/5.3.2.068/ia32/lib/libippcvmerged.a ../../../3rdParty/ipp/Linux/5.3.2.068/ia32/lib/libippimerged.a ../../../3rdParty/ipp/Linux/5.3.2.068/ia32/lib/libippcore.a ../../../3rdParty/mkl/Linux/10.0.3.020/lib/32/libmkl_sequential.a ../../../3rdParty/mkl/Linux/10.0.3.020/lib/32/libmkl_intel.a ../../../3rdParty/mkl/Linux/10.0.3.020/lib/32/libmkl_core.a

The problem is I get two undefined funtions (the one I use :-)
../../lib/libtest.so: undefined reference to `mkl_lapack_dpptrf'
../../lib/libtest.so: undefined reference to `mkl_lapack_dpptrs'

I have tried every order and still I can't get the function to be defined. Yet nm on the libmkl_sequential.a tells me there are defined:
00000000 T mkl_lapack_dpptrf

I would appreciate any help.


0 Kudos
1 Reply
TimP
Honored Contributor III
233 Views

For a link with static MKL libraries, you must observe the instructions about -Wl,--begin-group ...... -Wl,--end-group, or repeat the MKL .a libraries with the circular dependencies 3 times (4 times, if you don'tcorrect the order).

0 Kudos
Reply