Skip to content

Instantly share code, notes, and snippets.

@urbanij
Last active November 4, 2021 13:49
Show Gist options
  • Save urbanij/8ae1115bb53466717abdcad3f2fb4f90 to your computer and use it in GitHub Desktop.
Save urbanij/8ae1115bb53466717abdcad3f2fb4f90 to your computer and use it in GitHub Desktop.

Installing cling (from source, on macOS) and connect it to Jupyter, without conda or xeus_cling

cd to local dev directory (could be anything)

cd Documents/dev

clone the repo

git clone https://github.com/root-project/cling.git

follow the instructions provided by the README

cd tools/packaging

start the building process, this will be quite long and space demanding (~23 GB)

./cpt.py --check-requirements && ./cpt.py --create-dev-env Debug --with-workdir=build

install it (i.e. put it on your path, or just symlink it)

ln -s ~/Documents/dev/cling/tools/packaging/build/builddir/bin/cling /usr/local/bin

go back to the jupyter/kernel folder and finalize the process.

cd ../Jupyter/kernel

and finally

pip install .

jupyter-kernelspec install [--user] cling-cpp17
jupyter-kernelspec install [--user] cling-cpp1z
jupyter-kernelspec install [--user] cling-cpp14
jupyter-kernelspec install [--user] cling-cpp11

now if your launch jupyter

jupyter-notebook

you should have the option to start a c++ kernel.


you're welcome.


Wed Nov 3 22:08:14 CET 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment