Community
cancel
Showing results for 
Search instead for 
Did you mean: 
regis_vincent
Beginner
118 Views

Static library issue with 64 bits Linux (relocation R_X86_64_32)

I build my software on several platforms using CMake. Everything works fine except on Linux 64 bits using Intel 11.1.073 compiler.
At the link time, I'm getting this error:
ld: /opt/intel/Compiler/11.1/073/lib/intel64/libiomp5.a(kmp_ftn_cdecl.o): relocation R_X86_64_32 against `_2__STRING.0' can not be used when making a shared object; recompile with -fPIC
/opt/intel/Compiler/11.1/073/lib/intel64/libiomp5.a: could not read symbols: Bad value
ld: /opt/intel/Compiler/11.1/073/lib/intel64/libiomp5.a(kmp_ftn_cdecl.o): relocation R_X86_64_32 against `_2__STRING.0' can not be used when making a shared object; recompile with -fPIC/opt/intel/Compiler/11.1/073/lib/intel64/libiomp5.a: could not read symbols: Bad value
I have tried to link the dynamic library of iomp5 and no luck.
0 Kudos
1 Reply
TimP
Black Belt
118 Views

This has been discussed several times before. The static libiomp5 is designed intentionally not to work in shared objects. As you are using icc, you ought to be able to satisfy the openmp references by using icc -openmp (not gcc or ld directly) for the final link, so as to link against libiomp5.so (not by attempting to include portions of the library in your own libraries).
Reply