Skip to content

install command

Install previously built FoBiS artifacts, or clone, build, and install a GitHub-hosted Fortran project in one step.

bash
fobis install [repo] [options]

The install command has two modes:

  • Local install (no repo argument): copies artifacts that were built with --track_build to a prefix directory.
  • GitHub install (repo argument given): clones a GitHub-hosted FoBiS project, builds it, and installs the artifacts — all in a single command.

GitHub install options

These options are only relevant when a repo is provided.

OptionDefaultDescription
repo(none)GitHub repository — user/repo shorthand or full HTTPS/SSH URL
--branch BRANCHNoneCheck out a specific branch
--tag TAGNoneCheck out a specific tag
--rev REVNoneCheck out a specific commit SHA
--updateFalseRe-fetch the repository before building
--no-buildFalseClone only — skip building and installing
--deps-dir DIR~/.fobis/Directory used to clone the repository

Directory / install prefix options

OptionDefaultDescription
-p, --prefix./Root installation prefix
--binbin/Sub-directory under prefix for executables
--liblib/Sub-directory under prefix for libraries
--includeinclude/Sub-directory under prefix for module files

fobos options (local install)

OptionDescription
-f, --fobosSpecify a fobos file
-fci, --fobos_case_insensitiveCase-insensitive fobos parsing
-modeSelect a fobos mode
-lmodesList available modes and exit
--print_fobos_templatePrint a fobos template

Fancy options

OptionDescription
-colorsColoured terminal output
-l, --logWrite a log file
-q, --quietLess verbose output
-verboseMaximum verbosity

Examples

GitHub install (one-shot)

bash
# Install szaghi/FLAP from GitHub to the current directory
fobis install szaghi/FLAP

# Install to a custom prefix
fobis install szaghi/FLAP --prefix /usr/local/

# Pin to a specific tag and mode
fobis install szaghi/FLAP --tag v20210301 --prefix ~/.local/ -mode gnu

# Clone only — inspect before building
fobis install szaghi/FLAP --no-build

# Use a full URL instead of the shorthand
fobis install https://github.com/szaghi/FLAP --prefix /opt/fortran/

Local install (from build artefacts)

bash
# Build with artifact tracking enabled
fobis build --track_build

# Install tracked artifacts to the default prefix (./)
fobis install

# Install to a custom prefix
fobis install --prefix /usr/local/

How GitHub install works

  1. The user/repo shorthand is resolved to https://github.com/user/repo; full URLs are used as-is.
  2. The repository is cloned into <deps-dir>/<repo-name>/ (default: ~/.fobis/<repo-name>/).
  3. If --branch, --tag, or --rev is given, that revision is checked out.
  4. The dependency is built with fobis build --track_build (optionally with -mode).
  5. The generated .track_build files are scanned for artifact paths.
  6. Executables are copied to <prefix>/<bin>/, libraries to <prefix>/<lib>/, and module files to <prefix>/<include>/.

The target repository must contain a fobos file.

How local install works

The local mode reads .track_build files produced by a previous fobis build --track_build run and copies the recorded artifacts to the prefix. Use -tb / --track_build on the build command to enable this.

See the GitHub Install advanced guide for a full workflow walkthrough.