Supported Compilers
Selecting a compiler
Use the -compiler flag (case-insensitive):
FoBiS.py build -compiler gnu
FoBiS.py build -compiler intel
FoBiS.py 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.py 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.py build -mpiThis switches to the MPI wrapper (e.g. mpif90 for GNU, mpiifort for Intel).
OpenMP
FoBiS.py build -openmpAdds the appropriate OpenMP flag for the selected compiler.
OpenMP offloading
FoBiS.py build -openmp_offloadCoarrays
FoBiS.py build -coarrayCoverage instrumentation
Instrument the build for gcov-compatible coverage analysis:
FoBiS.py build -coverageAfter running the program, analyze .gcov files with the intrinsic rule:
FoBiS.py rule -gcov_analyzer reports/ summaryProfiling
FoBiS.py build -profileCompilation and linking flags
Override the default flags for the selected compiler:
FoBiS.py 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 argparse 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.py build -p " -DDEBUG -DUSE_MPI"In fobos:
[default]
preproc = -DDEBUG -DUSE_MPI