Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
7234 Discussions

Can't build custom MKL on Linux, prof edition 11.1

gary-oberbrunner
Beginner
1,395 Views
I get the following error when building a custom MKL on Linux (RedHat 4) with compiler Professional Edition 11.1.064. The makefile seems to be missing a -L directive to find libiomp5. Any suggestions?
[bash]
% make em64t name=foo_mkl
export LIBRARY_PATH=:; \
gcc -shared -Bdynamic \
-u dgemm_ -u ddot_ -u dgetrf_ \
-Wl,--start-group \
"/opt/intel/Compiler/11.1/064/mkl//lib/em64t/libmkl_intel_lp64.a" \
"/opt/intel/Compiler/11.1/064/mkl//lib/em64t/libmkl_intel_thread.a" \
"/opt/intel/Compiler/11.1/064/mkl//lib/em64t/libmkl_core.a" \
-Wl,--end-group \
-L"/opt/intel/Compiler/11.1/064/mkl//lib/em64t" -liomp5 -lm \
-o "foo_mkl.so"
/usr/bin/ld: cannot find -liomp5
collect2: ld returned 1 exit status
make: *** [em64t] Error 1
[/bash]

This patch fixes it for me:

[bash][garyo@smoke4-64 builder]$ diff -u makefile.~1~ makefile
--- makefile.~1~        2009-11-19 08:19:15.000000000 -0500
+++ makefile    2010-02-04 09:33:35.000000000 -0500
@@ -78,6 +78,9 @@
 mklem64t_libpath=$(MKLROOT)/lib/em64t
 mkl64_libpath=$(MKLROOT)/lib/64

+iomp5_ia32_libpath=$(MKLROOT)/../lib/ia32
+iomp5_em64t_libpath=$(MKLROOT)/../lib/intel64
+
 ##------------------------------------------------------------------------------
 ## No changes below this line !
 ##------------------------------------------------------------------------------
@@ -136,7 +139,7 @@
        "$(mkl32_libpath)/$(THREADING_LIB)" \
        "$(mkl32_libpath)/$(CORE_LIB)" \
        -Wl,--end-group \
-       -L"$(mkl32_libpath)" $(OMP_LIB) $(LIBM) \
+       -L"$(mkl32_libpath)" -L"$(iomp5_ia32_libpath)" $(OMP_LIB) $(LIBM) \
        -o "$(name).so"

 em64t:
@@ -148,7 +151,7 @@
        "$(mklem64t_libpath)/$(THREADING_LIB)" \
        "$(mklem64t_libpath)/$(CORE_LIB)" \
        -Wl,--end-group \
-       -L"$(mklem64t_libpath)" $(OMP_LIB) $(LIBM) \
+       -L"$(mklem64t_libpath)" -L"$(iomp5_em64t_libpath)" $(OMP_LIB) $(LIBM) \
        -o "$(name).so"

 ipf ia64:
[/bash]

0 Kudos
2 Replies
Gennady_F_Intel
Moderator
1,395 Views

The makefile seems to be missing a -L directive to find libiomp5. Any suggestions?

The openmp threading library "libiomp5" is located into Compiler's directory ( for example see into ../Compiler/11.1/064/lib/intel64" folder for 64 bit version ).So, you have to set paths to this folder.

the best way to do that - to launch "iccvars.sh intel64" from../Compiler/11.1/064/bin folder.

The reason why libiomp has been stored into another place ( if we look at the stanalone version on MKL we can find libiom5* binaries into /lib/em64t ) is that all CPE components like IPP, MKL and compiler itself are using this library.

So there are no sense to have several duplicates

--Gennady

0 Kudos
gary-oberbrunner
Beginner
1,395 Views

I wasn't suggesting duplicating it, that would make no sense (as you say). Just that the makefile should contain the correct path to wherever libiomp5.so is. Making users run a shell script just makes it harder to do a custom build. Anyway, I submitted a patch to the makefile, you can use it if you want.

0 Kudos
Reply