Commands for compiling and linking programs


Up: The mpich Programming Environment Next: Problems Previous: mpirun, a Portable Startup Script

The mpich implementation provides two commands for compiling and linking C, C++, Fortran-77, and Fortran-90 programs. They also have a simple interface to the profiling and visualization libraries described in [12] through these command-line options:

-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 these commands just like the usual compilers. For example,
    mpicc -c foo.c  
    mpiCC -c foo.C 
    mpif77 -c foo.f 
    mpif90 -c foo.f90 
and
    mpicc -o foo foo.o 
    mpiCC -o foo foo.o 
    mpif77 -o foo foo.o 
    mpif90 -o foo foo.o 
Note that for Fortran 90, different systems may require different suffixes. For example, AIX systems do not support f90 as a file suffix for Fortran 90 programs.

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 
    mpiCC -o foo foo.C 
    mpif77 -o foo foo.f 
    mpif90 -o foo foo.f90 
may not work on some systems.

More information on using these commands may be found in the Users Guide to mpich.



Up: The mpich Programming Environment Next: Problems Previous: mpirun, a Portable Startup Script