Parallel Programming Guide for HP-UX Systems

MPI
Compiling and Linking
Chapter 2 17
Compiling and Linking
Compiling applications
The compiler you use to build HP MPI applications depends upon which programming
language you use. The HP MPI compiler utilities are shell scripts that invoke the appropriate
native compiler. You can pass the pathname of the MPI header files using the -I option and
link an MPI library (for example, the diagnostic or thread-compliant library) using the -Wl, -L
or -l option.
By default, HP MPI compiler utilities include a small amount of debug information in order to
allow the TotalView debugger to function. However, certain compiler options are incompatible
with this debug information. Use the -notv option to exclude debug information. The -notv
option will also disable TotalView usage on the resulting executable. The -notv option applies
to archive libraries only.
HP MPI 2.0 now offers a -show option to compiler wrappers. When compiling by hand, run as
mpicc -show and a line will print displaying exactly what the job was going to do.
Compilation utilities
HP MPI provides separate compilation utilities and default compilers for the languages
shown in the following tables.
Table 2-1 Default compilers for HP-UX
Language Utility Default compiler
C mpicc /opt/ansic/bin/cc
C++ mpiCC /opt/aCC/bin/aCC
Fortran 77 mpif77 /opt/fortran/bin/f77
Fortran 90 mpif90 /opt/fortran90/bin/f90