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

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

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.

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Best Reply

Quoting - Susheel Kumar Sekhar
[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.[c]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

Quoting - Gergana Slavova (Intel)

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.[c]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

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

Regards,
~Gergana

Leave a Comment

Please sign in to add a comment. Not a member? Join today