|
14 | 14 | `xeus-cpp` is a Jupyter kernel for cpp based on the native implementation of the
|
15 | 15 | Jupyter protocol [xeus](https://github.com/jupyter-xeus/xeus).
|
16 | 16 |
|
17 |
| -## Installation within a mamba envirnoment (non wasm build instructions) |
| 17 | +## Installation within a mamba environment (non wasm build instructions) |
18 | 18 |
|
19 | 19 | To ensure that the installation works, it is preferable to install `xeus-cpp` in a
|
20 | 20 | fresh environment. It is also needed to use a
|
|
60 | 60 | make install
|
61 | 61 | ```
|
62 | 62 |
|
| 63 | +## Installation within a mamba environment (wasm build instructions) |
| 64 | + |
| 65 | +First clone the repository, and move into that directory |
| 66 | +```bash |
| 67 | +git clone --depth=1 https://github.com/compiler-research/xeus-cpp.git |
| 68 | +cd ./xeus-cpp |
| 69 | +``` |
| 70 | + |
| 71 | +Now you'll want to create a clean mamba environment containing the tools you'll need to do a wasm build. This can be done by executing |
| 72 | +the following |
| 73 | +```bash |
| 74 | +micromamba create -n "xeus-cpp-wasm-build" -y environment-wasm-build.yml |
| 75 | +``` |
| 76 | + |
| 77 | +You'll now want to make sure you're using emsdk version "3.1.45" and activate it. You can get this by executing the following |
| 78 | +```bash |
| 79 | +emsdk install 3.1.45 |
| 80 | +emsdk activate 3.1.45 |
| 81 | +source $CONDA_EMSDK_DIR/emsdk_env.sh |
| 82 | +``` |
| 83 | + |
| 84 | +You are now in a position to build the xeus-cpp kernel. You build it by executing the following |
| 85 | +```bash |
| 86 | +micromamba create -f environment-wasm-host.yml --platform=emscripten-wasm32 |
| 87 | +mkdir build |
| 88 | +pushd build |
| 89 | +export EMPACK_PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-build |
| 90 | +export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-host |
| 91 | +export CMAKE_PREFIX_PATH=$PREFIX |
| 92 | +export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX |
| 93 | + |
| 94 | +emcmake cmake \ |
| 95 | + -DCMAKE_BUILD_TYPE=Release \ |
| 96 | + -DCMAKE_PREFIX_PATH=$PREFIX \ |
| 97 | + -DCMAKE_INSTALL_PREFIX=$PREFIX \ |
| 98 | + -DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \ |
| 99 | + -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \ |
| 100 | + .. |
| 101 | +EMCC_CFLAGS='-sERROR_ON_UNDEFINED_SYMBOLS=0' emmake make install |
| 102 | +``` |
| 103 | + |
| 104 | +To test building Jupyter Lite with this kernel without creating a website you can execute the following |
| 105 | +```bash |
| 106 | +micromamba create -n xeus-lite-host jupyterlite-core |
| 107 | +micromamba activate xeus-lite-host |
| 108 | +python -m pip install jupyterlite-xeus |
| 109 | +jupyter lite build --XeusAddon.prefix=$PREFIX |
| 110 | +``` |
| 111 | + |
63 | 112 | ## Trying it online
|
64 | 113 |
|
65 | 114 | To try out xeus-cpp interactively in your web browser, just click on the binder link:
|
|
0 commit comments