|
Packit Service |
c5cf8c |
/*D
|
|
Packit Service |
c5cf8c |
mpif77 - Compiles and links MPI programs written in Fortran 77
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Description:
|
|
Packit Service |
c5cf8c |
This command can be used to compile and link MPI programs written in
|
|
Packit Service |
c5cf8c |
Fortran. It provides the options and any special libraries that are
|
|
Packit Service |
c5cf8c |
needed to compile and link MPI programs.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
It is important to use this command, particularly when linking programs,
|
|
Packit Service |
c5cf8c |
as it provides the necessary libraries.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Command line arguments:
|
|
Packit Service |
c5cf8c |
+ \-show - Show the commands that would be used without
|
|
Packit Service |
c5cf8c |
running them
|
|
Packit Service |
c5cf8c |
. \-help - Give short help
|
|
Packit Service |
c5cf8c |
. \-f77=name - Use compiler 'name' instead of the default choice. Use
|
|
Packit Service |
c5cf8c |
this only if the compiler is compatible with the MPICH
|
|
Packit Service |
c5cf8c |
library (see below)
|
|
Packit Service |
c5cf8c |
. \-config=name - Load a configuration file for a particular compiler.
|
|
Packit Service |
c5cf8c |
This allows a single 'mpif77' command to be used with
|
|
Packit Service |
c5cf8c |
multiple compilers.
|
|
Packit Service |
c5cf8c |
. \-compile_info - Show the steps for compiling a program. This option
|
|
Packit Service |
c5cf8c |
can be used to see what options and include paths are
|
|
Packit Service |
c5cf8c |
used by mpif77.
|
|
Packit Service |
c5cf8c |
. \-link_info - Show the steps for linking a program. This option
|
|
Packit Service |
c5cf8c |
can be used to see what options and libraries are used by
|
|
Packit Service |
c5cf8c |
mpif77.
|
|
Packit Service |
c5cf8c |
. \-profile=name - Use the MPI profiling given by name. See below for
|
|
Packit Service |
c5cf8c |
details
|
|
Packit Service |
c5cf8c |
. \-echo - Show exactly what this program is doing.
|
|
Packit Service |
c5cf8c |
This option should normally not be used.
|
|
Packit Service |
c5cf8c |
. \-static-mpi - Use a statically compile MPI library, but shared libraries
|
|
Packit Service |
c5cf8c |
for all of the other dependencies.
|
|
Packit Service |
c5cf8c |
- others - are passed to the compiler or linker. For example, '\-c'
|
|
Packit Service |
c5cf8c |
causes files to be compiled, '\-g' selects compilation with
|
|
Packit Service |
c5cf8c |
debugging on most systems, and '\-o name' causes linking
|
|
Packit Service |
c5cf8c |
with the output executable given the name 'name'.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Environment Variables:
|
|
Packit Service |
c5cf8c |
The environment variables 'MPICH_F77' may be used
|
|
Packit Service |
c5cf8c |
to select different Fortran compiler and linker. Note that since
|
|
Packit Service |
c5cf8c |
MPICH is built with a particular C and Fortran compiler, change the
|
|
Packit Service |
c5cf8c |
compilers used can cause problems. Use this only if you could intermix
|
|
Packit Service |
c5cf8c |
code compiled with the different compilers.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Compatible Compilers:
|
|
Packit Service |
c5cf8c |
The MPI library may be used with any compiler that uses the same
|
|
Packit Service |
c5cf8c |
lengths for basic data objects (such as 'long double') and that
|
|
Packit Service |
c5cf8c |
uses compatible run-time libraries. On many systems, the various
|
|
Packit Service |
c5cf8c |
compilers are compatible and may be used interchangably. There are
|
|
Packit Service |
c5cf8c |
exceptions; if you use the 'MPICH_F77' environment variable or the
|
|
Packit Service |
c5cf8c |
'\-f77=name' command-line argument to override the choice of compiler
|
|
Packit Service |
c5cf8c |
and encounter problems, try reconfiguring MPICH with the new compiler
|
|
Packit Service |
c5cf8c |
and installing MPICH in a separate location. See the installation manual
|
|
Packit Service |
c5cf8c |
for more details.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Examples:
|
|
Packit Service |
c5cf8c |
To compile a single file 'foo.f', use
|
|
Packit Service |
c5cf8c |
.vb
|
|
Packit Service |
c5cf8c |
mpif77 -c foo.f
|
|
Packit Service |
c5cf8c |
.ve
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
To link the output and make an executable, use
|
|
Packit Service |
c5cf8c |
.vb
|
|
Packit Service |
c5cf8c |
mpif77 -o foo foo.o
|
|
Packit Service |
c5cf8c |
.ve
|
|
Packit Service |
c5cf8c |
Combining compilation and linking in a single command
|
|
Packit Service |
c5cf8c |
.vb
|
|
Packit Service |
c5cf8c |
mpif77 -o foo foo.f
|
|
Packit Service |
c5cf8c |
.ve
|
|
Packit Service |
c5cf8c |
is a convenient way to build simple programs.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Selecting a Profiling Library:
|
|
Packit Service |
c5cf8c |
The '\-profile=name' argument allows you to specify an MPI profiling
|
|
Packit Service |
c5cf8c |
library to be used. 'name' can have two forms\:
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
.n A library in the same directory as the MPI library
|
|
Packit Service |
c5cf8c |
.n The name of a profile configuration file
|
|
Packit Service |
c5cf8c |
.n
|
|
Packit Service |
c5cf8c |
If 'name' is a library, then this library is included before the MPI
|
|
Packit Service |
c5cf8c |
library. This allows the simple use of libraries that make use of the
|
|
Packit Service |
c5cf8c |
MPI profiling interface and that are installed in the same directory as
|
|
Packit Service |
c5cf8c |
the MPI library.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
If 'name.conf' is the name of a file in the sysconfdir directory, then this
|
|
Packit Service |
c5cf8c |
is read and may define the following variables\:
|
|
Packit Service |
c5cf8c |
+ PROFILE_PRELIB - Libraries (and paths) to include before the MPI library
|
|
Packit Service |
c5cf8c |
. PROFILE_POSTLIB - Libraries to include after the MPI library
|
|
Packit Service |
c5cf8c |
- PROFILE_INCPATHS - C preprocessor arguments for any include files
|
|
Packit Service |
c5cf8c |
For example, to add '/usr/local/myprof/include' to the include path and
|
|
Packit Service |
c5cf8c |
the library 'libmyprof.a' in '/usr/local/myprof/lib' to the link step,
|
|
Packit Service |
c5cf8c |
you could create the file 'myprof.conf' with the lines
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
.vb
|
|
Packit Service |
c5cf8c |
PROFILE_PRELIB="-L/usr/local/myprof/lib -lmyprof"
|
|
Packit Service |
c5cf8c |
PROFILE_INCPATHS="-I/usr/local/myprof/include"
|
|
Packit Service |
c5cf8c |
.ve
|
|
Packit Service |
c5cf8c |
and place it in the sysconfdir directory (this directory is set at
|
|
Packit Service |
c5cf8c |
configure time when MPICH is built). Then using the command-line
|
|
Packit Service |
c5cf8c |
argument '\-profile=myprof' will cause these
|
|
Packit Service |
c5cf8c |
definitions to be added to the relevant compile commands.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
.seealso: mpicc, mpicxx, mpifort, mpiexec
|
|
Packit Service |
c5cf8c |
D*/
|