The mpicc and mpif77 Commands


Up: The  mpich Programming Environment Next:  mpireconfig, a way to create Makefiles Previous:  mpirun, a Portable Startup Script

The mpich implementation provides two commands for compiling and linking C and Fortran 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 [9]. This is a program to compile or link MPI programs. In addition, the following special options are supported:

-mpilog
Build version that generates MPE log files.
-mpitrace
Build version that generates traces.
-mpianim
Build version that generates real-time animation.
-show
Show the commands that would be used without actually running them.

Use this just like the usual C or Fortran compiler. For example,
mpicc -c foo.c  
    mpif77 -c foo.f 
and
mpicc -o foo foo.o 
    mpif77 -o foo foo.o 
Commands for the linker may include additional libraries. For example, to use some routines from the MPE library, enter
mpicc -o foo foo.o -lmpe 
Combining compilation and linking in a single command, as shown here,
mpicc -o foo foo.c 
    mpif77 -o foo foo.f 
may not work on some systems, and is not recommended.

These commands are set up for a specific architecture and MPICH device and are located in the directory that contains the MPI libraries. For example, if the architecture is sun4 and the device is ch_p4, these commands may be found in /usr/local/mpi/lib/sun4/ch_p4 (assuming that MPICH is installed in /usr/local/mpi).



Up: The  mpich Programming Environment Next:  mpireconfig, a way to create Makefiles Previous:  mpirun, a Portable Startup Script