Intel OneAPI 2022 - libimf.so No such file or directory - during openMPI compilation

trying to compile openmpi with intel oneapi 2022.0.1 compilers OS is 5.4.0-26-generic #30-Ubuntu SMP Mon Apr 20 16:58:30 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

I got the intel compilers as follows (just to make sure I didn't mess anything up at that step)

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 install 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.


Here is the solution I found but doubt that this is the most elegant way of doing this:

OS is 5.4.0-26-generic #30-Ubuntu SMP Mon Apr 20 16:58:30 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

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 hope this helps someone else and please let me know if there is a better way of doing this. Cheers