|
Packit Service |
c5cf8c |
.TH mpifort 1 "11/12/2019" " " "MPI"
|
|
Packit Service |
c5cf8c |
.SH NAME
|
|
Packit Service |
c5cf8c |
mpifort \- Compiles and links MPI programs written in Fortran 90
|
|
Packit Service |
c5cf8c |
.SH 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 |
.SH COMMAND LINE ARGUMENTS
|
|
Packit Service |
c5cf8c |
.PD 0
|
|
Packit Service |
c5cf8c |
.TP
|
|
Packit Service |
c5cf8c |
.B -show
|
|
Packit Service |
c5cf8c |
- Show the commands that would be used without
|
|
Packit Service |
c5cf8c |
running them
|
|
Packit Service |
c5cf8c |
.PD 1
|
|
Packit Service |
c5cf8c |
.PD 0
|
|
Packit Service |
c5cf8c |
.TP
|
|
Packit Service |
c5cf8c |
.B -help
|
|
Packit Service |
c5cf8c |
- Give short help
|
|
Packit Service |
c5cf8c |
.PD 1
|
|
Packit Service |
c5cf8c |
.PD 0
|
|
Packit Service |
c5cf8c |
.TP
|
|
Packit Service |
c5cf8c |
.B -fc=name
|
|
Packit Service |
c5cf8c |
- Use compiler
|
|
Packit Service |
c5cf8c |
.I name
|
|
Packit Service |
c5cf8c |
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 |
.PD 1
|
|
Packit Service |
c5cf8c |
.PD 0
|
|
Packit Service |
c5cf8c |
.TP
|
|
Packit Service |
c5cf8c |
.B -config=name
|
|
Packit Service |
c5cf8c |
- Load a configuration file for a particular compiler.
|
|
Packit Service |
c5cf8c |
This allows a single
|
|
Packit Service |
c5cf8c |
.I mpifort
|
|
Packit Service |
c5cf8c |
command to be used with
|
|
Packit Service |
c5cf8c |
multiple compilers.
|
|
Packit Service |
c5cf8c |
.PD 1
|
|
Packit Service |
c5cf8c |
.PD 0
|
|
Packit Service |
c5cf8c |
.TP
|
|
Packit Service |
c5cf8c |
.B -compile_info
|
|
Packit Service |
c5cf8c |
- 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 mpifort.
|
|
Packit Service |
c5cf8c |
.PD 1
|
|
Packit Service |
c5cf8c |
.PD 0
|
|
Packit Service |
c5cf8c |
.TP
|
|
Packit Service |
c5cf8c |
.B -link_info
|
|
Packit Service |
c5cf8c |
- 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 |
mpifort.
|
|
Packit Service |
c5cf8c |
.PD 1
|
|
Packit Service |
c5cf8c |
.PD 0
|
|
Packit Service |
c5cf8c |
.TP
|
|
Packit Service |
c5cf8c |
.B -profile=name
|
|
Packit Service |
c5cf8c |
- Use the MPI profiling given by name. See below for
|
|
Packit Service |
c5cf8c |
details
|
|
Packit Service |
c5cf8c |
.PD 1
|
|
Packit Service |
c5cf8c |
.PD 0
|
|
Packit Service |
c5cf8c |
.TP
|
|
Packit Service |
c5cf8c |
.B -echo
|
|
Packit Service |
c5cf8c |
- Show exactly what this program is doing.
|
|
Packit Service |
c5cf8c |
This option should normally not be used.
|
|
Packit Service |
c5cf8c |
.PD 1
|
|
Packit Service |
c5cf8c |
.PD 0
|
|
Packit Service |
c5cf8c |
.TP
|
|
Packit Service |
c5cf8c |
.B -static
|
|
Packit Service |
c5cf8c |
- mpi - Use a statically compile MPI library, but shared libraries
|
|
Packit Service |
c5cf8c |
for all of the other dependencies.
|
|
Packit Service |
c5cf8c |
.PD 1
|
|
Packit Service |
c5cf8c |
.PD 0
|
|
Packit Service |
c5cf8c |
.TP
|
|
Packit Service |
c5cf8c |
.B others
|
|
Packit Service |
c5cf8c |
- are passed to the compiler or linker. For example,
|
|
Packit Service |
c5cf8c |
.I \\-c
|
|
Packit Service |
c5cf8c |
causes files to be compiled,
|
|
Packit Service |
c5cf8c |
.I \\-g
|
|
Packit Service |
c5cf8c |
selects compilation with
|
|
Packit Service |
c5cf8c |
debugging on most systems, and
|
|
Packit Service |
c5cf8c |
.I \\-o name
|
|
Packit Service |
c5cf8c |
causes linking
|
|
Packit Service |
c5cf8c |
with the output executable given the name
|
|
Packit Service |
c5cf8c |
.I name
|
|
Packit Service |
c5cf8c |
\&.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
.PD 1
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
.SH ENVIRONMENT VARIABLES
|
|
Packit Service |
c5cf8c |
The environment variables
|
|
Packit Service |
c5cf8c |
.I MPICH_FC
|
|
Packit Service |
c5cf8c |
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 |
.SH 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
|
|
Packit Service |
c5cf8c |
.I long double
|
|
Packit Service |
c5cf8c |
) 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
|
|
Packit Service |
c5cf8c |
.I MPICH_FC
|
|
Packit Service |
c5cf8c |
environment variable or the
|
|
Packit Service |
c5cf8c |
.I \\-fc=name
|
|
Packit Service |
c5cf8c |
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 |
.SH EXAMPLES
|
|
Packit Service |
c5cf8c |
To compile a single file
|
|
Packit Service |
c5cf8c |
.I foo.f
|
|
Packit Service |
c5cf8c |
, use
|
|
Packit Service |
c5cf8c |
.nf
|
|
Packit Service |
c5cf8c |
mpifort -c foo.f
|
|
Packit Service |
c5cf8c |
.fi
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
To link the output and make an executable, use
|
|
Packit Service |
c5cf8c |
.nf
|
|
Packit Service |
c5cf8c |
mpifort -o foo foo.o
|
|
Packit Service |
c5cf8c |
.fi
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Combining compilation and linking in a single command
|
|
Packit Service |
c5cf8c |
.nf
|
|
Packit Service |
c5cf8c |
mpifort -o foo foo.f
|
|
Packit Service |
c5cf8c |
.fi
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
is a convenient way to build simple programs.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
.SH SELECTING A PROFILING LIBRARY
|
|
Packit Service |
c5cf8c |
The
|
|
Packit Service |
c5cf8c |
.I \\-profile=name
|
|
Packit Service |
c5cf8c |
argument allows you to specify an MPI profiling
|
|
Packit Service |
c5cf8c |
library to be used.
|
|
Packit Service |
c5cf8c |
.I name
|
|
Packit Service |
c5cf8c |
can have two forms:
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
.br
|
|
Packit Service |
c5cf8c |
A library in the same directory as the MPI library
|
|
Packit Service |
c5cf8c |
.br
|
|
Packit Service |
c5cf8c |
The name of a profile configuration file
|
|
Packit Service |
c5cf8c |
.br
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
If
|
|
Packit Service |
c5cf8c |
.I name
|
|
Packit Service |
c5cf8c |
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
|
|
Packit Service |
c5cf8c |
.I name.conf
|
|
Packit Service |
c5cf8c |
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 |
.PD 0
|
|
Packit Service |
c5cf8c |
.TP
|
|
Packit Service |
c5cf8c |
.B PROFILE_PRELIB
|
|
Packit Service |
c5cf8c |
- Libraries (and paths) to include before the MPI library
|
|
Packit Service |
c5cf8c |
.PD 1
|
|
Packit Service |
c5cf8c |
.PD 0
|
|
Packit Service |
c5cf8c |
.TP
|
|
Packit Service |
c5cf8c |
.B PROFILE_POSTLIB
|
|
Packit Service |
c5cf8c |
- Libraries to include after the MPI library
|
|
Packit Service |
c5cf8c |
.PD 1
|
|
Packit Service |
c5cf8c |
.PD 0
|
|
Packit Service |
c5cf8c |
.TP
|
|
Packit Service |
c5cf8c |
.B PROFILE_INCPATHS
|
|
Packit Service |
c5cf8c |
- C preprocessor arguments for any include files
|
|
Packit Service |
c5cf8c |
For example, to add
|
|
Packit Service |
c5cf8c |
.I /usr/local/myprof/include
|
|
Packit Service |
c5cf8c |
to the include path and
|
|
Packit Service |
c5cf8c |
the library
|
|
Packit Service |
c5cf8c |
.I libmyprof.a
|
|
Packit Service |
c5cf8c |
in
|
|
Packit Service |
c5cf8c |
.I /usr/local/myprof/lib
|
|
Packit Service |
c5cf8c |
to the link step,
|
|
Packit Service |
c5cf8c |
you could create the file
|
|
Packit Service |
c5cf8c |
.I myprof.conf
|
|
Packit Service |
c5cf8c |
with the lines
|
|
Packit Service |
c5cf8c |
.PD 1
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
.nf
|
|
Packit Service |
c5cf8c |
PROFILE_PRELIB="-L/usr/local/myprof/lib -lmyprof"
|
|
Packit Service |
c5cf8c |
PROFILE_INCPATHS="-I/usr/local/myprof/include"
|
|
Packit Service |
c5cf8c |
.fi
|
|
Packit Service |
c5cf8c |
|
|
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
|
|
Packit Service |
c5cf8c |
.I \\-profile=myprof
|
|
Packit Service |
c5cf8c |
will cause these
|
|
Packit Service |
c5cf8c |
definitions to be added to the relevant compile commands.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
.SH SEE ALSO
|
|
Packit Service |
c5cf8c |
mpicc, mpicxx, mpifort, mpiexec
|
|
Packit Service |
c5cf8c |
.br
|