diff --git a/Documentation/.vale/Vocab/ogs/accept.txt b/Documentation/.vale/Vocab/ogs/accept.txt index 9edfff8b5f423f2b8b46a715afe4a21ea9f664d4..73a2c7b95d879937979a94e66e5d5f9e6e2e59e9 100644 --- a/Documentation/.vale/Vocab/ogs/accept.txt +++ b/Documentation/.vale/Vocab/ogs/accept.txt @@ -44,6 +44,7 @@ Fortran Francesco Frieder frontmatter +Futurile Galerkin Genuchten Geoenergy diff --git a/scripts/guix/ogs-env.sh b/scripts/guix/ogs-env.sh new file mode 100755 index 0000000000000000000000000000000000000000..9efbbd521900f9bd00f83cbeed2f9355b5d35637 --- /dev/null +++ b/scripts/guix/ogs-env.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -ex +guix time-machine -C scripts/guix/channels.scm -- \ + shell --container --nesting --network --development $1 + openssl nss-certs coreutils bash git diff --git a/web/content/docs/devguide/advanced/guix/index.md b/web/content/docs/devguide/advanced/guix/index.md index 4336afc97816c27d3634cf75f80868711fc48aa5..58dcb39beeb7ed271f7ea388acf2f8dd67d7a42d 100644 --- a/web/content/docs/devguide/advanced/guix/index.md +++ b/web/content/docs/devguide/advanced/guix/index.md @@ -17,28 +17,71 @@ This page and ogs builds with GNU Guix are currently work-in-progress! </div> -[GNU Guix](https://guix.gnu.org) is a distribution of the GNU operating system but also a package manager. You can use it to create bit-by-bit reproducible (Linux) binaries of `ogs`. The package definitions are defined in [`guix.scm`](https://gitlab.opengeosys.org/ogs/ogs/-/blob/master/guix.scm). `guix` is currently installed on `envinf3`. +[GNU Guix](https://guix.gnu.org) is a distribution of the GNU operating system but also a package manager. You can use it to create bit-by-bit reproducible (Linux) binaries of `ogs`. + +The package definitions for OGS are defined in [this repo](https://gitlab.opengeosys.org/ogs/inf/guix-ogs) which can be used as a Guix channel. `guix` is currently installed on `envinf3`. ## Building +### From local source tree + +```bash +# builds ogs serial config +guix time-machine -C scripts/guix/channels.scm -- \ + build ogs --with-source=ogs@6.4.4-testing=$PWD +# SteadyStateDiffuion process only: +guix time-machine -C scripts/guix/channels.scm -- \ + build ogs-ssd --with-source=ogs-ssd@6.4.4-testing=$PWD +# ogs petsc config +guix time-machine -C scripts/guix/channels.scm -- \ + build ogs-petsc --with-source=ogs-petsc@6.4.4-testing=$PWD +``` + +The version string starting after `@` can be set individually. To get the dependency tree: + +```bash +guix time-machine -C scripts/guix/channels.scm -- graph ogs | dot -Tpdf > dag.pdf +``` + +### From web URL + ```bash -guix build -f guix.scm # builds ogs serial config -guix build -L $PWD/.guix/modules ogs-ssd # SteadyStateDiffuion process only -guix build -L $PWD/.guix/modules ogs-petsc # ogs petsc config +wget https://gitlab.opengeosys.org/ogs/ogs/-/raw/master/scripts/guix/channels.scm +guix time-machine -C ./channels.scm -- build ogs \ + --with-source=ogs@6.4.4-testing=https://gitlab.opengeosys.org/ogs/ogs/-/archive/master/ogs-master.tar.bz2 ``` ## Developing ```bash -guix shell +guix time-machine -C scripts/guix/channels.scm -- \ + shell --container --nesting --network --development ogs \ # OR ogs-petsc + openssl nss-certs coreutils bash git # Now in guix shell with all dependencies installed: export CMAKE_PRESET_BUILD_DIR_PREFIX=guix/ # presets then create e.g. ../build/guix/release cmake --preset release -DOGS_BUILD_PROCESSES=SteadyStateDiffusion cmake --build --preset release ``` +As a shortcut you can use this script: + +```bash +./scripts/guix/ogs-env.sh ogs # for serial or `ogs-petsc` for parallel +``` + +You can also play with e.g. different versions of dependencies, here changing OpenMPI to 4.1.6: + +```bash +guix time-machine -C scripts/guix/channels.scm -- \ + shell --container --nesting --network --development ogs-petsc \ + openssl nss-certs coreutils bash git \ + --with-source=openmpi@4.1.6=https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.6.tar.bz2 +``` + ## Links - [`guix build`](https://guix.gnu.org/manual/en/html_node/Invoking-guix-build.html)-reference - [`guix shell`](https://guix.gnu.org/manual/en/html_node/Invoking-guix-shell.html)-reference - [Blog: The ultimate guide to software development with Guix](https://guix.gnu.org/en/blog/2023/from-development-environments-to-continuous-integrationthe-ultimate-guide-to-software-development-with-guix/) +- [Futurile blog](https://www.futurile.net) +- [Peter's Blog](https://peterloleungyau.github.io/post/)