Skip to content

Commit

Permalink
update build instructions and alps build script
Browse files Browse the repository at this point in the history
  • Loading branch information
bcumming committed Dec 19, 2024
1 parent 4cc373f commit ea348a9
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 26 deletions.
13 changes: 4 additions & 9 deletions install-alps-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
57 changes: 40 additions & 17 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit ea348a9

Please sign in to comment.