Supported Compilers
Selecting a compiler
Use the --compiler flag (case-insensitive, tab-completable):
fobis build --compiler gnu
fobis build --compiler intel
fobis build --compiler custom --fc g95 --modsw "-fmod="Or set it in the fobos file:
[default]
compiler = gnuBuilt-in compilers
| Identifier | Compiler |
|---|---|
gnu | GNU gfortran |
intel | Intel Fortran Compiler Classic (ifort) |
intel_nextgen | Intel Fortran Compiler (ifx) |
g95 | g95 |
opencoarrays-gnu | OpenCoarrays + gfortran |
pgi | PGI Fortran Compiler |
ibm | IBM XL Fortran |
nag | NAG Fortran Compiler |
nvfortran | NVIDIA HPC Fortran (nvfortran) |
amd | AMD Flang (amdflang) |
custom | User-defined — requires --fc and optionally --modsw |
Custom compiler
For any compiler not listed, use custom and specify the executable and module path switch:
fobis build --compiler custom --fc /opt/myfc/bin/myfc --modsw "-module "In a fobos file:
[default]
compiler = custom
fc = /opt/myfc/bin/myfc
modsw = -module
cflags = -c -O2Compiler variants
MPI
Enable the MPI-wrapped compiler variant:
fobis build --mpiThis switches to the MPI wrapper (e.g. mpif90 for GNU, mpiifort for Intel).
OpenMP
fobis build --openmpAdds the appropriate OpenMP flag for the selected compiler.
OpenMP offloading
fobis build --openmp-offloadCoarrays
fobis build --coarrayCoverage instrumentation
Instrument the build for gcov-compatible coverage analysis:
fobis build --coverageAfter running the program, analyze .gcov files with the intrinsic rule:
fobis rule --gcov-analyzer reports/ summaryProfiling
fobis build --profileCompilation and linking flags
Override the default flags for the selected compiler:
fobis build --cflags " -c -O3 -march=native" --lflags " -O3"Or in fobos:
[default]
cflags = -c -O3 -march=native
lflags = -O3Flag prefixing
Prepend a space to flag strings to avoid the parser misinterpreting flags that start with -. See the Quick Start note.
Preprocessor flags
Pass flags to the compiler's built-in preprocessor (e.g. -D macros):
fobis build --preproc " -DDEBUG -DUSE_MPI"In fobos:
[default]
preproc = -DDEBUG -DUSE_MPI