Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26732 Discussions

How to use ifort compiler to compile a fortran code and generate a "not a dynamic executable" file?

Zheng__Lianyuan
Beginner
291 Views

Hello,  We previously used lf95 compiler to compile a fortran code to generate a static-linking executable file on RedHat Linux machine.  This executable file can be run on other Linux machine.  Recently, we shifted compiler from lf95 to Intel ifort.  When we use ifort compiler to compile the same fortran code with option -static-intel to generate an executable file, this file cannot be run on different Linux machine with "error while loading shared libraries", suggesting this executable is not static rather than dynamic linking.   On the machine with lf95 compiler, I type the command "ldd lf95" and it shows "not a dynamic executable", but on the machine with ifort compiler, when I type the command "ldd ifort", it shows:

        linux-vdso.so.1 =>  (0x00007ffca1daa000)
        libm.so.6 => /lib64/libm.so.6 (0x00002ab9da428000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00002ab9da72b000)
        libc.so.6 => /lib64/libc.so.6 (0x00002ab9da947000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002ab9dad0a000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00002ab9daf21000)
        /lib64/ld-linux-x86-64.so.2 (0x000055d6902d6000)

My question here is that how can we install Intel compiler package with static rather than dynamic so when I type command "ldd ifort" it will show "not a dynamic executable" so we can use ifort compiler to compile a fortran code and generate a "not a dynamic executable" file?

Thanks,

Lianyuan

0 Kudos
3 Replies
TimP
Black Belt
291 Views
Under limited conditions, ifort -static could build a static binary, regardless of the requirement of ifort itself for shared objects. One of the conditions is that you don't use parallel (except possibly -static-mpi). It's usually preferable to set -static-intel which will use only shared objects required by Linux installation.
Velasquez__Jose_Anto
291 Views

I just installed Intel Parallel Studio XE Cluster Edition 2019.1.053. As I tried to source the script psxevars.csh I got the following:

bash: psxevars.csh: line 35: syntax error near unexpected token `$arg'
bash: psxevars.csh: line 35: `        switch ($arg)'

When I entered "source psxevars.sh", the following message appeared:

ERROR: Unknown switch 'INTEL_PYTHON=3'. Accepted value is 'intel64'.

CondaEnvironmentNotFoundError: Could not find environment: INTEL_PYTHON=3 .
You can list all discoverable environments with `conda info --envs`.

Could you help me with this issue, please?

 

Steve_Lionel
Black Belt Retired Employee
291 Views

Jose, please post this in a new thread. It is unrelated to the current thread.

Reply