Skip to article frontmatterSkip to article content

Start using Xeus-Cling

Mamba, virtual environment and containers


Depending on your preference, you can use one/all of the following methods to launch Jupyter notebooks with Xeus-Cling kernel for rapid prototyping.

Creating a Conda/Mamba environment

The easiest way to install Xeus-Cling is to create an environment named cling using Mamba:

mamba create -n cling
mamba activate cling

Then you can install Xeus-Cling in this environment and its dependencies:

mamba install xeus-cling -c conda-forge

Now you can launch Jupyter with jupyter lab command and test your setup.

Creating a Python environment

If you’re more adventurous, you can build Xeus-Cling along with all the dependencies from the source in a Python virtual environment using the bash script available here. As a bonus, you will get a newer version of cling (1.0~dev) based on llvm 13.0 that supports OpenMP and CUDA.

The same approach was used to build the container images below.

Using pre-built container images

Docker

docker run -p 8888:8888 -it --rm asobhani/high-performance-data-science-with-modern-cpp

Or this one with CUDA support:

docker run --gpus=all -p 8888:8888 -it --rm asobhani/high-performance-data-science-with-modern-cpp:latest-cuda

If you like to work with your notebooks outside the container (e.g. current folder), you can use the following command instead:

docker run -v $PWD:/home/jovyan -p 8888:8888 -it --rm asobhani/high-performance-data-science-with-modern-cpp

Apptainer

If you’re working on an HPC cluster, you can use Apptainer instead:

apptainer run docker://asobhani/high-performance-data-science-with-modern-cpp:latest

Or this one with CUDA support:

apptainer run --nv docker://asobhani/high-performance-data-science-with-modern-cpp:latest-cuda