HP-MPI Version 1.0 for Windows Release Note

HP-MPI V1.0 for Windows Release Note
Building Applications
31
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 man page mpicc(1) for more information.
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]
The above assumes the environment variable MPI_ROOT is set.
For example, to compile hello_world.c from the Help directory using Visual Studio (from a
Visual Studio 2005 command prompt window):
cl hello_world.c /I"%MPI_ROOT%\include\32"
/link /out:hello_world.exe
/libpath:"%MPI_ROOT%\lib"
/subsystem:console libhpmpi32.lib
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.
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):
ifort compute_pi.f /I"%MPI_ROOT%\include\32"
/link /out:compute_pi.exe
/libpath:"%MPI_ROOT%\lib"
/subsystem:console libhpmpi32.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