|
1 | 1 | Installation And Usage |
2 | 2 | -------------------- |
3 | 3 |
|
4 | | -Installation from source |
| 4 | +Installation from source (non wasm build instructions) |
5 | 5 | ======================== |
6 | 6 |
|
7 | 7 | To ensure that the installation works, it is preferable to install `xeus-cpp` in a |
@@ -42,6 +42,59 @@ with a custom installation prefix if need be) |
42 | 42 | -D CMAKE_INSTALL_LIBDIR=lib |
43 | 43 | make && make install |
44 | 44 |
|
| 45 | +Installation within a mamba environment (wasm build instructions) |
| 46 | +======================== |
| 47 | + |
| 48 | +These instructions will assume you have cmake installed on your system. First clone the repository, and move into that directory |
| 49 | +.. code-block:: bash |
| 50 | + git clone --depth=1 https://github.com/compiler-research/xeus-cpp.git |
| 51 | + cd ./xeus-cpp |
| 52 | +
|
| 53 | +
|
| 54 | +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 |
| 55 | + |
| 56 | +.. code-block:: bash |
| 57 | + cd $HOME |
| 58 | + git clone https://github.com/emscripten-core/emsdk.git |
| 59 | + cd emsdk |
| 60 | + ./emsdk install 3.1.45 |
| 61 | + ./emsdk activate 3.1.45 |
| 62 | + source $HOME/emsdk/emsdk_env.sh |
| 63 | +
|
| 64 | +
|
| 65 | +You are now in a position to build the xeus-cpp kernel. You build it by executing the following |
| 66 | + |
| 67 | +.. code-block:: bash |
| 68 | + micromamba create -f environment-wasm-host.yml --platform=emscripten-wasm32 |
| 69 | + mkdir build |
| 70 | + pushd build |
| 71 | + export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-host |
| 72 | + export CMAKE_PREFIX_PATH=$PREFIX |
| 73 | + export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX |
| 74 | +
|
| 75 | + emcmake cmake \ |
| 76 | + -DCMAKE_BUILD_TYPE=Release \ |
| 77 | + -DCMAKE_PREFIX_PATH=$PREFIX \ |
| 78 | + -DCMAKE_INSTALL_PREFIX=$PREFIX \ |
| 79 | + -DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \ |
| 80 | + -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \ |
| 81 | + .. |
| 82 | + emmake make install |
| 83 | +
|
| 84 | +
|
| 85 | +To build Jupyter Lite with this kernel without creating a website you can execute the following |
| 86 | + |
| 87 | +.. code-block:: bash |
| 88 | + micromamba create -n xeus-lite-host jupyterlite-core |
| 89 | + micromamba activate xeus-lite-host |
| 90 | + python -m pip install jupyterlite-xeus |
| 91 | + jupyter lite build --XeusAddon.prefix=$PREFIX |
| 92 | +
|
| 93 | +Once the Jupyter Lite site has built you can test the website locally by executing |
| 94 | + |
| 95 | +.. code-block:: bash |
| 96 | + jupyter lite serve --XeusAddon.prefix=$PREFIX |
| 97 | +
|
45 | 98 | Installing from conda-forge |
46 | 99 | =========================== |
47 | 100 |
|
|
0 commit comments