The MPICH implementation provides four commands for compiling and linking C (mpicc), Fortran 77 (mpif77), C++ (mpiCC), and Fortran 90 (mpif90) programs.
You may use these commands instead of the Makefile.in versions, particularly for programs contained in a small number of files. In addition, they have a simple interface to the profiling and visualization libraries described in [10]. In addition, the following special options are supported:
mpicc -c foo.c
mpif77 -c foo.f
and
mpicc -o foo foo.o
mpif77 -o foo foo.o
Similarly for C++ and Fortran 90 programs.
Commands for the linker may include additional libraries. For
example, to use routines from the C math library library, use
mpicc -o foo foo.o -lmCombining compilation and linking in a single command, as shown here,
mpicc -o foo foo.c
mpif77 -o foo foo.f
may also be used.
These commands are set up for a specific architecture and MPICH device and are located in the /usr/local/mpich/build/<arch>/<device>/bin directory. For example, if the architecture is sun4 and the device is ch_p4, these commands may be found in /usr/local/mpich/build/sun4/ch_p4/bin (assuming that MPICH is installed in /usr/local/mpich).