jupyter-xeus / xeus-cling

Jupyter kernel for the C++ programming language
BSD 3-Clause "New" or "Revised" License
3.01k stars 294 forks source link

How to share a notebook from my Github repository to Binder with C++ kernel #485

Closed creme332 closed 1 year ago

creme332 commented 1 year ago

I have a public Github repository containing a C++17 jupyter notebook. I want to access it online on Binder and execute it with xeus-cling.

I tried including in the environment-host.yml and the environment-build.yml files from the xeus-cling repository in my repository. However the list of kernels on the online Binder version does not include C++ kernels at all. (Only the python kernel is available)

What files exactly should I include in my repository to allow Binder to install C++ kernels? I can't find any information on this other than an outdated Youtube tutorial.

Thanks.

creme332 commented 1 year ago

This was much simpler to fix than I thought. All I needed was an environment.yml file in the root directory of my Github repository. The file should contain:

name: any-name-you-want
channels:
  - conda-forge
dependencies:
  - xeus-cling=0.15.1

The xeus-cling version can be updated in the future. Now the C++ kernels are working.

References