Community
cancel
Showing results for 
Search instead for 
Did you mean: 
539 Views

Error with Intel MPI (ld: cannot find -lmpi)

Jump to solution
I installed Intel MPI Library and tried compiling one of the test programs that come along with it (test.f). While doing so, here's the error message that I see.

[susheel@localhost intel_mpi_test]$ /opt/intel/impi/3.2.2.006/bin/mpiifort test.f
ld: skipping incompatible /opt/intel/impi/3.2.2.006/lib/libmpi.so when searching for -lmpi
ld: skipping incompatible /opt/intel/impi/3.2.2.006/lib/libmpi.a when searching for -lmpi
ld: cannot find -lmpi

I couldn't find any information regarding -lmpi. Is there something that I'm missing here?
Thanks very much.
0 Kudos
1 Solution
Gergana_S_Intel
Employee
539 Views
[susheel@localhost intel_mpi_test]$ /opt/intel/impi/3.2.2.006/bin/mpiifort test.f
ld: skipping incompatible /opt/intel/impi/3.2.2.006/lib/libmpi.so when searching for -lmpi

I couldn't find any information regarding -lmpi. Is there something that I'm missing here?

Hi Susheel,

First off, to answer your question, -lmpi is the Intel MPI Library. It's what you need to link with if using any MPI routines.

Do you have an Intel 64 machine (a Xeon of some type) that you're using in 64-bit mode? If yes, then the solution is simple: You're using a 32-bit version of the library, based on your path:

/opt/intel/impi/3.2.2.006/lib/libmpi.so

Instead, try the libmpi.so file from the /opt/intel/impi/3.2.2.006/lib64 directory. To do so, we recommend that you source the appropriate mpivars.sh script (depending on your shell) located in the /opt/intel/impi/3.2.2.006/bin64 directory.

It should go something like this:

$ source /opt/intel/impi/3.2.2.006/bin64/mpivars.csh
$ which mpiifort
/opt/intel/impi/3.2.2.006/bin64/mpiifort
$ mpiifort test.f

I hope this helps. Let me know how it goes.

Regards,
~Gergana

View solution in original post

3 Replies
Gergana_S_Intel
Employee
540 Views
[susheel@localhost intel_mpi_test]$ /opt/intel/impi/3.2.2.006/bin/mpiifort test.f
ld: skipping incompatible /opt/intel/impi/3.2.2.006/lib/libmpi.so when searching for -lmpi

I couldn't find any information regarding -lmpi. Is there something that I'm missing here?

Hi Susheel,

First off, to answer your question, -lmpi is the Intel MPI Library. It's what you need to link with if using any MPI routines.

Do you have an Intel 64 machine (a Xeon of some type) that you're using in 64-bit mode? If yes, then the solution is simple: You're using a 32-bit version of the library, based on your path:

/opt/intel/impi/3.2.2.006/lib/libmpi.so

Instead, try the libmpi.so file from the /opt/intel/impi/3.2.2.006/lib64 directory. To do so, we recommend that you source the appropriate mpivars.sh script (depending on your shell) located in the /opt/intel/impi/3.2.2.006/bin64 directory.

It should go something like this:

$ source /opt/intel/impi/3.2.2.006/bin64/mpivars.csh
$ which mpiifort
/opt/intel/impi/3.2.2.006/bin64/mpiifort
$ mpiifort test.f

I hope this helps. Let me know how it goes.

Regards,
~Gergana

View solution in original post

539 Views

Hi Susheel,

First off, to answer your question, -lmpi is the Intel MPI Library. It's what you need to link with if using any MPI routines.

Do you have an Intel 64 machine (a Xeon of some type) that you're using in 64-bit mode? If yes, then the solution is simple: You're using a 32-bit version of the library, based on your path:

/opt/intel/impi/3.2.2.006/lib/libmpi.so

Instead, try the libmpi.so file from the /opt/intel/impi/3.2.2.006/lib64 directory. To do so, we recommend that you source the appropriate mpivars.sh script (depending on your shell) located in the /opt/intel/impi/3.2.2.006/bin64 directory.

It should go something like this:

$ source /opt/intel/impi/3.2.2.006/bin64/mpivars.csh
$ which mpiifort
/opt/intel/impi/3.2.2.006/bin64/mpiifort
$ mpiifort test.f

I hope this helps. Let me know how it goes.

Regards,
~Gergana


Thanks very much, Gergana. You're right, I am working on a 64 bit Intel machine and problem seems to have been because of the 32 bit version of the library. I have tried recompiling it with the 64 bit version and it works just fine.

Thanks again,
Susheel
Gergana_S_Intel
Employee
539 Views

I'm glad you have it working, Susheel. Enjoy your new library :)

Regards,
~Gergana

Reply