2016-03-25 11:50:40 +00:00
|
|
|
# Minimal C kernel for Jupyter
|
|
|
|
|
2016-04-18 19:52:38 -07:00
|
|
|
## Use with Docker (recommended)
|
2016-03-26 15:39:37 +00:00
|
|
|
|
2020-03-22 12:52:45 +01:00
|
|
|
* `docker pull xaverklemenschits/jupyter-c-kernel`
|
|
|
|
* `docker run -p 8888:8888 xaverklemenschits/jupyter-c-kernel`
|
2017-08-10 14:00:51 -05:00
|
|
|
* Copy the given URL containing the token, and browse to it. For instance:
|
2020-03-22 12:52:45 +01:00
|
|
|
|
2017-08-10 14:00:51 -05:00
|
|
|
```
|
|
|
|
Copy/paste this URL into your browser when you connect for the first time,
|
|
|
|
to login with a token:
|
|
|
|
http://localhost:8888/?token=66750c80bd0788f6ba15760aadz53beb9a9fb4cf8ac15ce8
|
|
|
|
```
|
2016-03-26 15:39:37 +00:00
|
|
|
|
2016-04-18 19:52:38 -07:00
|
|
|
## Manual installation
|
|
|
|
|
2017-08-13 16:25:27 +02:00
|
|
|
Works only on Linux and OS X. Windows is not supported yet. If you want to use this project on Windows, please use Docker.
|
|
|
|
|
|
|
|
|
2016-04-18 19:53:50 -07:00
|
|
|
* Make sure you have the following requirements installed:
|
|
|
|
* gcc
|
|
|
|
* jupyter
|
2016-04-30 11:13:20 +01:00
|
|
|
* python 3
|
2016-04-18 19:53:50 -07:00
|
|
|
* pip
|
2016-04-28 23:29:12 -03:00
|
|
|
|
|
|
|
### Step-by-step:
|
2020-03-22 12:52:45 +01:00
|
|
|
```bash
|
|
|
|
git clone https://github.com/XaverKlemenschits/jupyter-c-kernel.git
|
|
|
|
cd jupyter-c-kernel
|
2020-05-08 15:53:37 +02:00
|
|
|
pip install -e . # for system install: sudo install .
|
|
|
|
cd jupyter_c_kernel && install_c_kernel --user # for sys install: sudo install_c_kernel
|
2020-03-22 12:52:45 +01:00
|
|
|
# now you can start the notebook
|
|
|
|
jupyter notebook
|
|
|
|
```
|
2016-03-25 14:34:14 +00:00
|
|
|
|
|
|
|
## Example of notebook
|
|
|
|
|
|
|
|

|
2016-04-29 09:49:08 +01:00
|
|
|
|
2017-08-10 17:29:41 +02:00
|
|
|
## Custom compilation flags
|
|
|
|
|
|
|
|
You can use custom compilation flags like so:
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
Here, the `-lm` flag is passed so you can use the math library.
|
|
|
|
|
2016-04-30 21:44:41 +01:00
|
|
|
## Contributing
|
|
|
|
|
2016-06-08 11:29:29 +01:00
|
|
|
The docker image installs the kernel in editable mode, meaning that you can
|
|
|
|
change the code in real-time in Docker. For that, just run the docker box like
|
|
|
|
that:
|
|
|
|
|
|
|
|
```bash
|
2020-03-22 12:52:45 +01:00
|
|
|
git clone https://github.com/XaverKlemenschits/jupyter-c-kernel.git
|
2016-06-08 11:29:29 +01:00
|
|
|
cd jupyter-c-kernel
|
2020-03-22 12:52:45 +01:00
|
|
|
docker build -t myName/jupyter .
|
|
|
|
docker run -v $(pwd):/tmp/jupyter_c_kernel/ -p 8888:8888 myName/jupyter
|
2016-06-08 11:29:29 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
This clones the source, run the kernel, and binds the current folder (the one
|
2017-08-10 14:00:51 -05:00
|
|
|
you just cloned) to the corresponding folder in Docker.
|
2016-06-08 11:29:29 +01:00
|
|
|
Now, if you change the source, it will be reflected in [http://localhost:8888](http://localhost:8888)
|
|
|
|
instantly. Do not forget to click "restart" the kernel on the page as it does
|
|
|
|
not auto-restart.
|
|
|
|
|
2016-04-29 09:49:08 +01:00
|
|
|
## License
|
|
|
|
|
2016-06-06 15:52:40 +01:00
|
|
|
[MIT](LICENSE.txt)
|