Intel® oneAPI Base Toolkit
Support for the core tools and libraries within the base toolkit that are used to build and deploy high-performance data-centric applications.
419 Discussions

IntelOne 2022.0.1 - how to link libraries properly

Onur
Beginner
1,897 Views

Hi,

I am having trouble correctly linking the libraries so they are available at compile time. In this particular case I am trying to compile openMPI with intel compilers.

I got the intel oneapi with the following:

sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"

sudo apt install intel-basekit

sudo apt install intel-hpckit

Configuring openmpi with:

./configure --prefix=${HPCX_HOME}/ompi-icc CC=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/icc CXX=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/icpc F77=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/ifort FC=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/ifort  --with-ucx=/usr --with-platform=contrib/platform/mellanox/optimized

my .bashrc has (root has the same .bashrc)

source /opt/intel/oneapi/setvars.sh

export LD_LIBRARY_PATH=/opt/intel/oneapi/compiler/2022.0.1/linux/compiler/lib/intel64_lin

After configure I do : sudo make all and get the following error:

ld: /opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/../../bin/intel64/../../lib/icx-lto.so: error loading plugin: libimf.so: cannot open shared object file: No such file or directory

There is no ifortvars.sh with this new version of oneAPI which seems to have solved similar issues for others in the past.

libimf.so is in:

/opt/intel/oneapi/itac/2021.5.0/bin/rtlib/libimf.so
/opt/intel/oneapi/compiler/2022.0.1/linux/compiler/lib/intel64_lin/libimf.so
/opt/intel/oneapi/intelpython/python3.9/pkgs/intel-cmplr-lib-rt-2022.0.1-intel_3633/lib/libimf.so
/opt/intel/oneapi/intelpython/python3.9/lib/libimf.so
/opt/intel/oneapi/intelpython/python3.9/envs/2022.0.1/lib/libimf.so

 

Any help and/or advice regarding compiling openmpi with recent intel compilers would be appreciated.

0 Kudos
6 Replies
VarshaS_Intel
Moderator
1,878 Views

Hi,

 

Thanks for reaching out to us.

 

Could you please let us know if you are able to get the version of Fortran after sourcing Intel oneAPI environment(source /opt/intel/oneapi/setvars.sh)?

 

Please find the below command to get the version.

 

ifort --version

 

 

Could you please provide us with the make file and sample reproducer along with the steps to reproduce the issue?

 

Thanks & Regards,

Varsha

 

 

0 Kudos
Onur
Beginner
1,861 Views

Hi Varsha,

 

thanks for your reply. 

ifort --version

ifort (IFORT) 2021.5.0 202111091

 

I was able to compile with the following workaround but not sure if this is the most elegant way of doing this

 

my .bashrc has (root has the same .bashrc)

source /opt/intel/oneapi/setvars.sh

created intel_libs.conf in /etc/ld.so.conf.d/ and added the line /opt/intel/oneapi/compiler/2022.0.1/linux/compiler/lib/intel64_lin this is where the libimf.so lives.

sudo ldconfig

compiled openmpi with intel compilers fine after that using:

./configure --prefix={HPCX_HOME}/ompi-icc CC=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/icc CXX=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/icpc F77=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/ifort FC=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/ifort  --with-ucx=/usr --with-platform=contrib/platform/mellanox/optimized
sudo make all 
sudo make install

I attached the config.log of the configuration above. 

0 Kudos
VarshaS_Intel
Moderator
1,817 Views

Hi,


Thanks for providing the detailed information.


We are working on your issue. We will get back to you soon.


Thanks & Regards,

Varsha


0 Kudos
VarshaS_Intel
Moderator
1,764 Views

Hi,

 

We are able to compile the openMPI(4.1.1) with the latest Intel compilers(2022) without any issues. Could you please find the below steps:

 

Step 1: Initialize the Intel oneAPI environment using the below command:

 

source /opt/intel/oneapi/setvars.sh

 

Step 2: Try to do the echo $LD_LIBRARY_PATH if you find the "/opt/intel/oneapi/compiler/2022.0.1/linux/compiler/lib/intel64_lin" then no need to export it.  If not, then please try to export by using the below command:

 

 export LD_LIBRARY_PATH=/opt/intel/oneapi/compiler/2022.0.1/linux/compiler/lib/intel64_lin:$LD_LIBRARY_PATH

 

When we export a library just by using "export LD_LIBRARY_PATH = /opt/intel/oneapi/compiler/2022.0.1/linux/compiler/lib/intel64_lin" then the whole LD_LIBRARY_PATH will be deleted and adds only the one which we exported.

Please find the yellow highlighted part for the library we exported in the below screenshot:

LD_LIBRARY_PATH.png

Step 3: Try to do configure step by using the below command:

 

./configure --prefix=${HPCX_HOME}/ompi-icc CC=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/icc CXX=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/icpc F77=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/ifort FC=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/ifort --with-ucx=/usr --with-platform=contrib/platform/mellanox/optimized

 

And also, make sure that the prefix path is a writable location.

Step 4: Try to do "make all". Please find the below screenshot it did not throw any errors at the time of make all:

 

make all

 

makeAllSuccess.png

Step 5: Now, you can install with "make all install"

 

make all install

 

 

Could you please try and let us know if you are still facing any issues?

 

Thanks & Regards,

Varsha

 

0 Kudos
VarshaS_Intel
Moderator
1,734 Views

Hi,


We haven't heard back from you. Could you please provide an update on your issue?


Thanks & Regards,

Varsha


0 Kudos
VarshaS_Intel
Moderator
1,715 Views

Hi,


We have not heard back from you. This thread will no longer be monitored by Intel. If you need further assistance, please post a new question.


Thanks & Regards,

Varsha


0 Kudos
Reply