Hi all,
I am getting a problem in compilation with gfortran(4.1.2).
/opt/intel/mkl/10.0.1.014/lib/em64t/libiomp5.so: undefined reference to `pthread_atfork'
Anybody got the same error, or any information about this library.
thanx
I am getting a problem in compilation with gfortran(4.1.2).
/opt/intel/mkl/10.0.1.014/lib/em64t/libiomp5.so: undefined reference to `pthread_atfork'
Anybody got the same error, or any information about this library.
thanx
链接已复制
14 回复数
Hi
Thanx for your reply. I tried your suggestion but it seems there is something else that is a problem. Here is what i am using and the result, if you can figure out anything.
ifort -L/usr/local/lib64 mm-mkl.o -L/opt/intel/mkl/10.0.1.014/lib/em64t -lmkl -lpapi -lpthread -o mm-mkl
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_flush'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `omp_in_parallel'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_push_num_threads'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_end_serialized_parallel'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_fini_8'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_fixed8_add'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_barrier'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_critical'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_ok_to_fork'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_end_critical'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_init_8'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_global_thread_num'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_serialized_parallel'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_end_ordered'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_fork_call'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_next_8'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_fini'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `omp_get_num_procs'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `omp_get_max_threads'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_ordered'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `omp_get_thread_num'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_init_4'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_init_8'
make: *** [mm-mkl] Error 1
Thanx
Thanx for your reply. I tried your suggestion but it seems there is something else that is a problem. Here is what i am using and the result, if you can figure out anything.
ifort -L/usr/local/lib64 mm-mkl.o -L/opt/intel/mkl/10.0.1.014/lib/em64t -lmkl -lpapi -lpthread -o mm-mkl
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_flush'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `omp_in_parallel'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_push_num_threads'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_end_serialized_parallel'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_fini_8'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_fixed8_add'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_barrier'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_critical'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_ok_to_fork'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_end_critical'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_init_8'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_global_thread_num'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_serialized_parallel'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_end_ordered'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_fork_call'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_next_8'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_fini'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `omp_get_num_procs'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `omp_get_max_threads'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_ordered'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `omp_get_thread_num'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_init_4'
/opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_init_8'
make: *** [mm-mkl] Error 1
Thanx
Hi,
this is how i am linking these libraries. I am sorry but cant make out the problem here.
ifort -L/usr/local/lib64 mm-mkl.o -L/opt/intel/mkl/10.0.1.014/lib/em64t -lmkl -lpapi -lpthread -liomp5 -o mm-mkl
/opt/intel/mkl/10.0.1.014/lib/em64t/libiomp5.so: undefined reference to `pthread_atfork'
make: *** [mm-mkl] Error 1
desert 15% make mm-mkl
ifort -L/usr/local/lib64 mm-mkl.o -L/opt/intel/mkl/10.0.1.014/lib/em64t -lmkl -lpapi -lpthread -lguide -o mm-mkl
/opt/intel/mkl/10.0.1.014/lib/em64t/libguide.so: undefined reference to `pthread_atfork'
make: *** [mm-mkl] Error 1
thanx
this is how i am linking these libraries. I am sorry but cant make out the problem here.
ifort -L/usr/local/lib64 mm-mkl.o -L/opt/intel/mkl/10.0.1.014/lib/em64t -lmkl -lpapi -lpthread -liomp5 -o mm-mkl
/opt/intel/mkl/10.0.1.014/lib/em64t/libiomp5.so: undefined reference to `pthread_atfork'
make: *** [mm-mkl] Error 1
desert 15% make mm-mkl
ifort -L/usr/local/lib64 mm-mkl.o -L/opt/intel/mkl/10.0.1.014/lib/em64t -lmkl -lpapi -lpthread -lguide -o mm-mkl
/opt/intel/mkl/10.0.1.014/lib/em64t/libguide.so: undefined reference to `pthread_atfork'
make: *** [mm-mkl] Error 1
thanx
Hi all, I have a problem similar to this, but Im compiling with C. I was using the version 8.0.2, but I have to change it to the version 10.0.1.014.
Before de change, I had in my makefile the next lines:
LFLAGS = -L/opt/intel/mkl -L$(OFDM_DIR) -L${SPUC_DIR}/utility -L/home/redmov/rgracia/itpp-3.10.8/lib -L/opt/intel/mkl/8.0.2/lib/32 -L/opt/intel/mkl/8.0.2/lib/64
LIBFLAGS = -lspuc -lblas -lmkl_lapack -lmkl_ia32 -lguide -lXthread
Here is what Im using, after the change:
LFLAGS = -L/opt/intel/mkl -L$(OFDM_DIR) -L${SPUC_DIR}/utility -L/home/redmov/rgracia/itpp-3.10.8/lib -L/opt/intel/mkl/10.0.1.014/lib/32 -L/opt/intel/mkl/10.0.1.014/lib/64
LIBFLAGS = -lspuc -lblas -lmkl_lapack -lmkl_ia32 -lmkl_intel_thread -lmkl_core
and here is a few examples of the result (all errors are the same type):
/opt/intel/mkl/10.0.1.014/lib/32/libmkl_intel_thread.a(dgemm_omp.o)(.text+0x501): in function `mkl_blas_dgemm':
: undefined reference to `__kmpc_end_serialized_parallel'
/opt/intel/mkl/10.0.1.014/lib/32/libmkl_intel_thread.a(dgemm_omp.o)(.text+0x75a): in function `L_mkl_blas_dgemm_235__par_loop0':
: undefined reference to `__kmpc_for_static_init_4'
/opt/intel/mkl/10.0.1.014/lib/32/libmkl_intel_thread.a(compute_backward_d_omp.o)(.text+0xf56): in function `L_mkl_dft_compute_backward_d_par_698__par_loop2':
: undefined reference to `__kmpc_end_serialized_parallel'
/opt/intel/mkl/10.0.1.014/lib/32/libmkl_intel_thread.a(compute_backward_d_out_omp.o)(.text+0x2c): in function `mkl_dft_compute_backward_d_out_par':
: undefined reference to `__kmpc_global_thread_num'
/opt/intel/mkl/10.0.1.014/lib/32/libmkl_intel_thread.a(compute_backward_d_out_omp.o)(.text+0x357): in function `L_mkl_dft_compute_backward_d_out_par_554__par_loop1':
: undefined reference to `__kmpc_for_static_init_4'
/opt/intel/mkl/10.0.1.014/lib/32/libmkl_intel_thread.a(compute_backward_d_out_omp.o)(.text+0x63d): EnSignal Caught... cleaning up.
make: *** [programa] Error 1
If you know how to solve this, please tell me. Thank you very much for your help. Bye!
Before de change, I had in my makefile the next lines:
LFLAGS = -L/opt/intel/mkl -L$(OFDM_DIR) -L${SPUC_DIR}/utility -L/home/redmov/rgracia/itpp-3.10.8/lib -L/opt/intel/mkl/8.0.2/lib/32 -L/opt/intel/mkl/8.0.2/lib/64
LIBFLAGS = -lspuc -lblas -lmkl_lapack -lmkl_ia32 -lguide -lXthread
Here is what Im using, after the change:
LFLAGS = -L/opt/intel/mkl -L$(OFDM_DIR) -L${SPUC_DIR}/utility -L/home/redmov/rgracia/itpp-3.10.8/lib -L/opt/intel/mkl/10.0.1.014/lib/32 -L/opt/intel/mkl/10.0.1.014/lib/64
LIBFLAGS = -lspuc -lblas -lmkl_lapack -lmkl_ia32 -lmkl_intel_thread -lmkl_core
and here is a few examples of the result (all errors are the same type):
/opt/intel/mkl/10.0.1.014/lib/32/libmkl_intel_thread.a(dgemm_omp.o)(.text+0x501): in function `mkl_blas_dgemm':
: undefined reference to `__kmpc_end_serialized_parallel'
/opt/intel/mkl/10.0.1.014/lib/32/libmkl_intel_thread.a(dgemm_omp.o)(.text+0x75a): in function `L_mkl_blas_dgemm_235__par_loop0':
: undefined reference to `__kmpc_for_static_init_4'
/opt/intel/mkl/10.0.1.014/lib/32/libmkl_intel_thread.a(compute_backward_d_omp.o)(.text+0xf56): in function `L_mkl_dft_compute_backward_d_par_698__par_loop2':
: undefined reference to `__kmpc_end_serialized_parallel'
/opt/intel/mkl/10.0.1.014/lib/32/libmkl_intel_thread.a(compute_backward_d_out_omp.o)(.text+0x2c): in function `mkl_dft_compute_backward_d_out_par':
: undefined reference to `__kmpc_global_thread_num'
/opt/intel/mkl/10.0.1.014/lib/32/libmkl_intel_thread.a(compute_backward_d_out_omp.o)(.text+0x357): in function `L_mkl_dft_compute_backward_d_out_par_554__par_loop1':
: undefined reference to `__kmpc_for_static_init_4'
/opt/intel/mkl/10.0.1.014/lib/32/libmkl_intel_thread.a(compute_backward_d_out_omp.o)(.text+0x63d): EnSignal Caught... cleaning up.
make: *** [programa] Error 1
If you know how to solve this, please tell me. Thank you very much for your help. Bye!
This does appear to be similar to the case discussed in this thread. You have specified the mkl thread library, but omitted to link the OpenMP run time (libiomp5 or libguide) and pthread. Those could be added explicitly at the end, just as recommended above, or they could be taken care of by using icc -openmp to link.
I also have a similar problem to this, but more complicated. Whenever I try to include the MKL in a shared library I'm building, it automatically pulls in libguide.so, but for some strange reason I always have to link against pthread in the final application, not the library. So, for an example, I can build a library called libtestproj.so (this library contains main(), just to simplify the example) like so:
$ gcc -fPIC -c -Wall testproj.c
$ gcc -shared -Wl,-soname,libtestproj.so -o libtestproj.so testproj.o -lc -L/opt/depot/intel/mkl/9.1/lib/em64t -lmkl -lmkl_lapack -lm -lpthread
Now, you would expect that this library should be able to stand alone, since it links with pthread. But instead, when I try to make an executable:
$ gcc -L. -ltestproj
/opt/depot/intel/mkl/9.1/lib/em64t/libguide.so: undefined reference to `pthread_atfork'
collect2: ld returned 1 exit status
That's weird enough, but it gets even weirder: libguide appears to already contain pthread, so why do I have to even link against pthread at all?
$ ldd /opt/depot/intel/mkl/9.1/lib/em64t/libguide.so
libc.so.6 => /lib64/libc.so.6 (0x00002ab14e244000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002ab14e598000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002ab14e79d000)
/lib64/ld-linux-x86-64.so.2 (0x0000003937a00000)
$ ldd libtestproj.so
libc.so.6 => /lib64/libc.so.6 (0x00002ac298f05000)
libmkl.so => /opt/depot/intel/mkl/9.1/lib/em64t/libmkl.so (0x00002ac299259000)
libmkl_lapack.so => /opt/depot/intel/mkl/9.1/lib/em64t/libmkl_lapack.so (0x00002ac2993da000)
libm.so.6 => /lib64/libm.so.6 (0x00002ac299b47000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002ac299dca000)
/lib64/ld-linux-x86-64.so.2 (0x0000003937a00000)
libguide.so => /opt/depot/intel/mkl/9.1/lib/em64t/libguide.so (0x00002ac299fe5000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002ac29a147000)
I am losing my mind. Please help.
Thanks in advance.
$ gcc -fPIC -c -Wall testproj.c
$ gcc -shared -Wl,-soname,libtestproj.so -o libtestproj.so testproj.o -lc -L/opt/depot/intel/mkl/9.1/lib/em64t -lmkl -lmkl_lapack -lm -lpthread
Now, you would expect that this library should be able to stand alone, since it links with pthread. But instead, when I try to make an executable:
$ gcc -L. -ltestproj
/opt/depot/intel/mkl/9.1/lib/em64t/libguide.so: undefined reference to `pthread_atfork'
collect2: ld returned 1 exit status
That's weird enough, but it gets even weirder: libguide appears to already contain pthread, so why do I have to even link against pthread at all?
$ ldd /opt/depot/intel/mkl/9.1/lib/em64t/libguide.so
libc.so.6 => /lib64/libc.so.6 (0x00002ab14e244000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002ab14e598000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002ab14e79d000)
/lib64/ld-linux-x86-64.so.2 (0x0000003937a00000)
$ ldd libtestproj.so
libc.so.6 => /lib64/libc.so.6 (0x00002ac298f05000)
libmkl.so => /opt/depot/intel/mkl/9.1/lib/em64t/libmkl.so (0x00002ac299259000)
libmkl_lapack.so => /opt/depot/intel/mkl/9.1/lib/em64t/libmkl_lapack.so (0x00002ac2993da000)
libm.so.6 => /lib64/libm.so.6 (0x00002ac299b47000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002ac299dca000)
/lib64/ld-linux-x86-64.so.2 (0x0000003937a00000)
libguide.so => /opt/depot/intel/mkl/9.1/lib/em64t/libguide.so (0x00002ac299fe5000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002ac29a147000)
I am losing my mind. Please help.
Thanks in advance.
libpthread is provided with the glibc in your linux distro, not replicated in Intel OpenMP or gomp libraries. It would always be a dynamiclink dependency, unless you took steps to include all required components from libpthread.a in your own build. Your ldd results show that the .so libraries are built with a dependency on libpthread.so, which is normal.
If you use a recent MKL, andlink with mkl_sequential (no threading), then all MKL dependencies on OpenMP and libpthread go away. Your title indicates a much more recent MKL than your ldd results.
Quoting - tim18
libpthread is provided with the glibc in your linux distro, not replicated in Intel OpenMP or gomp libraries. It would always be a dynamiclink dependency, unless you took steps to include all required components from libpthread.a in your own build. Your ldd results show that the .so libraries are built with a dependency on libpthread.so, which is normal.
If you use a recent MKL, andlink with mkl_sequential (no threading), then all MKL dependencies on OpenMP and libpthread go away. Your title indicates a much more recent MKL than your ldd results.
Sorry about that; I didn't mean to imply that I was using the same version of MKL as the original poster, nor that pthread was in any way a part of Intel's libraries.
What I was showing was that even though libpthread is already a known and found dependency of libguide, no program that will link against it will build unless it links against libpthread.so at least a second time. This behavior confuses me, since the fact that the libguide.so is already linked against (and sees!) libpthread.so should mean it's already in there. I shouldn't have to link against it again when I build my library. And even if I do, I certainly shouldn't have to link against it a third time when I link my final application against the library I built, though in fact that is what I have to do to get it to build without errors.
Theoretically, as far as I know, only the object that requires a library should have to link against it. Everything that requires the original object should be able to be ignorant of that. It is worth noting that we do not observe this bizarre linker behavior in any situation or with any library except the Intel MKL, so I have assumed it is related to something in Intel's libguide.so. I could be wrong, but I don't know what else to do.
If newer versions of MKL solve this problem, then I will try and find out if there's a way we can move everything up to the latest version.
Thanks.
The only other info I can find about this is a forum thread somewhere else that says that this is a bug in libguide.so. pthread_atfork() needs to be linked statically (apparently libpthread.so is some weird linker script that contains both static and shared components), and should never be an undefined symbol in a shared library. I hope you're right about this being fixed in the next version, because it sounds like that's the only option.
https://lists.linux-foundation.org/pipermail/lsb-discuss/2006-September/003001.html
https://lists.linux-foundation.org/pipermail/lsb-discuss/2006-September/003001.html
We have upgraded to MKL 10.1. The same dependency is present in this version of the library, and the same problem occurs.
The only information I have is still the link I posted in the previous post, which (I repeat) seems to say this is an Intel bug resulting from someone passing subtly incorrect arguments to the linker whenever libguide.so and libiomp5.so were built.
Any advice or workarounds would be appreciated.
The only information I have is still the link I posted in the previous post, which (I repeat) seems to say this is an Intel bug resulting from someone passing subtly incorrect arguments to the linker whenever libguide.so and libiomp5.so were built.
Any advice or workarounds would be appreciated.
