HP-MPI User's Guide (11th Edition)
Understanding HP-MPI
Compilation wrapper script utilities
Chapter 348
To compile C code and link against HP-MPI without utilizing the mpicc
tool, start a command prompt that has the appropriate environment
settings loaded for your compiler, and use it with the compiler option:
/I"%MPI_ROOT%\include\[32|64]"
and the linker options:
/libpath:"%MPI_ROOT%\lib" /subsystem:console ^
[libhpmpi64.lib|libhpmpi32.lib]
Specify bitness where indicated. The above assumes the environment
variable MPI_ROOT is set.
For example, to compile hello_world.c from the %MPI_ROOT%\help
directory using Visual Studio (from a Visual Studio 2005 command
prompt window):
cl hello_world.c /I"%MPI_ROOT%\include\64" ^
/link /out:hello_world.exe ^
/libpath:"%MPI_ROOT%\lib" ^
/subsystem:console libhpmpi64.lib
The PGI compiler uses a more UNIX-like syntax. From a PGI command
prompt:
pgcc hello_world.c -I"%MPI_ROOT%\include\64" ^
-o hello_world.exe -L"%MPI_ROOT%\lib" -lhpmpi64
Fortran command line basics for Windows systems
The utility "%MPI_ROOT%\bin\mpif90" is included to aid in command
line compilation. To compile with this utility, set the MPI_F90
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 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 mpif90 man page for more
information.