OSHMEM-WRAPPER-COMPILER(1)

πŸ‘‘ NAME πŸ‘‘

oshcc, oshcxx, oshc++, oshfort, shmemcc, shmemcxx, shmemc++, shmemfort β€” the OpenSHMEM wrapper compilers from the Open MPI fam, bestie πŸ’–


✨ SYNTAX ✨

okay so every single one of these cuties works the same way, just swap the name:

oshcc [--showme | --showme:compile | --showme:link] ...

oshcxx [--showme | --showme:compile | --showme:link] ...

oshc++ [--showme | --showme:compile | --showme:link] ...

oshfort [--showme | --showme:compile | --showme:link] ...

shmemcc [--showme | --showme:compile | --showme:link] ...

shmemcxx [--showme | --showme:compile | --showme:link] ...

shmemc++ [--showme | --showme:compile | --showme:link] ...

shmemfort [--showme | --showme:compile | --showme:link] ...

πŸ’… OPTIONS πŸ’…

these ones apply to every single wrapper compiler, no exceptions bestie:

  • --showme β€” this icon comes in several different variants (keep scrolling, they're all down there πŸ’œ). Here's the tea: none of the variants actually invoke the underlying compiler. Instead they all just spill the tea on how the underlying compiler would have been invoked if you hadn't passed --showme. The plain basic --showme prints out the full command line that would have been run to compile your program.
🚨 Note: if a non-filename argument gets passed on the command line, --showme will not display any additional flags. Like, for example, both <italic>oshcc --showme</italic> and <italic>oshcc --showme my_source.c</italic> will show all the wrapper-supplied flags. But oshcc --showme -v will only show the underlying compiler name and -v. that's it, that's the whole vibe check 🌸
  • --showme:compile β€” outputs the compiler flags that would have been supplied to the underlying compiler. iconic 🫢
  • --showme:link β€” outputs 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, so don't be shocked).
  • --showme:incdirs β€” outputs a space-delimited (but otherwise undecorated, i.e. no extra frills) list of directories that the wrapper compiler would have handed to the underlying compiler to say "hey, relevant header files live here πŸ’…".
  • --showme:libdirs β€” outputs a space-delimited (but otherwise undecorated) list of directories that the wrapper compiler would have handed to the underlying linker to say "hey, relevant libraries live here ✨".
  • --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 β€” outputs a brief usage help message.

for anything else you're trying to pass through oshcc, go read the man page for your underlying compiler, bestie β€” it's all up in there πŸ“–


πŸ¦‹ DESCRIPTION πŸ¦‹

conceptually, the role of these commands is genuinely so simple it's giving main character energy: they transparently add the relevant compiler and linker flags to your command line β€” the ones you literally cannot compile/link OpenSHMEM programs without β€” and then they invoke the underlying compiler to actually do the thing.

and that's why these commands are constantly called "wrapper" compilers: they don't actually compile or link applications themselves. no cap. They just add in command line flags and invoke the back-end compiler. they're the hype friend, not the performer 🌈


⭐ BACKGROUND ⭐

Open MPI ships wrapper compilers for a bunch of languages:

  • oshcc, shmemcc: C 🌸
  • oshc++, oshcxx, shmemc++, shmemcxx: C++
  • oshfort, shmemfort: Fortran πŸŽ€

the wrapper compilers for each language are identical; you can use them interchangeably. The different names exist solely for backwards compatibility. periodt πŸ’…


🧚 FORTRAN NOTES 🧚

the Fortran wrapper compiler for OpenSHMEM (oshfort and shmemfort) can compile and link OpenSHMEM applications that use any/all of the OpenSHMEM Fortran bindings. slay.

but heads up bestie, the Fortran compiler may need extra 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. iykyk.

and finally β€” and this is the important one 😭 β€” note that oshfort will be inoperative and will return an error on use if Fortran support was not built into the OpenSHMEM layer. so if it's not built in, it's just not built in.


πŸ’œ OVERVIEW πŸ’œ

oshcc and shmemcc are convenience wrappers for the underlying C compiler. Translating an OpenSHMEM program requires linking against the OpenSHMEM-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.

oshcc and shmemcc pass their arguments to the underlying C compiler along with the -I, -L and -l options required by OpenSHMEM programs. 🫢

same deal for all the other language wrapper compilers.

the OpenSHMEM Team strongly encourages using the wrapper compilers instead of trying to link to the OpenSHMEM libraries manually. why? because this lets the specific implementation of OpenSHMEM change without forcing you to go edit linker directives in users' Makefiles. and honestly, the specific set of flags and libraries the wrapper compilers use depends on how OpenSHMEM was configured and built; the values can change between different installations of the same version of OpenSHMEM. so like, don't hardcode it, bestie.

and since the wrappers are simply thin shells on top of an underlying compiler, there are very, very few compelling reasons not to use oshcc. When it's not possible to use the wrappers directly, the --showme:compile and --showme:link options should be used to figure out what flags the wrappers would have used. For example:

shell$ cc -c file1.c `shmemcc --showme:compile`

shell$ cc -c file2.c `shmemcc --showme:compile`

shell$ cc file1.o file2.o `shmemcc --showme:link` -o my_oshmem_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 you pass (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 information can be found here: https://github.com/open-mpi/ompi/wiki/compilerwrapper3264 πŸ’–


πŸŽ€ FILES πŸŽ€

the strings that the wrapper compilers insert into the command line before invoking the underlying compiler are stored in a text file created by OpenSHMEM and installed to $pkgdata/NAME-wrapper-data.txt, where:

  • $pkgdata is typically $prefix/share/openmpi
  • $prefix is the top installation directory of OpenSHMEM
  • NAME is the name of the wrapper compiler (e.g., $pkgdata/shmemcc-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. very demure, very mindful πŸ¦‹


🌈 ENVIRONMENT VARIABLES 🌈

by default, the wrappers use the compilers that were selected when OpenSHMEM 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 above πŸ‘†), or by setting selected environment variables of the form oshmem_<italic>value</italic>.

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 compiler
  • CFLAGS: C compiler flags
  • CXX: C++ compiler
  • CXXFLAGS: C++ compiler flags
  • FC: Fortran compiler
  • FCFLAGS: Fortran compiler flags

2003-2026, The Open MPI Community


and that's the whole page bestie, we ate and left absolutely no crumbs πŸ‘‘πŸ’… this was the oshcc, oshcxx, oshc++, oshfort, shmemcc, shmemcxx, shmemc++, shmemfort page from Open MPI, sliced fresh on Sep 10, 2026. go compile something iconic fr fr πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from