HP-MPI User's Guide (11th Edition)
Understanding HP-MPI
C++ bindings (for HP-UX and Linux)
Chapter 350
C++ bindings (for HP-UX and Linux)
HP-MPI supports C++ bindings as described in the MPI-2 Standard. (See
“Documentation resources” on page xxii.) If compiling and linking with
the mpiCC command, no additional work is needed to include and use the
bindings. You can include either mpi.h or mpiCC.h in your C++ source
files.
The bindings provided by HP-MPI are an interface class, calling the
equivalent C bindings. To profile your application, users should profile
the equivalent C bindings.
If the user builds without the mpiCC command, they will need to include
-lmpiCC to resolve C++ references.
If you want to use an alternate libmpiCC.a with mpiCC, use the
-mpiCClib <LIBRARY> option. A 'default' g++ ABI compatible library is
provided for each architecture except Alpha.
Non-g++ ABI compatible C++ compilers
The C++ library provided by HP-MPI, libmpiCC.a, was built with g++.
If you are using a C++ compiler which is not g++ ABI compatible (e.g.
Portland Group Compiler), you must build your own libmpiCC.a and
include this in your build command. The sources and Makefiles to build
an appropriate library are located in /opt/hpmpi/lib/ARCH/mpiCCsrc.
To build your private version of libmpiCC.a and include it in the builds
using mpiCC, do the following:
NOTE This example assumes your HP-MPI install directory is /opt/hpmpi. It
also assumes that the pgCC compiler is in your path and working
properly.
1. Copy the file needed to build libmpiCC.a into a working location.
% setenv MPI_ROOT /opt/hpmpi
% cp -r $MPI_ROOT/lib/linux_amd64/mpiCCsrc ~
% cd ~/mpiCCsrc