Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29424 ディスカッション

Error while loading shared libraries: libiomp5.so

jirina
新規コントリビューター I
9,144件の閲覧回数

I am trying to create an application in the following way:

ifort -fixed -extend_source 132 -openmp -fpscomp general -warn declarations -assume byterecl -threads -align all -heap-arrays file1.for file2.for ... fileN.for -o MyApp.out

After I start the application, I get the error 'Error while loading shared libraries: libiomp5.so'.

I updated my .bash_profile to include

source /opt/intel/Compiler/11.0/044/bin/ifortvars.sh ia32

and added also

export PATH=/opt/intel/Compiler/11.0/044/lib/ia32:$PATH

because this path contains libiomp5.so, but I am still getting the same error message.

What am I doing wrong? Please note that I am a complete newbie in Linux and Intel Fortran in Linux, so my questions might be quite stupid :-[Is there any way how to "link a library to an application" so that the application can be distributed?

0 件の賞賛
1 解決策
TimP
名誉コントリビューター III
9,144件の閲覧回数

If your ifortvars script does not set LD_LIBRARY_PATH, it looks like an installation failure.

I don't think the beta version provides for distributing your application. When you have a standard license for the released version, you have the choice of -static-intel to avoid use of .so from the ifort installation, or the right to send the necessary .so files (check with ldd) with your file.

元の投稿で解決策を見る

7 返答(返信)
af123_af007
ビギナー
9,144件の閲覧回数

Did you set the LD_LIBRARY_PATH?

TimP
名誉コントリビューター III
9,144件の閲覧回数
Quoting - af123_af007

Did you set the LD_LIBRARY_PATH?

Unlike Windows, where shared libraries may be found on PATH, linux PATH is not used for that purpose. The ifortvars script sets both PATH and LD_LIBRARY_PATH, so it is useful both at compile and at run time.

jirina
新規コントリビューター I
9,144件の閲覧回数

I am running this in my .bash_profile:

source /opt/intel/Compiler/11.0/044/bin/ifortvars.sh ia32

I checked that PATH contains

/opt/intel/Compiler/11.0/044/bin/ia32

However, I did not find LD_LIBRARY_PATH, just LIBRARY_PATH, containing

/opt/intel/Compiler/11.0/044/mkl/lib/32

However, this directory does not contain libiomp5.so which is reported to be missing when I try starting my

application.

I tried adding /opt/intel/Compiler/11.0/044/lib/ia32 to LIBRARY_PATH, because I found libiomp5.so in that

directory, but this did not help.

Finally, I tried following:

export LD_LIBRARY_PATH=/opt/intel/Compiler/11.0/044/lib/ia32:$LD_LIBRARY_PATH

which made my application work!

Does this mean that ifortvars.sh does not work well and specifies LIBRARY_PATH instead of LD_LIBRARY_PATH, in

addition containg incorrect path ?

Another question is what I should do to be able to distribute my application to other people who don't have

Intel Fortran installed.

Thank you in advance for any help.

TimP
名誉コントリビューター III
9,145件の閲覧回数

If your ifortvars script does not set LD_LIBRARY_PATH, it looks like an installation failure.

I don't think the beta version provides for distributing your application. When you have a standard license for the released version, you have the choice of -static-intel to avoid use of .so from the ifort installation, or the right to send the necessary .so files (check with ldd) with your file.

jirina
新規コントリビューター I
9,144件の閲覧回数

Thank you for your ideas. I reinstalled Intel Fortran from 11.044 to 11.069, there were no problems with the installation, and after running ifortvars.sh (source /opt/intel/Compiler/11.0/069/bin/ifortvars.sh ia32) I have everything correct. There seems to be a problem with running the script in .bash_profile, which I tried to run the script automatically after the login.

bgeneto
ビギナー
9,144件の閲覧回数
Quoting - jirina

There seems to be a problem with running the script in .bash_profile, which I tried to run the script automatically after the login.


I don't think that was the problem. I had exactly the same problem with LD_LIBRARY_PATH not been set by ifort 11.1.038 under Ubuntu linux 9.04 x64. Running the ifortvars script manually or automatically sets only LIBRARY_PATH, not the correct environment variable LD_LIBRARY_PATH required in order to run your application in parallel. I think the ifortvars.sh script should be carefully revised for linux, meanwhile one solution is to add the following line in your .bashrc (local) or /etc/profile (global) file (just after calling ifortvars.sh with source command):

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIBRARY_PATH


Good luck!

mirko_vukovic
ビギナー
9,144件の閲覧回数
Here is another possibility: Make sure LD_LIBRARY_PATH is not overwritten somewhere else in .bashrc
返信