Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussions

New behavior of the -shared switch in 8.0.046

reuti_at_intel
377 Views
With the 7.1 and the first versions of the 8.0 Fortran compiler, the switch -shared had no effect of the still static linking of the compiler's own libraries:

> ifc -shared -o qay.so qay.o -#
ld
/usr/lib/crti.o
/opt/intel/compiler70/ia32/lib/crtxi.o
-shared
--version-script
/opt/intel/compiler70/ia32/lib/icrt.internal.map
-u
___get_intrinsics
-o
qay.so
-rpath
/opt/intel/compiler70/ia32/lib
qay.o
-Qy
-L/opt/intel/compiler70/ia32/lib
-L/usr/lib
-Bstatic
-lintrins
-lIEPCF90
-lF90
-lintrins
-limf
-Bdynamic
-lm
-Bstatic
-lirc
-Bdynamic
-lcxa
-Bstatic
-lunwind
-Bdynamic
-lc
/opt/intel/compiler70/ia32/lib/crtxn.o
/usr/lib/crtn.o

And also with -static-libcx no change (only for libcxa):

> ifc -static-libcxa -shared -o qay.so qay.o -#
ld
/usr/lib/crti.o
/opt/intel/compiler70/ia32/lib/crtxi.o
-shared
--version-script
/opt/intel/compiler70/ia32/lib/icrt.internal.map
-u
___get_intrinsics
-o
qay.so
-rpath
/opt/intel/compiler70/ia32/lib
qay.o
-Qy
-L/opt/intel/compiler70/ia32/lib
-L/usr/lib
-Bstatic
-lintrins
-lIEPCF90
-lF90
-lintrins
-limf
-Bdynamic
-lm
-Bstatic
-lirc
-lcxa
-lunwind
-Bdynamic
-lc
/opt/intel/compiler70/ia32/lib/crtxn.o
/usr/lib/crtn.o

Okay, that's what I want. But using the latest version of Fortran (8.0.046) I get the following result:

> ifort -shared -o qay.so qay.o -#
ld
/usr/lib/crti.o
/opt/intel_fc_80/lib/crtxi.o
-shared
--version-script
/opt/intel_fc_80/lib/icrt.internal.map
-m
elf_i386
-o
qay.so
qay.o
-Qy
-L/opt/intel_fc_80/lib
-L/usr/lib
-lifport
-lifcoremt
-limf
-lm
-lcxa
-lunwind
-lpthread
-lirc
-lc
-lirc
/opt/intel_fc_80/lib/crtxn.o
/usr/lib/crtn.o

Or when you add -static-libcxa in addition any effect now:

> ifort -static-libcxa -shared -o qay.so qay.o -#
ld
/usr/lib/crti.o
/opt/intel_fc_80/lib/crtxi.o
-shared
--version-script
/opt/intel_fc_80/lib/icrt.internal.map
-m
elf_i386
-o
qay.so
qay.o
-Qy
-L/opt/intel_fc_80/lib
-L/usr/lib
-lifport
-lifcoremt
-limf
-lm
-lcxa
-lunwind
-lpthread
-lirc
-lc
-lirc
/opt/intel_fc_80/lib/crtxn.o
/usr/lib/crtn.o

Is there any way to get the original behavior back (without specifying the whole link command by hand on my own).

Cheers - Reuti
0 Kudos
2 Replies
Lorri_M_Intel
Employee
377 Views

I currently am working on an open problem report that states that -static_libcxa no longer works with -shared (yep, that's a bug).

When I get that working, will that give you what you want, or is there something else I didn't understand in your message?

Thanks -

- Lorri

0 Kudos
reuti_at_intel
377 Views
Well, libcxa.so is only one of the standard Intel libraries. I would like to get a shared library, where all Intel specific libraries are statical linked in already.

For now I renamed the libraries in the /opt/intel_fc_80/lib folder simply to

libcxa.so.disabled
libifcoremt.so.disabled
libifport.so.disabled
libimf.so.disabled
libunwind.so.disabled

to force the linker to use the static ones, and I get the intended result. It really seems to be:

1. -static-libcxa with -shared will not mit honored
2. -shared implies -i_dynamic (link all Intel libraries dynamic)

Thanks for the reply - Reuti

PS: I think I found a different behavior in the icc 8.0.066: -static-libcxa will link there all Intel libraries statically (i.e. libcprts and libunwind which are without this switch dynamic - but they should be static by default [unless -i_dynamic is given])
0 Kudos
Reply