LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

mpic++

compiles MPI C++ programs

TLDR

Compile MPI C++ program
$ mpic++ -o [program] [source.cpp]
copy
Compile with optimization
$ mpic++ -O2 -o [program] [source.cpp]
copy
Show compiler command
$ mpic++ --showme [source.cpp]
copy

SYNOPSIS

mpic++ [options] sourcefiles_...

DESCRIPTION

mpic++ is a compiler driver shipped with MPI implementations (Open MPI, MPICH, MVAPICH, Intel MPI) that invokes the underlying system C++ compiler with the include paths, library paths, and link libraries needed to build MPI programs. It is the C++ counterpart to mpicc and is typically a symlink or alias to mpicxx.The wrapped compiler can be overridden via the `OMPICXX` (Open MPI) or `MPICHCXX` (MPICH) environment variable, allowing the same wrapper to drive `g++`, `clang++`, `icpx`, etc.

PARAMETERS

-o file

Output file name.
-O level
Optimization level.
--showme
Show underlying compiler command.
-I dir
Include directory.
-L dir
Library directory.
-std= standard
C++ standard version (c++11, c++14, c++17, c++20).
-show
Print the underlying compiler command line that would be invoked, then exit (MPICH-style).
--showme:compile / --showme:link / --showme:command
Print only the compile flags, only the link flags, or only the wrapped compiler name (Open MPI).

CAVEATS

The flags injected by the wrapper depend on the MPI implementation; do not rely on `--showme` semantics being identical between Open MPI and MPICH. Mixing object files compiled with different MPI wrappers is unsafe.

SEE ALSO

mpirun(1), mpicxx(1), mpicc(1)

Copied to clipboard
Kai