opalcc(1)
๐ธ opalcc(1) โ the Open PAL C wrapper compiler, bestie edition ๐ธ
okay so real talk: you opened the manual page for opalcc from Open MPI, and honestly? iconic choice. let's get into it ๐
โจ NAME โจ
opalcc โ the Open PAL C wrapper compiler ๐
โจ SYNTAX โจ
opalcc [-showme|-showme:compile|-showme:link] ...
that's it. that's the whole vibe check. ๐ฆ
โจ OPTIONS โจ
--showmeโ bestie this one comes in several different variants (keep scrolling, they're all right below ๐). none of the variants actually invoke the underlying compiler, they just spill the tea on how the underlying compiler would have been invoked if you hadn't used--showme. the plain--showmeoutputs the command line that would be executed to compile the program.
โ ๏ธ NOTE: if a non-filename argument gets passed on the command line, the-showmeoption will not display any additional flags. like, for example, bothopalcc --showmeandopalcc --showme my_source.cwill show all the wrapper-supplied flags. butopalcc --showme -vwill only show the underlying compiler name and-v. not me getting humbled by argument parsing ๐ญ
--showme:compileโ outputs the compiler flags that would have been handed to the C compiler โจ--showme:linkโ outputs the linker flags that would have been handed to the C compiler ๐--showme:commandโ outputs the underlying C compiler command (which may be one or more tokens) ๐--showme:incdirsโ outputs a space-delimited (but otherwise undecorated, no frills, no glitter) list of directories that the wrapper compiler would have given to the underlying C compiler to say "hey, relevant header files live here" ๐--showme:libdirsโ outputs a space-delimited (again, otherwise undecorated) list of directories that the wrapper compiler would have given to the underlying linker to say "hey, relevant libraries live here" ๐--showme:libsโ outputs a space-delimited (yep, otherwise undecorated) list of library names that the wrapper compiler would have used to link an application. for example:"mpi open-rte open-pal util"๐ง--showme:versionโ outputs the version number of Open MPI ๐ข--showme:helpโ outputs a brief usage help message ๐ซถ
also, lowkey important: go see the man page for your underlying C compiler for other options that can be passed through opalcc ๐
โจ DESCRIPTION โจ
conceptually, the role of these commands is honestly so simple: transparently add the relevant compiler and linker flags to your command line โ the ones you need to compile / link Open PAL programs โ and then invoke the underlying compiler to actually do the thing. ๐
so yeah, these commands get called "wrapper" compilers a lot, because they don't actually compile or link applications themselves. they just add in command line flags and invoke the back-end compiler. main character behavior, but make it delegating. ๐
๐ Background
Open MPI is made of three software layers: OPAL (Open Portable Access Layer), ORTE (Open Run-Time Environment), and OMPI (Open MPI). there are wrapper compilers for each layer, and each layer's wrapper only links in the libraries relevant to that layer. specifically, each layer provides these wrapper compilers:
- OPAL
opalccandopalc++
- ORTE
orteccandortec++
- OMPI
mpicc,mpic++,mpicxx,mpiCC(only on systems with case-senstive file systems), andmpifort(plus its legacy/deprecated namesmpif77andmpif90). note thatmpic++,mpicxx, andmpiCCall invoke the same underlying C++ compiler with the same options. all of them are provided as compatibility with other MPI implementations. ๐ค
๐ Fortran Notes
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. slay, one wrapper to rule them all ๐
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. so like, check before you commit, bestie ๐
๐ Overview
opalcc is a convenience wrappers for the underlying C compiler. translating an Open PAL program requires linking the Open PAL-specific libraries, which may not live in one of the standard search directories of ld(1). it also often requires including header files that may also not be found in a standard location. ๐
opalcc passes its arguments to the underlying C compiler along with the -I, -L and -l options required by Open PAL programs.
the Open PAL Team strongly encourages using the wrapper compilers instead of trying to link to the Open PAL libraries manually. this lets the specific implementation of Open PAL change without forcing changes to linker directives in your Makefiles. and fr fr โ the specific set of flags and libraries used by the wrapper compilers depends on how Open PAL was configured and built; the values can change between different installations of the same version of Open PAL. ๐ณ
and honestly, since the wrappers are simply thin shells on top of an underlying compiler, there are very, very few compelling reasons not to use opalcc. when it's 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
โจ NOTES โจ
it is possible to make the wrapper compilers multi-lib aware. that means 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 it can be activated (for example, in a binary package providing both 32 and 64 bit support). more info lives at:
https://github.com/open-mpi/ompi/wiki/compilerwrapper3264
โจ FILES โจ
the string that the wrapper compilers insert into the command line before invoking the underlying compiler is stored in a text file created by Open PAL and installed to $pkgdata/opalcc-wrapper-data.txt, where $pkgdata is typically $prefix/share/openmpi, and $prefix is the top installation directory of Open PAL. ๐
it's rarely necessary to edit this file, but you can examine it to gain insight into what flags the wrappers are placing on the command line. peek behind the curtain, bestie ๐
โจ ENVIRONMENT VARIABLES โจ
by default, the wrappers use the compilers that were selected when Open PAL was configured. these compilers were either found automatically by Open MPI's "configure" script, or were selected by the user in the CC, CXX, F77, 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 "OPAL_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
okay that's the whole page, and you absolutely ate by reading all of it. this was Open MPI 4.1.6, dated Sep 30, 2023 โ so if you're reading this way later, hi, time traveler, go check for a newer version ๐ฆ๐. go compile something cute. periodt. ๐ โจ
๐ฆ where this page comes from
- ubuntu noble: openmpi-bin 4.1.6-7ubuntu2
- Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved
- Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms