diff --git a/install-alps-local.sh b/install-alps-local.sh index ab66ac6..7b02fe3 100755 --- a/install-alps-local.sh +++ b/install-alps-local.sh @@ -12,18 +12,13 @@ install=$HOME/.local/$arch rm -rf $build rm -rf $pyenv - -echo "== use python to install meson and ninja in venv: $pyenv" -python3 -m venv $pyenv -source $pyenv/bin/activate -pip install --upgrade pip -pip install meson ninja echo "== configure in $build" -CC=gcc-12 CXX=g++-12 meson setup --prefix=$install $build $root +alias e="uenv run prgenv-gnu/24.11:v1 --view=defulat --" +CC=gcc-12 CXX=g++-12 e meson setup --prefix=$install $build $root echo "== build" -meson compile -C$build +e meson compile -C$build echo "== install" -meson install -C$build --skip-subprojects +e meson install -C$build --skip-subprojects echo "" echo "== succesfully installed" diff --git a/readme.md b/readme.md index f4f5807..b1605dc 100644 --- a/readme.md +++ b/readme.md @@ -40,35 +40,58 @@ cd uenv2 The software uses meson wrap to bring its own dependencies, all of which are built as static libraries. To build you only need -* meson +* meson >= 1.5 * ninja -* g++ that supports C++17 (including the `std::filesystem` library implementation +* g++ that supports C++20 (we test g++12 regularly) On your laptop these requirements can be met using your package manager of choice. On an Alps vCluster, we want to use the system compiler "as is" without using a uenv or modules. The `g++` requirement is met by the `g++-12` compiler, that is installed on the vClusters as part of the boot image. The easiest way to set up meson and ninja is to pip install them to create an isolated build environment. +On Alps the version of Python3 is ancient, so it can't support the required meson version. +The + +``` +alias e="uenv run prgenv-gnu/24.11:v1 --view=default --" +CXX=g++-12 e meson setup -Dtests=enabled build +e meson compile -Cbuild ``` -python3 -m venv ./.env -source .env/bin/activate -pip install ninja meson -mkdir build -cd build -CC=gcc-12 CXX=g++-12 meson setup .. +## testing + +There are three sets of tests: + +* `unit`: unit tests for the C++ library components (Catch2) +* `cli`: tests for the CLI interface (bats) +* `slurm`: tests for the Slurm plugin (bats) + +To build tests, use the `-Dtests=enabled` flag to meson + +``` +meson setup -Dtests=enabled +``` -ninja +The tests are installed in the `test` sub-directory of the build path: ``` +cd build/test -## testing +# run the unit tests +./unit -**NOTE**: the tests require setup stages that are not straightforward to set up on Alps. A PR that fixes these issues is coming soon. +# run the cli tests +./bats cli.bats +``` -The C++ library has unit tests, that are built by default as the `unit` executable in the build path: +The tests can also be run using meson: +``` +# run all the tests +meson test -```bash -> ./unit -Randomness seeded to: 478418581 -=============================================================================== -All tests passed (137 assertions in 16 test cases) +# or run test suites separately +meson test cli +meson test unit ``` + +**NOTE**: the slurm integration tests require configuring Slurm to use the plugin, which requires root permissions. +For this reason, they can't be tested on Alps vClusters. +