Community
cancel
Showing results for 
Search instead for 
Did you mean: 
alcallejo
Beginner
294 Views

MKL static linking and /Qopenmp

Hello everyone,
My environment is: Windows 7 64-bit, VS9,Composer XE 2011 SP1.
I'm trying to link MKL following the link line advisor. Everything goes alright if I link dynamically:
mkl_intel_lp64_dll.lib
mkl_intel_thread_dll.lib
mkl_core_dll.lib
But if I try to link statically with
mkl_intel_lp64.lib
mkl_intel_thread.lib
mkl_core.lib
/Qopenmp
I get the following linker error:
[plain]LINK : warning LNK4044: unrecognized option '/Qopenmp'; ignored 2>mkl_intel_thread.lib(dgemm_drv.obj) : error LNK2001: unresolved external symbol __kmpc_global_thread_num 2>mkl_intel_thread.lib(dswap_omp.obj) : error LNK2001: unresolved external symbol __kmpc_global_thread_num 2>mkl_intel_thread.lib(dgemv_omp.obj) : error LNK2001: unresolved external symbol __kmpc_global_thread_num 2>mkl_intel_thread.lib(dgemm_drv.obj) : error LNK2001: unresolved external symbol __kmpc_ok_to_fork 2>mkl_intel_thread.lib(dswap_omp.obj) : error LNK2001: unresolved external symbol __kmpc_ok_to_fork 2>mkl_intel_thread.lib(dgemv_omp.obj) : error LNK2001: unresolved external symbol __kmpc_ok_to_fork 2>mkl_intel_thread.lib(dgemm_drv.obj) : error LNK2001: unresolved external symbol __kmpc_push_num_threads 2>mkl_intel_thread.lib(dswap_omp.obj) : error LNK2001: unresolved external symbol __kmpc_push_num_threads 2>mkl_intel_thread.lib(dgemv_omp.obj) : error LNK2001: unresolved external symbol __kmpc_push_num_threads 2>mkl_intel_thread.lib(dgemm_drv.obj) : error LNK2001: unresolved external symbol __kmpc_fork_call 2>mkl_intel_thread.lib(dswap_omp.obj) : error LNK2001: unresolved external symbol __kmpc_fork_call 2>mkl_intel_thread.lib(dgemv_omp.obj) : error LNK2001: unresolved external symbol __kmpc_fork_call 2>mkl_intel_thread.lib(dgemm_drv.obj) : error LNK2001: unresolved external symbol __kmpc_serialized_parallel 2>mkl_intel_thread.lib(dswap_omp.obj) : error LNK2001: unresolved external symbol __kmpc_serialized_parallel 2>mkl_intel_thread.lib(dgemv_omp.obj) : error LNK2001: unresolved external symbol __kmpc_serialized_parallel 2>mkl_intel_thread.lib(dgemm_drv.obj) : error LNK2001: unresolved external symbol __kmpc_end_serialized_parallel 2>mkl_intel_thread.lib(dswap_omp.obj) : error LNK2001: unresolved external symbol __kmpc_end_serialized_parallel 2>mkl_intel_thread.lib(dgemv_omp.obj) : error LNK2001: unresolved external symbol __kmpc_end_serialized_parallel 2>mkl_intel_thread.lib(dgemm_drv.obj) : error LNK2001: unresolved external symbol omp_get_num_threads 2>mkl_intel_thread.lib(dswap_omp.obj) : error LNK2001: unresolved external symbol omp_get_num_threads 2>mkl_intel_thread.lib(dgemv_omp.obj) : error LNK2001: unresolved external symbol omp_get_num_threads 2>mkl_intel_thread.lib(dgemm_drv.obj) : error LNK2001: unresolved external symbol __kmpc_single 2>mkl_intel_thread.lib(dgemm_drv.obj) : error LNK2001: unresolved external symbol __kmpc_end_single 2>mkl_intel_thread.lib(dgemm_drv.obj) : error LNK2001: unresolved external symbol __kmpc_barrier 2>mkl_intel_thread.lib(dgemm_drv.obj) : error LNK2001: unresolved external symbol omp_get_thread_num 2>mkl_intel_thread.lib(dswap_omp.obj) : error LNK2001: unresolved external symbol omp_get_thread_num 2>mkl_intel_thread.lib(dgemv_omp.obj) : error LNK2001: unresolved external symbol omp_get_thread_num 2>mkl_intel_thread.lib(dgemm_drv.obj) : error LNK2001: unresolved external symbol __kmpc_for_static_init_8 2>mkl_intel_thread.lib(dgemm_drv.obj) : error LNK2001: unresolved external symbol __kmpc_for_static_fini 2>mkl_intel_thread.lib(mkl_threading.obj) : error LNK2001: unresolved external symbol omp_in_parallel 2>mkl_intel_thread.lib(mkl_threading.obj) : error LNK2001: unresolved external symbol omp_get_max_threads 2>mkl_intel_thread.lib(mkl_threading.obj) : error LNK2001: unresolved external symbol omp_get_num_procs[/plain]
I heard it has something to do with OpenMP linking, but I have no idea what I'm missing here. By the way: the way I include the /Qopenmp option is through the options in Linker > Command Line > Additional options.
Any help is highly appreciated.
Regards,
Alfonso
0 Kudos
2 Replies
Gennady_F_Intel
Moderator
294 Views

replace/Qopenmp by libiomp5md.lib into your linking line.
please refer more details about threading libraries into mkl user's guide.
TimP
Black Belt
294 Views

/Qopenmp is a compiler option, equivalent to the properties setting for enabling OpenMP. That would have the effect of including libiomp5md.lib as a linker dependency, but would also activate any OpenMP directives included in your source code.
Reply