using MKL 10.1.1.019.

using MKL 10.1.1.019.

Coming from MKL 9.0 I am trying to use MKL 10.1.1.019 on a pentium 4 laptop in a static version
The compile line/options are :
/opt/intel/Compiler/11.0/081/bin/ia32/ifort -O -c -check -mtune=pentium4 -warn -align all -static-intel -openmp

the link options are :
-L/opt/intel/mkl/10.1.1.019/lib/32/ -lmkl_lapack -lmkl_ia32 -lguide -lpthread -lm

the link fails with the comments :
/opt/intel/mkl/10.1.1.019/lib/32//libmkl_lapack.so: undefined reference to `mkl_serv_load_fun'
/opt/intel/mkl/10.1.1.019/lib/32//libmkl_lapack.so: undefined reference to `mkl_serv_load_thread_fun'
/opt/intel/mkl/10.1.1.019/lib/32//libmkl_lapack.so: undefined reference to `mkl_serv_load_dll'

Where is my error ?

publicaciones de 7 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

The reason of this problem is re-architected Intel MKL since MKL 10.0 and therefore the linking mode was changed.
Please see the KB article "For easily migrating from Intel MKL 9.x to 10.x"
_http://software.intel.com/en-us/articles/performance-tools-for-software-...
It should help you to undersand how to resolve the problem.
For more information you need to write userguide, especially chapter 5 - How to link your application with Intel MKL
--Gennady

Dear Mr Fedorov

Many thanks for the informations and docs.
I red as cleverly as I can the KB article and the chapter 5 of the user guide, and tried to translate these informations into compile and link command as follow.

Compile step :
/opt/intel/Compiler/11.0/081/bin/ia32/ifort -O -c -check -mtune=pentium4 -warn -align all -static-intel -L/opt/intel/mkl/10.1.1.019/lib/32 -I/opt/intel/mkl/10.1.1.019/include aires_de_couples.f

link step :
/opt/intel/Compiler/11.0/081/bin/ia32/ifort -o coqpol aires_de_couples.o ......(a lot of local objects) ..... tri.o -L/opt/intel/mkl/10.1.1.019/lib/32 -I/opt/intel/mkl/10.1.1.019/include -Wl,--start-group /opt/intel/mkl/10.1.1.019/lib/32/libmkl_intel.a /opt/intel/mkl/10.1.1.019/lib/32/libmkl_intel_thread.a /opt/intel/mkl/10.1.1.019/lib/32/libmkl_core.a -Wl,--end-group /opt/intel/mkl/10.1.1.019/lib/32/libiomp5md.a -lpthread -lm

the result at the link has been 171 lines akin the few below :
__tmp_dgetrf_omp.f:(.text+0x3f): undefined reference to `__kmpc_global_thread_num'
/opt/intel/mkl/10.1.1.019/lib/32/libmkl_intel_thread.a(dgetrf_omp.o): In function `L_mkl_lapack_dgetrf_338__par_loop1':
__tmp_dgetrf_omp.f:(.text+0x39a): undefined reference to `__kmpc_dispatch_init_4'
__tmp_dgetrf_omp.f:(.text+0x3f3): undefined reference to `__kmpc_dispatch_next_4'
/opt/intel/mkl/10.1.1.019/lib/32/libmkl_intel_thread.a(dgetrf_omp.o): In function `L_mkl_lapack_dgetrf_241__par_region0':
__tmp_dgetrf_omp.f:(.text+0x555): undefined reference to `omp_get_thread_num'
__tmp_dgetrf_omp.f:(.text+0x57f): undefined reference to `__kmpc_barrier'

I know that static linking isn't encouraged and is a bit more complex, but I must build a static executable code for portability reason.
I certainly missinterpreted some details but what should I improve, what is wrong above ?

Many thanks for your help.

Sincerely yours.

DAELIII

Please read the ifort documentation as well. According to your description, it seems you should be setting '-openmp openmp-link static' in order to link the OpenMP static and pthread libraries, rather than attempting to specify those individually. Your -L appears to be superfluous, but perhaps you should start with the simpler task of getting a dynamic link working. It would be simpler yet if you would use the MKL which comes with your compiler.

I am not trying to do anything except to get a working excutable.
I dowloaded simultanneously the latest version (at the day of downloading) of both compiler and math kernel library, as I am doing for a lot of years. Moreover the options and command line for compiling and linking I am using now, are mere copies of the official Intel doc "migrating from the 9.x MKL to the 10.x" as well as of the "user's guide" from the same source, as suggested by the last information I received.
Something is clearly missing, probably the "openmp-link static" youy ask for. I will try it now
Hope it work.
Does it mean that the use of OpenMP parallelization is mandatory ?
Many thanks

Quoting - daeliii

Does it mean that the use of OpenMP parallelization is mandatory ?

No, setting the OpenMP options in the link step doesn't enable OpenMP in your object files; it only asks the compiler to link in the OpenMP support which you require for the mkl_intel_thread library. If you have been using MKL 10.x for the same OS previously, there is no reason for anything to have changed, but it looks like somehow you failed to link the libiomp5, or didn't consistently use 32-bit compilers and libraries.

Quoting - Gennady Fedorov (Intel)

The reason of this problem is re-architected Intel MKL since MKL 10.0 and therefore the linking mode was changed.
Please see the KB article "For easily migrating from Intel MKL 9.x to 10.x"
_http://software.intel.com/en-us/articles/performance-tools-for-software-...
It should help you to undersand how to resolve the problem.
For more information you need to write userguide, especially chapter 5 - How to link your application with Intel MKL
--Gennady

In addition to this, please also use our MKL link line advisor tool from the MKL KB which is located at
http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/

--Vipin

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya