HP-MPI User's Guide (11th Edition)

Understanding HP-MPI
Compilation wrapper script utilities
Chapter 3 47
C command line basics for Windows systems
The utility "%MPI_ROOT%\bin\mpicc" is included to aid in command line
compilation. To compile with this utility, set the MPI_CC environment
variable 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 mpicc command line. The mpicc utility will
add additional command line options for HP-MPI include directories and
libraries. The -show option can be specified to indicate that mpicc should
display the command generated without actually executing the
compilation command. See the mpicc man page for more information.
In order to construct the desired compilation command, the mpicc 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 hello_world.c with a 64-bit 'cl' contained in
your PATH use the following command since 'cl' and the 'Windows' syntax
are defaults:
"%MPI_ROOT%\bin\mpicc" /mpi64 hello_world.c /link ^
/out:hello_world_cl64.exe
Or, use the following example to compile using the PGI compiler which
uses a more UNIX-like syntax:
"%MPI_ROOT%\bin\mpicc" -mpicc pgcc -mpisyntax unix -mpi32 ^
hello_world.c -o hello_world_pgi32.exe
Table 3-2 mpicc Utility
Environment Variable Value Command Line
MPI_CC desired compiler
(default cl)
-mpicc <value>
MPI_BITNESS 32 or 64 (no
default)
-mpi32 or -mpi64
MPI_WRAPPER_SYNTAX windows or unix
(default
windows)
-mpisyntax <value>