Intel® oneAPI HPC Toolkit
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
1828 Discussions

mpif90 from cluster toolkit pointing to gfortran

Ben_Beeler
Beginner
987 Views
Recently purchased cluster toolkit and installed without issues. When compiling a software program (wien2k), I can compile in serial using ifort. However, when I attempt to compile in parallel, using the mkl and mpi libraries, apparently the mpif90 compiler is pointing to gfortran instead of the ifort compiler that accompanies the cluster toolkit. Is this supposed to occur? Is there a way to change this?
0 Kudos
3 Replies
Gergana_S_Intel
Employee
987 Views

Hi Ben,

Quoting Ben Beeler
... apparently the mpif90 compiler is pointing to gfortran instead of the ifort compiler that accompanies the cluster toolkit. Is this supposed to occur?

Indeed, that's the expected behavior of the Intel MPI Library mpif90 script. If you look at Section 2.1 "Compiler Commands" in the Reference Manual (included in the /doc directory or available for download here), you'll see that, by default, mpif90 would use the GNU FORTRAN compilers. If you'd like to use the Intel Fortran compilers, you need to use the mpiifort script instead.

Hope this helps. Let us know how it goes.

Regards,
~Gergana

jonathandursi
Novice
987 Views
Note that if you want to use mpif90/mpicc/etc (eg for existing configure scripts/Makefiles, etc) with the Intel compilers, one need only modify environment variables to point to the appropriate compilers: eg,

export I_MPI_CC=icc
export I_MPI_CXX=icpc
export I_MPI_F77=ifort
export I_MPI_F90=ifort

for bash-type shells, or

setenv I_MPI_CC icc
setenv I_MPI_CXX icpc
setenv I_MPI_F77 ifort
setenv I_MPI_F90 ifort

for csh-type shells.
Gergana_S_Intel
Employee
987 Views

Great point! Also, if we're talking options, you can use a flag like this:

mpif90 -f90=ifort ...

This is all assuming ifort in your PATH. If not, just specify the full path when using the flag or the env variable.

Regards,
~Gergana

Reply