Much of mpich's portability is handled throught the careful construction of
system-dependant Makefiles by the configure program.
This is fine for installing mpich, but what can you do when you are building
a new application?
For simple applications, the mpicc and mpif77 commands may
be the simplest way to build a new application. For more complex codes,
we recommend taking a sample Makefile.in file, for
example, in mpich/examples/test/pt2pt. Modify those parts that are
are relavent, such as the EXECS and specific program targets.
To create a Makefile, just execute
mpireconfig Makefile(mpireconfig is in the same directory as mpirun). This generates a new Makefile from Makefile.in, with the correct parameters for the mpich that was installed.