-static-intel problem in composer xe 2011

-static-intel problem in composer xe 2011

Hi, I have a problem with -static-intel option. there is a link error.

ifort -O2 -fpic -shared -nofor_main -Wl,-rpath,'$ORIGIN' -o libFBAPICS.so -L/opt/intel/composer_xe_2011_sp1.9.293/mkl/include -L. -lstdc++ -static-intel /opt/intel/composer_xe_2011_sp1.9.293/compiler/lib/intel64/libifcore_pic.a /opt/intel/composer_xe_2011_sp1.9.293/compiler/lib/intel64/libifport.a /opt/intel/composer_xe_2011_sp1.9.293/compiler/lib/intel64/libimf.a /opt/intel/composer_xe_2011_sp1.9.293/compiler/lib/intel64/libsvml.a ADDRESS.o ld: /opt/intel/composer_xe_2011_sp1.9.293/compiler/lib/intel64/libifcore.a(for_close.o): relocation R_X86_64_32 against `.rodata.str1.4' can not be used when making a shared object; recompile with -fPIC
/opt/intel/composer_xe_2011_sp1.9.293/compiler/lib/intel64/libifcore.a: could not read symbols: Bad value
make: *** [FBAPICS] Error 1

i have tried libifcoremt_pic.a also but it doesnt work.

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.


please place the object and/or source file(s) BEFORE the static libraries, like this:

ifort ADDRESS.o -O2 -fpic -shared -nofor_main -Wl,-rpath,'$ORIGIN' -o libFBAPICS.so -L/opt/intel/composer_xe_2011_sp1.9.293/mkl/include -L. -lstdc++ -static-intel /opt/intel/composer_xe_2011_sp1.9.293/compiler/lib/intel64/libifcore_pic.a /opt/intel/composer_xe_2011_sp1.9.293/compiler/lib/intel64/libifport.a /opt/intel/composer_xe_2011_sp1.9.293/compiler/lib/intel64/libimf.a /opt/intel/composer_xe_2011_sp1.9.293/compiler/lib/intel64/libsvml.a

The order of providing static libraries has impact on the symbol-lookup as the linker is one-pass only.

FYI: This is the related thread which describes the problem of non-working -static-intel & -fpic (regarding libifcore) and will also announce the fix once available:

Best regards,

Georg Zitzlsberger

Thank you for your kind answer. It works.

Can I ask you one more?

Actually, I want to make my so linked statically. Intel fortran's library is removed with your help.

But there are still these libraries.

linux-vdso.so.1 => (0x00007fff5f9ff000)
libm.so.6 => /lib64/libm.so.6 (0x00007f11f5b4f000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f11f5931000)
libc.so.6 => /lib64/libc.so.6 (0x00007f11f55d3000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f11f53cf000)
/lib64/ld-linux-x86-64.so.2 (0x00007f11f6ef1000)

I have tried -static-libgcc // -no-cxxlib but it doesnt work.

Am i missing something?

The -static option will cause ld to prefer the static library alternative to the linux shared libraries, if both are installed.  Lately, several major linux distros have been set up so that several of those static libraries will not be installed by default.  You would need to search your linux installation media and online upgrade repositories to find them.

Leave a Comment

Please sign in to add a comment. Not a member? Join today