Intel® MPI Library
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.
2159 Discussions

OneAPI compilers cannot find MPI libraries

Fernandez__Arturo
4,415 Views

Hello,
I'm trying to test the new oneAPI version but even simple compilations produce errors. The installation includes BaseKit & HPCKit, and everything looks fine once completed. However, compiling even a simple HelloWorld code with mpicc (installed at /opt/intel/oneapi/mpi/2021.1-beta10/bin) returns:
/usr/bin/ld: cannot find -lmpifort
/usr/bin/ld: cannot find -lmpi
collect2: error: ld returned 1 exit status
However, at least the first library is there:

ldconfig -p | grep libmpi
libmpijava.so.1 (libc6,x86-64) => /opt/intel/oneapi/mpi/2021.1-beta10/lib/libmpijava.so.1
libmpijava.so (libc6,x86-64) => /opt/intel/oneapi/mpi/2021.1-beta10/lib/libmpijava.so
libmpifort.so.12 (libc6,x86-64) => /opt/intel/oneapi/mpi/2021.1-beta10/lib/libmpifort.so.12
libmpifort.so (libc6,x86-64) => /opt/intel/oneapi/mpi/2021.1-beta10/lib/libmpifort.so
libmpicxx.so.12 (libc6,x86-64) => /opt/intel/oneapi/mpi/2021.1-beta10/lib/libmpicxx.so.12
libmpicxx.so (libc6,x86-64) => /opt/intel/oneapi/mpi/2021.1-beta10/lib/libmpicxx.so
libmpi_shm_heap_proxy.so (libc6,x86-64) => /opt/intel/oneapi/mpi/2021.1-beta10/lib/libmpi_shm_heap_proxy.so

The system is running Ubuntu 20.04 and oneAPI was built with gnu 9.3.0. The error doesn't make sense to me so either something is wrong or I'm missing something (probably the latter).
Thanks.

0 Kudos
1 Solution
GouthamK_Intel
Moderator
4,389 Views

Hi,

Thanks for reaching out to us.


As mentioned by you, we can see that you are running on Ubuntu 20.04. But as per the oneAPI HPC toolkit system requirements documentation currently Ubuntu* 18.04.3 LTS is the supported Target OS in Ubuntu.

Please refer the below link for more information about the System requirements for oneAPI HPC Toolkit.

https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-hpc-toolkit-system-requirements.html


However, Could you please let us know whether you have sourced the setvars.sh script file before running the code?

If not, please source the setvars.sh file located at /opt/opt/intel/oneapi/mpi/2021.1-beta10/ and run the sample code.

If you still face the issue could you please try reinstalling the HPCkit and try running the code again?

Please refer the below guides for more information

Installation guide:

https://software.intel.com/content/www/us/en/develop/articles/installation-guide-for-intel-oneapi-toolkits.html

Get Started with the Intel® oneAPI HPC Toolkit:

https://software.intel.com/content/www/us/en/develop/documentation/get-started-with-intel-oneapi-hpc-linux/top.html

Have a Good day!


Regards

Goutham


View solution in original post

0 Kudos
5 Replies
GouthamK_Intel
Moderator
4,390 Views

Hi,

Thanks for reaching out to us.


As mentioned by you, we can see that you are running on Ubuntu 20.04. But as per the oneAPI HPC toolkit system requirements documentation currently Ubuntu* 18.04.3 LTS is the supported Target OS in Ubuntu.

Please refer the below link for more information about the System requirements for oneAPI HPC Toolkit.

https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-hpc-toolkit-system-requirements.html


However, Could you please let us know whether you have sourced the setvars.sh script file before running the code?

If not, please source the setvars.sh file located at /opt/opt/intel/oneapi/mpi/2021.1-beta10/ and run the sample code.

If you still face the issue could you please try reinstalling the HPCkit and try running the code again?

Please refer the below guides for more information

Installation guide:

https://software.intel.com/content/www/us/en/develop/articles/installation-guide-for-intel-oneapi-toolkits.html

Get Started with the Intel® oneAPI HPC Toolkit:

https://software.intel.com/content/www/us/en/develop/documentation/get-started-with-intel-oneapi-hpc-linux/top.html

Have a Good day!


Regards

Goutham


0 Kudos
Fernandez__Arturo
4,383 Views

Hi Goutham,
Sourcing setvars.sh partially solves the problem. [In the documentation, this step is not discussed until the FPGA section, not during the general installation; however, it is mentioned in the requirement guide and it could also be that the script said something that I didn't pay attention to, cannot recall]. Anyway, I was able to compile a simple code but building larger apps fails at linking. The message is /usr/bin/ld: cannot find -lmpi. I manually expanded the linking options to include libmpi so that the system now sees:
ldconfig -p | grep libmpi
libmpijava.so.1 (libc6,x86-64) => /opt/intel/oneapi/mpi/2021.1-beta10/lib/libmpijava.so.1
libmpijava.so (libc6,x86-64) => /opt/intel/oneapi/mpi/2021.1-beta10/lib/libmpijava.so
libmpifort.so.12 (libc6,x86-64) => /opt/intel/oneapi/mpi/2021.1-beta10/lib/libmpifort.so.12
libmpifort.so (libc6,x86-64) => /opt/intel/oneapi/mpi/2021.1-beta10/lib/libmpifort.so
libmpicxx.so.12 (libc6,x86-64) => /opt/intel/oneapi/mpi/2021.1-beta10/lib/libmpicxx.so.12
libmpicxx.so (libc6,x86-64) => /opt/intel/oneapi/mpi/2021.1-beta10/lib/libmpicxx.so
libmpi_shm_heap_proxy.so (libc6,x86-64) => /opt/intel/oneapi/mpi/2021.1-beta10/lib/libmpi_shm_heap_proxy.so
libmpi_ilp64.so.4.1 (libc6,x86-64) => /opt/intel/oneapi/mpi/2021.1-beta10/lib/release/libmpi_ilp64.so.4.1
libmpi_ilp64.so.4 (libc6,x86-64) => /opt/intel/oneapi/mpi/2021.1-beta10/lib/release/libmpi_ilp64.so.4
libmpi_ilp64.so (libc6,x86-64) => /opt/intel/oneapi/mpi/2021.1-beta10/lib/release/libmpi_ilp64.so
libmpi.so.12 (libc6,x86-64) => /opt/intel/oneapi/mpi/2021.1-beta10/lib/release/libmpi.so.12
libmpi.so (libc6,x86-64) => /opt/intel/oneapi/mpi/2021.1-beta10/lib/release/libmpi.so
So the library is there but the compiler just cannot use it (similarly to what was happening with libmpifort yesterday). My understanding is that to configure the system, IntelMPI sometimes requires to source $.<installdir>/bin64/mpivars.sh [option] but this script is not in the distribution. The closest thing is /opt/intel/oneapi/mpi/2021.1-beta10/env/vars.sh but sourcing it didn't make any difference.
Thanks,
Arturo

0 Kudos
Fernandez__Arturo
4,352 Views
0 Kudos
Jervie
Novice
4,119 Views
I also met this error although I sourced setvars.sh file. I solved this by adding
export MPIPATH=/oneapi/mpi/2021.2.0
export PATH=$MPIPATH/bin:$PATH
export LD_LIBRARY_PATH=$MPIPATH/lib:$LD_LIBRARY_PATH
0 Kudos
GouthamK_Intel
Moderator
4,328 Views

Hi, 

Glad to know that your issue is resolved!

Thanks for the confirmation.

As this issue has been resolved, we will no longer respond to this thread. 

If you require any additional assistance from Intel, please start a new thread. 

Any further interaction in this thread will be considered community only. 

Have a Good day!


Thanks & Regards

Goutham


0 Kudos
Reply