Download mpich2-1.4.1p1.tar.gz
First, introduce the ifort environment variable.
Export fc = ifort
Export f90 = ifort
(If you want to use ICC as the C compiler, export cc = ICC. Otherwise, you do not need to set it. GCC is used by default)
The following error is prompted:
Configure: Error: f90 and f90flags are replaced by FC and fcflags respectively in this configure, please unset f90/f90flags and set FC/fcflags instead and rerun configure again.
[Root @ glnode05 mpich2-1.4.1p1] # unset f90
[Root @ glnode05 mpich2-1.4.1p1] # export fcflags = ifort;
[Root @ glnode05 mpich2-1.4.1p1] # export fc = ifort;
[Root @ glnode05 mpich2-1.4.1p1] # export f77 = ifort;
[Root @ glnode05 mpich2-1.4.1p1] #./configure -- prefix =/opt/mpich2/mpich2 & make install
./Configure -- help to view help
After compilation, mpich2 is installed in the/opt/mpich2/directory and the bin directory under the directory is viewed. Only mpif77 is found, but mpif77 is equivalent to MPI ifort, it can also be used to compile Fortran 90 or 95Program.
Test:
/Opt/mpich2/mpich2/bin/mpif77 rand2.f90
----------------------------------
! Rand2.f90
! Gfortran cannot be compiled, and ifort can be compiled
Program my_random
Call seed (RND $ timeseed)
Call random (RAND)
Print *, Rand
End program my_random
-----------------------------------
Refer:
Http://cache.baidu.com/C? M = queue & P = 882a964392995af30be2977e54498d & User = Baidu & fm = SC & query = mpich2 ++ ifort & qid = f3b81b87111dd593 & p1 = 3