Call build.sh, by default the dependencies are installed into the current
working directory under deps.
./build.sh --install-path ~/stack-depsTo build only specific dependencies:
./build.sh --install-path ~/stack-deps --with-deps cli11,fmtAdd stack-dependencies to your bundle's CMakeLists.txt and enable the
dependencies you need with STACK_DEP_<NAME> options:
Note
When included as a sub-project, CMakeLists.txt is a no-op unless
ENABLE_BUNDLED_DEPENDENCIES is ON. The ecbuild_bundle() macro sets
this automatically. If integrating via plain add_subdirectory(), set
ENABLE_BUNDLED_DEPENDENCIES ON before the call.
set(STACK_DEP_CLI11 ON CACHE BOOL "")
set(STACK_DEP_FMT ON CACHE BOOL "")
ecbuild_bundle(
PROJECT stack-dependencies
GIT "ssh://git@github.com/ecmwf/stack-dependencies"
BRANCH master
SHALLOW
)Only the submodules for enabled dependencies are initialized during configure
(with --depth 1 by default).
Available options: STACK_DEP_CLI11, STACK_DEP_FMT, STACK_DEP_LIBAEC,
STACK_DEP_NLOHMANN_JSON, STACK_DEP_PYBIND11, STACK_DEP_QHULL,
STACK_DEP_SQLITE3, STACK_DEP_PROJ, STACK_DEP_LIBPQ,
STACK_DEP_LIBPQXX. All default to OFF in bundle mode —
only explicitly enabled dependencies are built.
Tip
Enabling STACK_DEP_PROJ automatically enables its dependencies
(STACK_DEP_SQLITE3 and STACK_DEP_NLOHMANN_JSON).
| Option | Default | Description |
|---|---|---|
STACK_DEP_<NAME> |
OFF (bundle) / ON (standalone) | Enable a specific dependency |
STACK_DEP_SHALLOW_SUBMODULES |
ON | Uses --depth 1 when initializing submodules |
When used as a bundle sub-project, dependencies are built once and cached via a
stack_deps_built sentinel file in the install directory. Subsequent CMake
configures skip the build if this file exists.
To force a rebuild, delete the sentinel:
rm <build-dir>/stack-dependencies/deps-install/stack_deps_builtWhen the bundle is configured, CPACK_SOURCE_IGNORE_FILES is populated so
that submodule directories of disabled dependencies are excluded from source
tarballs.
In a typical bundle the STACK_DEP_* flags would be in a platform config
file (e.g. linux-generic.cmake) and the bundle's CMakeLists.txt would be configured to load it.
Example packaging workflow:
# configure and create package:
cmake -S . -B build
cmake --build build --target package_source
# on an air-gapped system, extract and install:
tar xf MarsClient-*.tar.gz && cd MarsClient-*
cmake -S . -B build
cmake --build build --target install| Name | Source | Documentation | Version |
|---|---|---|---|
| CLI11 | GitHub | Docs | 2.6.1 |
| libfmt | GitHub | Docs | 12.1.0 |
| libaec | DKRZ | README | 1.1.6 |
| nlohmann/json | GitHub | Docs | 3.12.0 |
| Pybind11 | GitHub | Docs | 3.0.4 |
| Qhull | GitHub | Docs | 2020.2 |
| SQLite3 | GitHub | Docs | 3.53.0 |
| PROJ | GitHub | Docs | 9.8.1 |
| libpq | GitHub | Docs | 18.3 |
| libpqxx | GitHub | Docs | 6.4.8 |