1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280
|
.\" Man page generated from reStructuredText.
.
.TH "OMPI-WRAPPER-COMPILER" "1" "May 30, 2025" "" "Open MPI"
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.sp
mpicc, mpic++, mpicxx, mpifort, mpijavac — Open MPI wrapper compilers
.SH SYNTAX
.sp
\fBmpicc [\-\-showme | \-\-showme:compile | \-\-showme:link] ...\fP
.sp
\fBmpic++ [\-\-showme | \-\-showme:compile | \-\-showme:link] ...\fP
.sp
\fBmpicxx [\-\-showme | \-\-showme:compile | \-\-showme:link] ...\fP
.sp
\fBmpifort [\-\-showme | \-\-showme:compile | \-\-showme:link] ...\fP
.sp
\fBmpijavac [\-\-showme | \-\-showme:compile | \-\-showme:link] ...\fP
.sp
The following deprecated commands are also available — but
\fBmpifort\fP should be used instead:
.sp
\fBmpif77 [\-\-showme | \-\-showme:compile | \-\-showme:link] ...\fP
.sp
\fBmpif90 [\-\-showme | \-\-showme:compile | \-\-showme:link] ...\fP
.sp
On case\-sensitive filesystems, the following command will also be
available:
.sp
\fBmpiCC [\-\-showme | \-\-showme:compile | \-\-showme:link] ...\fP
.SH OPTIONS
.sp
The options below apply to all of the wrapper compilers:
.INDENT 0.0
.IP \(bu 2
\fB\-\-showme\fP: This option comes in several different variants (see
below). None of the variants invokes the underlying compiler; they
all provide information on how the underlying compiler would have
been invoked had \fB\-\-showme\fP not been used. The basic \fB\-\-showme\fP
option outputs the command line that would be executed to compile
the program.
.sp
\fBNOTE:\fP
.INDENT 2.0
.INDENT 3.5
If a non\-filename argument is passed on the command line,
the \fB\-\-showme\fP option will \fInot\fP display any additional
flags. For example, both \fB"mpicc \-\-showme\fP and
\fBmpicc \-\-showme my_source.c\fP will show all the
wrapper\-supplied flags. But \fBmpicc
\-\-showme \-v\fP will only show the underlying compiler name
and \fB\-v\fP\&.
.UNINDENT
.UNINDENT
.IP \(bu 2
\fB\-\-showme:compile\fP: Output the compiler flags that would have been
supplied to the underlying compiler.
.IP \(bu 2
\fB\-\-showme:link\fP: Output the linker flags that would have been
supplied to the underlying compiler.
.IP \(bu 2
\fB\-\-showme:command\fP: Outputs the underlying compiler
command (which may be one or more tokens).
.IP \(bu 2
\fB\-\-showme:incdirs\fP: 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.
.IP \(bu 2
\fB\-\-showme:libdirs\fP: 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.
.IP \(bu 2
\fB\-\-showme:libs\fP Outputs a space\-delimited (but otherwise
undecorated) list of library names that the wrapper compiler would
have used to link an application. For example: \fBmpi open\-pal
util\fP\&.
.IP \(bu 2
\fB\-\-showme:version\fP: Outputs the version number of Open MPI.
.IP \(bu 2
\fB\-\-showme:help\fP: Output a brief usage help message.
.UNINDENT
.sp
See the man page for your underlying compiler for other options that
can be passed through mpicc.
.SH DESCRIPTION
.sp
Conceptually, the role of these commands is quite simple:
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.
.sp
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.
.SH BACKGROUND
.sp
Open MPI provides wrapper compilers for several languages:
.INDENT 0.0
.IP \(bu 2
\fBmpicc\fP: C
.IP \(bu 2
\fBmpic++\fP, \fBmpicxx\fP (and on systems with case\-sensitive file
systems, \fBmpiCC\fP): C++
.sp
\fBNOTE:\fP
.INDENT 2.0
.INDENT 3.5
\fBmpic++\fP, \fBmpicxx\fP, and \fBmpiCC\fP all invoke the same
underlying C++ compiler with the same options. All are
provided as compatibility with other MPI implementations.
.UNINDENT
.UNINDENT
.IP \(bu 2
\fBmpifort\fP (and its legacy/deprecated aliaes \fBmpif77\fP and
\fBmpif90\fP): Fortran
.IP \(bu 2
\fBmpijavac\fP: Java
.UNINDENT
.sp
The wrapper compilers for each of the languages are identical; they
can be use interchangeably. The different names are provided solely
for backwards compatibility.
.SH FORTRAN NOTES
.sp
The Fortran wrapper compiler for MPI (\fBmpifort\fP, and its
legacy/deprecated names \fBmpif77\fP and \fBmpif90\fP) can compile and
link MPI applications that use any/all of the MPI Fortran bindings:
\fBmpif.h\fP, the \fBmpi\fP module, and the \fBmpi_f08\fP 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 \fBmpif.h\fP
vs. applications that use the \fBmpi\fP module — just use \fBmpifort\fP
for all Fortran MPI applications.
.sp
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 \fBxlf90\fP is the
underlying Fortran compiler, \fB\-qfixed\fP may be necessary to compile
fixed\-format Fortran source files.
.sp
Finally, note that \fBmpifort\fP will be inoperative and will return an
error on use if Fortran support was not built into the MPI layer.
.SH OVERVIEW
.sp
\fBmpicc\fP 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 \fBld(1)\fP\&. It also often requires the inclusion
of header files what may also not be found in a standard location.
.sp
\fBmpicc\fP passes its arguments to the underlying C compiler along with
the \fB\-I\fP, \fB\-L\fP and \fB\-l\fP options required by Open MPI programs.
.sp
The same is true for all the other language wrapper compilers.
.sp
The Open MPI Team \fIstrongly\fP 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.
.sp
Indeed, since the wrappers are simply thin shells on top of an
underlying compiler, there are very, very few compelling reasons \fInot\fP
to use Open MPI’s wrapper compilers. When it is not possible to use
the wrappers directly, the \fB\-\-showme:compile\fP and \fB\-\-showme:link\fP
options should be used to determine what flags the wrappers would have
used. For example:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
shell$ cc \-c file1.c \(gampicc \-\-showme:compile\(ga
shell$ cc \-c file2.c \(gampicc \-\-showme:compile\(ga
shell$ cc file1.o file2.o \(gampicc \-\-showme:link\(ga \-o my_mpi_program
.ft P
.fi
.UNINDENT
.UNINDENT
.SH NOTES
.sp
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 \fB\-m32\fP is seen versus \fB\-m64\fP
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). \fI\%More information can be found here\fP\&.
.SH FILES
.sp
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
\fB$pkgdata/NAME\-wrapper\-data.txt\fP, where:
.INDENT 0.0
.IP \(bu 2
\fB$pkgdata\fP is typically \fB$prefix/share/openmpi\fP
.IP \(bu 2
\fB$prefix\fP is the top installation directory of Open MPI
.IP \(bu 2
\fBNAME\fP is the name of the wrapper compiler (e.g.,
\fB$pkgdata/mpicc\-wrapper\-data.txt\fP)
.UNINDENT
.sp
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.
.SH ENVIRONMENT VARIABLES
.sp
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 \fBCC\fP, \fBCXX\fP, and/or \fBFC\fP environment variables
before \fBconfigure\fP was invoked. Additionally, other arguments specific
to the compiler may have been selected by configure.
.sp
These values can be selectively overridden by either editing the text
files containing this configuration information (see the \fI\%FILES\fP section), or by setting selected
environment variables of the form \fBompi_value\fP\&.
.sp
Valid value names are:
.INDENT 0.0
.IP \(bu 2
\fBCPPFLAGS\fP: Flags added when invoking the preprocessor (C or C++)
.IP \(bu 2
\fBLDFLAGS\fP: Flags added when invoking the linker (C, C++, or
Fortran)
.IP \(bu 2
\fBLIBS\fP: Libraries added when invoking the linker (C, C++, or
Fortran)
.IP \(bu 2
\fBCC\fP: C compiler
.IP \(bu 2
\fBCFLAGS\fP: C compiler flags
.IP \(bu 2
\fBCXX\fP: C++ compiler
.IP \(bu 2
\fBCXXFLAGS\fP: C++ compiler flags
.IP \(bu 2
\fBFC\fP: Fortran compiler
.IP \(bu 2
\fBFCFLAGS\fP: Fortran compiler flags
.UNINDENT
.SH COPYRIGHT
2003-2025, The Open MPI Community
.\" Generated by docutils manpage writer.
.
|