Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
11 Views

Including ifort libraries

Hi. I'm working on a code that uses OpenMPI, C++, and Fortran. I'm also using cmake to create the make files. If I set the linker to mpicc, it can't find some fortran stuff but knows where the MPI stuff is. If I set the linker to ifort, it finds the fortran stuff but can't find the MPI stuff. So my current solution is to keep the linker as mpicc and reveal to the compiler where the ifort libraries are. Unfortunately, I don't know where they are either. Looking for a way to give the ifort libraries to mpicc or an alternative (entirely different) solution. 

0 Kudos
3 Replies
Highlighted
Beginner
11 Views

Also, the error i'm getting is an undefined reference to 'for_write_seq_lis_xmit' in the fortran part of the code.

0 Kudos
Highlighted
Black Belt
11 Views

For several years, the OpenMPI Fortran wrapper has been named mpifort (just 1 letter different from the Intel MPI one).  If your MPI is built with ifort, this will find the Fortran libraries, and -lstdc++ will find the C++ STL.

If you use the MPI C++ wrapper, and have no MPI calls in your Fortran, you would set the ifort environment (as you probably did already) and append the -l specifications for the required libraries in the ifort installation. Normally, 'which ifort' would give you a clue where to look for the libraries associated with your ifort.  The C wrapper which you appear to prefer will require -lstdc++ as well as Fortran library specifications.

0 Kudos
Highlighted
Beginner
11 Views

That worked, thx!

0 Kudos