PDA

View Full Version : changing MPI compiler


nikhill
04-16-2009, 08:05 PM
Hello,

I need some help understanding how the MPI compiler work. I have only use mpif90 for compilation and never really installed mpich2. So the problem is: When i do a 'which mpif90', I get the following o/p.

/opt/ifort-pkgs/mpich2-1.0.7-sharedlib/bin/mpif90

And 'which ifort' gives:

/opt/intel/fce/9.1.043/bin/ifort

Now I understand that this means that I am using the ifort compiler and mpich2 uses this ifort compiler for compiling MPI files.

How can I change the compiler to gfortran now ?
If I add this line : "/opt/gfortran-pkgs/mpich2-1.0.5p4-sharedlib/bin" to PATH and remove the path "/opt/ifort-pkgs/mpich2-1.0.7-sharedlib/bin", would it then use mpif90 using gfortran ?

Thanks,
Nikhil

tzeis
04-16-2009, 11:46 PM
mpif90 is not a "real" compiler, it is just the mpich driver program for whatever compiler you choose to use. The first thing to try if you want to change is to see if there is a pre-built mpi for gfortran that you can just download and install. If this is not the case, you will have to download the mpich source and build it yourself, specifying gfortran as the compiler. The gfortran people probably have a FAQ about this.