HP-MPI Version 1.1 for Windows Release Note
HP-MPI V1.1 for Windows Release Note
Fortran command line basics
46
Fortran command line basics
The utility "%MPI_ROOT%\bin\mpif90" is included to aid in command line compilation. To
compile with this utility, set MPI_F90 to the path of the command line compiler you want to
use. Specify -mpi32 or -mpi64 to indicate if you are compiling a 32- or 64-bit application.
Specify the command line options that you would normally pass to the compiler on the mpif90
command line. The mpif90 utility will add additional command line options for HP-MPI
include directories and libraries. The -show option can be specified to indicate that mpif90
should display the command generated without actually executing the compilation command.
See the man page mpif90(1) for more information.
In order to construct the desired compilation command, the mpif90 utility needs to know
what command line compiler is to be used, the bitness of the executable that compiler will
produce, and the syntax accepted by the compiler. These can be controlled by environment
variables or from the command line.
For example, to compile compute_pi.f using a 64-bit 'ifort' contained in your PATH could be
done with the following command since 'ifort' and the 'Windows' syntax are defaults:
"%MPI_ROOT%\bin\mpif90" -mpi64 compute_pi.f /link /out:compute_pi_ifort.exe
Or, use the following example to compile using the PGI compiler which uses a more UNIX-like
syntax:
"%MPI_ROOT%\bin\mpif90" -mpif90 pgf90 -mpisyntax unix -mpi32 compute_pi.f ^
-o compute_pi_pgi32.exe
To compile compute_pi.f using Intel Fortran without utilizing the mpif90 tool (from a
command prompt that has the appropriate environment settings loaded for your Fortran
compiler):
Table 3 mpif90 Utility
Environment Variable Value Command Line
MPI_F90 desired compiler (default
ifort)
-mpif90 <value>
MPI_BITNESS 32 or 64 (no default) -mpi32 or -mpi64
MPI_WRAPPER_SYNTAX windows or unix (default
windows)
-mpisyntax <value>