Skip to content

Instantly share code, notes, and snippets.

@dsuess
Last active March 19, 2023 03:53
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dsuess/059b86ea55d639bb99175c9a8cd2ca3e to your computer and use it in GitHub Desktop.
Save dsuess/059b86ea55d639bb99175c9a8cd2ca3e to your computer and use it in GitHub Desktop.
xeus-cling C++ Jupyter kernel inside a docker container
FROM frolvlad/alpine-miniconda3
RUN conda install -y -c conda-forge bash jupyter jupyter_contrib_nbextensions
RUN conda install -y -c conda-forge xeus-cling xtensor
RUN mkdir /notebooks
@dsuess
Copy link
Author

dsuess commented Mar 20, 2019

Run using docker run --rm -p 8888:8888 --workdir /notebooks -it cling jupyter notebook --allow-root --ip 0.0.0.0

@tomssem
Copy link

tomssem commented Jan 6, 2021

Building image as:
docker build -t cling .
and running as above, when presented with the cell:
for(int i = 0; i < 10; ++i) ;
(under c++11/ 14/ 17) yields the error:

ERROR in cling::CIFactory::createCI(): cannot extract standard library include paths!
Invoking:
  LC_ALL=C x86_64-conda-linux-gnu-c++  -O3 -DNDEBUG -xc++ -E -v /dev/null 2>&1 | sed -n -e '/^.include/,${' -e '/^ \/.*++/p' -e '}'
Results was:
With exit code 0
input_line_1:1:10: fatal error: 'new' file not found
#include <new>
         ^~~~~
Warning in cling::IncrementalParser::CheckABICompatibility():
  Failed to extract C++ standard library version.

@mulderp
Copy link

mulderp commented Jan 24, 2021

The cling works with this miniconda version as base image:

 docker run -i -t continuumio/miniconda3 /bin/bash

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