Ifort Linker behavior on Linux vs. OSX (dynamic vs. static)

Ifort Linker behavior on Linux vs. OSX (dynamic vs. static)

 

If I just use ifort -dryrun on some code with ifort (2018 on Linux, 2019beta on OSX) then I can see that linking is done dynamically on Linux and statically 

on OSX Darwin. Is this always like that, and is there a possibility to change that? 

On Linux:

ld  \
    /usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib64/crt1.o \
    /usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib64/crti.o \
    /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o \
    --eh-frame-hdr \
    --build-id \
    -dynamic-linker \
    /lib64/ld-linux-x86-64.so.2 \
    -m \
    elf_x86_64 \
    -o \
    a.out \
    /afs/desy.de/UBU/16/x86_64/opt/intel/2018/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin/for_main.o \
    -L/afs/desy.de/UBU/16/x86_64/opt/intel/2018/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin \
    -L/usr/lib/gcc/x86_64-linux-gnu/5/ \
    -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/ \
    -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib64 \
    -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/ \
    -L/lib/x86_64-linux-gnu/ \
    -L/lib/../lib64 \
    -L/lib/../lib/ \
    -L/usr/lib/x86_64-linux-gnu/ \
    -L/usr/lib/../lib64 \
    -L/usr/lib/../lib/ \
    -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../ \
    -L/lib64 \
    -L/lib/ \
    -L/usr/lib64 \
    -L/usr/lib \
    /tmp/ifortKVc2SH.o \
    -Bdynamic \
    -Bstatic \
    -lifport \
    -lifcoremt \
    -limf \
    -lsvml \
    -Bdynamic \
    -lm \
    -Bstatic \
    -lipgo \
    -lirc \
    -Bdynamic \
    -lpthread \
    -Bstatic \
    -lsvml \
    -Bdynamic \
    -lc \
    -lgcc \
    -lgcc_s \
    -Bstatic \
    -lirc_s \
    -Bdynamic \
    -ldl \
    -lc \
    /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o \
    /usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib64/crtn.o

and on OSX:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld  \
    -dynamic \
    -arch \
    x86_64 \
    -weak_reference_mismatches \
    non-weak \
    -macosx_version_min \
    10.13.4 \
    -no_compact_unwind \
    -rpath \
    /opt/intel//compilers_and_libraries_2019.0.041/mac/compiler/lib \
    -o \
    a.out \
    /opt/intel//compilers_and_libraries_2019.0.041/mac/compiler/lib/for_main.o \
    -L/opt/intel//compilers_and_libraries_2019.0.041/mac/compiler/lib \
    -L/usr/lib \
    /var/folders/dg/bw4c07x12sqb74d__br9b2080000gn/T/ifortRssNJ8.o \
    /opt/intel//compilers_and_libraries_2019.0.041/mac/compiler/lib/libifport.a \
    /opt/intel//compilers_and_libraries_2019.0.041/mac/compiler/lib/libifcoremt.a \
    /opt/intel//compilers_and_libraries_2019.0.041/mac/compiler/lib/libimf.a \
    /opt/intel//compilers_and_libraries_2019.0.041/mac/compiler/lib/libsvml.a \
    /opt/intel//compilers_and_libraries_2019.0.041/mac/compiler/lib/libipgo.a \
    -lSystem \
    /opt/intel//compilers_and_libraries_2019.0.041/mac/compiler/lib/libirc.a \
    -lpthread \
    /opt/intel//compilers_and_libraries_2019.0.041/mac/compiler/lib/libsvml.a \
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.1.0/lib/darwin/libclang_rt.osx.a

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

By default, there is a mixture of static and dynamic libraries linked in.

Which library (or libraries) are you specifically concerned about?

 

Actually in the meanwhile I found the flag -shared-intel which I could use to get the linking of the intel intrinsics shared libraries (ifport etc.). 

 

Leave a Comment

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