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

problem with MKL linking in an openmp app and -tcheck option for Intel Thread Checker use

Luis_Alberto
Beginner
834 Views

Hello,

I asked this question in another forum and was adviced to ask here, so here is my question:

I am trying to paralellize an existing Fortran code using OpenMP. In order to debug it, I want to use Intel Thread Checker 3.1 for Linux.

I compile every source file using 'ifort -openmp -g -O0 -tcheck -o object.o source.f'

I link using:

ifort -openmp -g -O0 -tcheck -o pilot_simpl st-comun_s.o pilot_simpl.o etaxjadp.o tlibredp.o resol_dp.o locin1te.o cpccano.o cierredp.o cierredp.o extelldp.o fundlo.o fundex.o input_s.o output_s.o simetria_p.o sfbiesf.o sfpotbi.o esfuerzos.o rutinas_assemble.o QKJ.o intufi.o fundex_partes.o obtenerpi.o reaccionencabeza.o intuxi_bottom.o obtenerqeqv.o condicionamiento.o matricesMP.o instrato_s.o piers.o vector_datos.o rigidez.o obtener_colocacion.o ComputeTransformationMatrix.o RotateMatrix.o -L /opt/intel/Compiler/11.0/083/mkl/lib/em64t -Wl,--start-group -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -Wl,--end-group -openmp -tcheck -lpthread

The libraries are the ones that work for me when I do not use -tcheck, but when I use '-tcheck' I start to get undefined references such as the ones listed below.

Can someone please help me with this?

Notes: I link to mkl libraries such as: zgetrf_, dgemv_ and dgemm_'

My version of ifort and mkl are 11.0.083.

I have Intel Thread Checker 3.1 installed and running, and environment variables set.

/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_ok_to_fork'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_ordered'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_init_8'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_barrier'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_next_4'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_critical'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_fini_8'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_serialized_parallel'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_end_critical'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_init_8'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_fini_4'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_push_num_threads'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_init_4'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_end_serialized_parallel'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_flush'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_next_8'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_init_4'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_global_thread_num'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_end_ordered'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_fork_call'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_fixed8_add'
/opt/intel/Compiler/11.0/083/mkl/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_fini'
0 Kudos
3 Replies
Gennady_F_Intel
Moderator
834 Views

Luis,

all these undefined references are related with threading library. So,please try to add -liomp5 -lpthread into the linking line and let us know how it will works.

--Gennady

0 Kudos
Luis_Alberto
Beginner
834 Views

Thank you Gennady!

It links now! One question: Should I use the option -liomp5 to kink even if a don't want to use -tcheck and I am not debbuging?

0 Kudos
barragan_villanueva_
Valued Contributor I
834 Views

Hi,

If your application uses MKL threading then these libraries are required.

Just visit http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/for details

0 Kudos
Reply