Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29253 Discussions

-static-intel problem in composer xe 2011

Joon_Shik_Y_
Beginner
518 Views

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.

0 Kudos
3 Replies
Georg_Z_Intel
Employee
518 Views
Hello, please place the object and/or source file(s) BEFORE the static libraries, like this: [plain] 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 [/plain] 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: http://software.intel.com/en-us/forums/topic/359002 Best regards, Georg Zitzlsberger
0 Kudos
Joon_Shik_Y_
Beginner
518 Views

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?

0 Kudos
TimP
Honored Contributor III
518 Views

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.

0 Kudos
Reply