Installation#

Preliminary: setup Nek5000#

You should always have the environment variable NEK_SOURCE_ROOT pointing to the Nek5000 source code directory:

export NEK_SOURCE_ROOT="/path/to/Nek5000"

Note

You may want to also add the Nek5000 bin directory in your path (with something like export PATH=$PATH:$NEK_SOURCE_ROOT/bin) to also be able to use Nek5000 directly without Snek5000, but it should not be mandatory for Snek5000.

Important

Nek5000 version: To ensure compatibility, you should use our fork snek5000/Nek5000. It contains some bug fixes and enhancements on top of Nek5000 v19 1. We cannot use the bleeding-edge master branch of Nek5000 due to another bug 2.

Nek5000 dependencies: Ensure you have the necessary compilers, build tools and libraries as recommended in the Nek5000 documentation.

Install using pip#

Snek5000 requires Python version 3.8 and above. For most purposes, we recommend creating a virtual environment and then running:

pip install snek5000

See Developer Guide if you wish to install for development.

Install using conda / mamba#

In certain cases, typically:

  • in an OS where at least Python version 3.8 is unavailable, or

  • to use PyPy instead of CPython,

a simple pip install snek5000 may not cut it. Then, it is recommended to use conda (or mamba) to set up the Python environment first. To install Snek5000 with a Python interpreter of your choice, download the environment.yaml file to your hard disk and then execute:

conda create --name env-snek -c conda-forge pypy pip pandas xarray
conda activate env-snek
conda install --yes --file environment.yaml
pypy -m pip install snek5000
conda create --name env-snek -c conda-forge python pip
conda activate env-snek
conda install --yes --file environment.yaml
python -m pip install snek5000

Optional dependencies

Footnotes#

1

The following commits in the snek5000/Nek5000 fork compared to Nek5000 v19 release are essential for Snek5000 to work correctly.

  1. Fixes bug which can cause simultaneously launched simulation to fail: Nek5000/Nek5000@3e53855

  2. Allows for upto 20 userparams Nek5000/Nek5000@5581603

These are also available in the upstream master branch, but has not been released yet. If you have your own Nek5000 fork, consider executing git cherry-pick of these commits.

2

The master branch handles the working directory differently as compared to Nek5000 v19. We will try to support this when they release the new version and finalize it. See issue #270 for more details.