OMPI-WRAPPER-COMPILER(1)
<h1>β¨ OMPI-WRAPPER-COMPILER(1) β¨</h1>
okay bestie, welcome to the wrapper compiler page π this is OMPI-WRAPPER-COMPILER(1), and it's about the little shell scripts that do the absolute most so you don't have to.
The stars of the show: mpicc, mpic++, mpicxx, mpifort, mpijavac β the Open MPI wrapper compilers. no cap, they're iconic π
<h1>β¨ SYNTAX β¨</h1>
here's the whole vibe, fr fr:
mpicc [--showme | --showme:compile | --showme:link] ...
mpic++ [--showme | --showme:compile | --showme:link] ...
mpicxx [--showme | --showme:compile | --showme:link] ...
mpifort [--showme | --showme:compile | --showme:link] ...
mpijavac [--showme | --showme:compile | --showme:link] ...
The following deprecated commands are also available β but mpifort should be used instead π:
mpif77 [--showme | --showme:compile | --showme:link] ...
mpif90 [--showme | --showme:compile | --showme:link] ...
And on case-sensitive filesystems, the following command will also be available (she's special like that π ):
mpiCC [--showme | --showme:compile | --showme:link] ...
<h1>β¨ OPTIONS β¨</h1>
The options below apply to all of the wrapper compilers, periodt:
--showmeβ this option comes in several different variants (see below, bestie). None of the variants invokes the underlying compiler; they all provide information on how the underlying compiler would have been invoked had--showmenot been used. The basic--showmeoption outputs the command line that would be executed to compile the program.
Note: if a non-filename argument is passed on the command line, the--showmeoption will not display any additional flags. For example, bothmpicc --showmeandmpicc --showme my_source.cwill show all the wrapper-supplied flags. Butmpicc --showme -vwill only show the underlying compiler name and-v. π rude but that's how it is.
--showme:compileβ output the compiler flags that would have been supplied to the underlying compiler.--showme:linkβ output the linker flags that would have been supplied to the underlying compiler.--showme:commandβ outputs the underlying compiler command (which may be one or more tokens).--showme:incdirsβ outputs a space-delimited (but otherwise undecorated) list of directories that the wrapper compiler would have provided to the underlying compiler to indicate where relevant header files are located.--showme:libdirsβ outputs a space-delimited (but otherwise undecorated) list of directories that the wrapper compiler would have provided to the underlying linker to indicate where relevant libraries are located.--showme:libsβ outputs a space-delimited (but otherwise undecorated) list of library names that the wrapper compiler would have used to link an application. For example:mpi open-pal util.--showme:versionβ outputs the version number of Open MPI.--showme:helpβ output a brief usage help message. a little help, as a treat π«Ά
See the man page for your underlying compiler for other options that can be passed through mpicc.
<h1>β¨ DESCRIPTION β¨</h1>
Conceptually, the role of these commands is quite simple (main character energy, minimal drama): transparently add relevant compiler and linker flags to the user's command line that are necessary to compile / link Open MPI programs, and then invoke the underlying compiler to actually perform the command. β¨
As such, these commands are frequently referred to as "wrapper" compilers because they do not actually compile or link applications themselves; they only add in command line flags and invoke the back-end compiler.
<h1>β¨ BACKGROUND β¨</h1>
Open MPI provides wrapper compilers for several languages, and yes she serves all of them π :
mpiccβ Cmpic++,mpicxx(and on systems with case-sensitive file systems,mpiCC) β C++
Note:mpic++,mpicxx, andmpiCCall invoke the same underlying C++ compiler with the same options. All are provided as compatibility with other MPI implementations.
mpifort(and its legacy/deprecated aliasesmpif77andmpif90) β Fortranmpijavacβ Java
The wrapper compilers for each of the languages are identical; they can be use interchangeably. The different names are provided solely for backwards compatibility. no cap, same girl, different name tags π
<h1>β¨ FORTRAN NOTES β¨</h1>
The Fortran wrapper compiler for MPI (mpifort, and its legacy/deprecated names mpif77 and mpif90) can compile and link MPI applications that use any/all of the MPI Fortran bindings: mpif.h, the mpi module, and the mpi_f08 module (assuming Open MPI was installed with support for each of these Fortran bindings). Specifically: it is no longer necessary to use different wrapper compilers for applications that use mpif.h vs. applications that use the mpi module β just use mpifort for all Fortran MPI applications. one compiler, all the drama handled πΈ
Note, however, that the Fortran compiler may require additional command-line options to enforce a specific Fortran dialect. For example, in some versions of the IBM XLF compiler, if xlf90 is the underlying Fortran compiler, -qfixed may be necessary to compile fixed-format Fortran source files.
Finally, note that mpifort will be inoperative and will return an error on use if Fortran support was not built into the MPI layer. π not her ghosting you, she literally cannot.
<h1>β¨ OVERVIEW β¨</h1>
mpicc is a convenience wrappers for the underlying C compiler. Translation of an Open MPI program requires the linkage of the Open MPI-specific libraries which may not reside in one of the standard search directories of ld(1). It also often requires the inclusion of header files what may also not be found in a standard location.
mpicc passes its arguments to the underlying C compiler along with the -I, -L and -l options required by Open MPI programs.
The same is true for all the other language wrapper compilers.
The Open MPI Team strongly encourages using the wrapper compilers instead of attempting to link to the Open MPI libraries manually. This allows the specific implementation of Open MPI to change without forcing changes to linker directives in users' Makefiles. Indeed, the specific set of flags and libraries used by the wrapper compilers depends on how Open MPI was configured and built; the values can change between different installations of the same version of Open MPI. yes, even same version, different flags β it's giving chaotic but valid π
Indeed, since the wrappers are simply thin shells on top of an underlying compiler, there are very, very few compelling reasons not to use Open MPI's wrapper compilers. When it is not possible to use the wrappers directly, the --showme:compile and --showme:link options should be used to determine what flags the wrappers would have used. For example:
shell$ cc -c file1.c `mpicc --showme:compile`
shell$ cc -c file2.c `mpicc --showme:compile`
shell$ cc file1.o file2.o `mpicc --showme:link` -o my_mpi_program
<h1>β¨ NOTES β¨</h1>
It is possible to make the wrapper compilers multi-lib aware. That is, the libraries and includes specified may differ based on the compiler flags specified (for example, with the GNU compilers on Linux, a different library path may be used if -m32 is seen versus -m64 being seen). This is not the default behavior in a standard build, but can be activated (for example, in a binary package providing both 32 and 64 bit support). More information can be found here https://github.com/open-mpi/ompi/wiki/compilerwrapper3264. π₯
<h1>β¨ FILES β¨</h1>
The strings that the wrapper compilers insert into the command line before invoking the underlying compiler are stored in a text file created by Open MPI and installed to $pkgdata/NAME-wrapper-data.txt, where:
$pkgdatais typically$prefix/share/openmpi$prefixis the top installation directory of Open MPINAMEis the name of the wrapper compiler (e.g.,$pkgdata/mpicc-wrapper-data.txt)
It is rarely necessary to edit these files, but they can be examined to gain insight into what flags the wrappers are placing on the command line. peek but don't touch, bestie π«Ά
<h1>β¨ ENVIRONMENT VARIABLES β¨</h1>
By default, the wrappers use the compilers that were selected when Open MPI was configured. These compilers were either found automatically by Open MPI's "configure" script, or were selected by the user in the CC, CXX, and/or FC environment variables before configure was invoked. Additionally, other arguments specific to the compiler may have been selected by configure.
These values can be selectively overridden by either editing the text files containing this configuration information (see the FILES section), or by setting selected environment variables of the form ompi_value.
Valid value names are:
CPPFLAGSβ flags added when invoking the preprocessor (C or C++)LDFLAGSβ flags added when invoking the linker (C, C++, or Fortran)LIBSβ libraries added when invoking the linker (C, C++, or Fortran)CCβ C compilerCFLAGSβ C compiler flagsCXXβ C++ compilerCXXFLAGSβ C++ compiler flagsFCβ Fortran compilerFCFLAGSβ Fortran compiler flags
<h1>β¨ Copyright β¨</h1>
2003-2026, The Open MPI Community π
and that's the whole page, bestie!! this came from the Open MPI source, dated Sep 10, 2026 β go forth and wrapper-compile with confidence, you're gonna slay πβπ
π¦ where this page comes from
- ubuntu stonking: openmpi-bin 5.0.10-6 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms