Skip to content

fobos keys ​

A fobos file is the project's build configuration, in INI syntax: one section per mode (a build configuration), plus the special sections below. fobis reads ./fobos, or the file given with -f/--fobos. A mode key has the name of a command-line option without the leading -- and with underscores (--build-dir is build_dir); a key FoBiS does not know is ignored without a warning, so check the spelling against every mode key. A value runs to the end of the line: a ; or # after it is part of the value, and FoBiS warns about it.

How to write one, with examples: Building.

Special sections ​

SectionPurposeRecipes
[modes]The mode sections, modes = debug releaseBuilding
template = SECTIONA mode inheriting the keys of another sectionBuilding
[project]Name, version, authorsBuilding
[features], [feature:NAME], [feature-group:NAME]Named sets of flags switched on with --featuresBuilding
[varsets], [varset:NAME]Bundles of $variable values chosen with --varsetBuilding
[include]Other fobos files read into this oneBuilding
[target.NAME], [example.NAME]Programs built with their own keysBuilding
[rule-NAME]Commands run with fobis rule --execute NAMELibraries and other build systems
[externals]External libraries found with pkg-config or MPI wrappersLibraries and other build systems
[dependencies]Projects fetched from git, or taken from a directoryDependencies
[test]Defaults of fobis testTesting
[coverage]Defaults of fobis coverageTesting
[lint]Rules selected and ignored, the baselineCode quality
[case:NAME], [verification], [assess:NAME], [bench:NAME], [gate]Cases, references, assessments, benchmarks, the gateVerifying results
[scheduler]Slurm settings (also in the user configuration)HPC and clusters
[scaffold], [ecosystem]Shared boilerplate, the ecosystem's checks and release ruleMany projects

Every mode key ​

Generated from the settings of the commands that read a mode.

Any key can be qualified, key.QUALIFIER, and applies only when QUALIFIER is the mode's compiler (gnu, intel, intel_nextgen, g95, opencoarrays-gnu, pgi, ibm, nag, nvfortran, amd, lfortran, custom) or the operating system (linux, macos, windows, freebsd): cflags, lflags, preproc, c_cflags, c_preproc get the value appended (compiler, then system), any other key is replaced. An unknown qualifier, or one key replaced by both a compiler and a system key, is an error. See flags that differ by compiler or system.

KeyRead byDescription
arbuild, clean, doctests, ruleArchiver executable for static libraries [default: ar]
arflagsbuild, clean, doctests, ruleArchiver flags for static libraries [default: -rcs]
bininstallSub-directory for executables [default: bin/]
build_allbuild, clean, doctests, ruleBuild all sources parsed
build_dirallDirectory containing built objects [default: ./]; given here, it wins over the mode's build_dir
build_profilebuildNamed build profile: debug, release, asan, coverage
c_cflagsbuild, doctests, ruleCompile flags of the .c sources (default -c)
c_preprocbuild, doctests, rulePreprocessor flags of the .c sources
ccbuild, doctests, ruleC compiler for the .c sources (default: the compiler family's, e.g. gcc)
cflagsbuild, clean, doctests, ruleCompile flags
cflags_heritagebuild, clean, doctests, ruleStore cflags for heritage checking; re-compile all if they change
coarraybuild, clean, doctests, ruleUse coarrays
colorsallActivate colors in shell prints
compile_commandsbuildWrite the compilation database compile_commands.json in the build directory, linked from the project root (opt-in)
compilerbuild, clean, doctests, ruleCompiler used (case insensitive, default gnu)
coveragebuild, clean, doctests, ruleInstrument for coverage analysis
dependonbuild, clean, doctests, ruleInterdependent external fobos files for interdependent building
deps_dirinstallDirectory for cloning GitHub repositories [default: ~/.fobis/]
disable_recursive_searchbuild, clean, doctests, ruleDisable recursive search inside directories
doctests_preprocessordoctestsPreprocessor used during doctests parsing (cpp|fpp)
excludebuild, clean, doctests, ruleExclude files from the building process
exclude_dirsbuild, clean, doctests, ruleExclude directories from the building process
exclude_from_doctestsdoctestsExclude files from the doctests process
ext_libsbuild, clean, doctests, ruleExternal libraries in compiler path
ext_vlibsbuild, clean, doctests, ruleVolatile external libraries in compiler path
extensionsbuild, clean, doctests, ruleExtensions of parsed files
externalsbuildExternal libraries to detect and link (mpi hdf5 ...): their compile and link flags are added
fcbuild, clean, doctests, ruleFortran compiler statement (for --compiler custom)
featuresbuildComma- or space-separated feature flags to activate (defined in [features] section). Prefix with '-' to deactivate (e.g. 'prod,-coverage'). A mode may declare 'features = a b c' to set its own default set.
force_compileallForce to (re-)compile all
graphallGenerate a dependencies graph via graphviz
helpbuildOne line describing the mode, shown by fobis build --lmodes
incbuild, clean, doctests, ruleExtensions for include files
includeallDirectories for searching included files
intrinsic_modulesbuild
jobsallNumber of concurrent compilation jobs [default: 1]
keep_volatile_doctestsdoctestsKeep the volatile doctests programs
launcherrun, testStart the mode's programs through this command (mpirun -np {ranks}, gdb --args, valgrind); --launcher wins, [test] launcher applies when the mode has none
lflagsbuild, clean, doctests, ruleLink flags
libinstallSub-directory for libraries [default: lib/]
lib_dirbuild, clean, doctests, ruleDirectories searched for libraries
libsbuild, clean, doctests, ruleExternal libraries with full paths
logallActivate log file creation
mklibbuild, clean, doctests, ruleBuild library instead of program (static|shared)
mod_dirbuild, clean, doctests, ruleDirectory containing .mod files [default: ./mod/]
modswbuild, clean, doctests, ruleModule search path switch (for --compiler custom)
mpibuild, clean, doctests, ruleUse MPI enabled version of compiler
no_auto_discoverbuildDisable convention-based source directory auto-discovery
no_default_featuresbuildDisable the default feature set defined in [features] default
obj_dirbuild, clean, doctests, ruleDirectory containing compiled objects [default: ./obj/]
openmpbuild, clean, doctests, ruleUse OpenMP pragmas
openmp_offloadbuild, clean, doctests, ruleUse OpenMP Offload pragmas
outputbuild, clean, doctests, ruleOutput file name (used with --target)
pkgconfigbuildWrite a pkg-config .pc file for the library this mode builds
pkgconfig_descbuildDescription in the .pc file
pkgconfig_namebuildPackage name in the .pc file (default: [project] name)
pkgconfig_reqbuildRequires: line of the .pc file
pkgconfig_req_privbuildRequires.private: line of the .pc file
pkgconfig_urlbuildURL in the .pc file
post_buildbuildRule(s) to execute after successful linking (defined in [rule-X] sections)
pre_buildbuildRule(s) to execute before compilation (defined in [rule-X] sections)
prefixinstallPrefix path where built objects are installed [default: ./]
preprocbuild, doctests, rulePreprocessor flags for the main compiler
preprocessorbuild, doctests, rulePreprocessor name for pre-processing sources (e.g. PreForM.py)
preprocessor_argsbuild, doctests, rulePreprocessor-specific flags
preprocessor_dirbuild, doctests, ruleDirectory for preprocessed files
preprocessor_extbuild, doctests, ruleFile extensions to preprocess
preprocessor_no_obuild, doctests, ruleDo not add -o in front of output in preprocessor command
profilebuild, clean, doctests, ruleInstrument for profiling analysis
quietallLess verbose output
ranlibbuild, clean, doctests, ruleRanlib executable; empty string to skip [default: ranlib]
srcbuild, clean, doctests, ruleRoot-directory of source files [default: ./]
targetbuild, clean, doctests, ruleSpecify a target file [default: all programs found]
templatebuildA [template-NAME] section whose keys this mode inherits (its own keys win)
track_buildbuild, clean, doctests, ruleStore build info for the install command
varsetbuildApply one or more [varset:NAME] sections' $variable bindings to the active mode. Comma- or space-separated; later varsets override earlier ones. Use to swap parameterized values (cluster paths, GPU arch, ...) without duplicating modes.
verboseallExtremely verbose output for debugging
vlibsbuild, clean, doctests, ruleVolatile external libraries with full paths