Reputation: 353
A similar question has been asked before but the answers don't directly address the problem I have. I am trying to compile a fortran based application on an HPC machine. The machine has both gfortan
and ifort
installed and in path. When I use the MPI (Open MPI 1.8.8) wrapper mpifort
it automatically uses ifort
which is fine. But I, for some reason, want to use gfortran
instead. How can I make sure that the mpifort
wrapper defaults to gfortran
instead of ifort
?
Upvotes: 5
Views: 13684
Reputation: 529
mpifort -fc=gfortran main.f90 (or other files you want to compile)
can also help change the compiler.
Upvotes: 0
Reputation: 74455
The default Fortran compiler used by Open MPI's mpifort
is read from $ompi_root/share/openmpi/mpifort-wrapper-data.txt
. The build process stores there the Fortran compiler picked while building the library. It could be overridden by setting the OMPI_FC
environment variable. The same applies to the C wrapper (OMPI_CC
) and the C++ wrapper (OMPI_CXX
).
Example:
$ mpifort -showme:command
ifort
$ env OMPI_FC=gfortran mpifort -showme:command
gfortran
Keep in mind that unlike with C and C++, Intel disagrees with GCC on the Fortran ABI.
Upvotes: 5