Skip to content

Commit

Permalink
Add wasm build instructions to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mcbarton authored Dec 13, 2024
1 parent 0a3a75e commit 8259566
Showing 1 changed file with 54 additions and 1 deletion.
55 changes: 54 additions & 1 deletion docs/source/InstallationAndUsage.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Installation And Usage
--------------------

Installation from source
Installation from source (non wasm build instructions)
========================

To ensure that the installation works, it is preferable to install `xeus-cpp` in a
Expand Down Expand Up @@ -42,6 +42,59 @@ with a custom installation prefix if need be)
-D CMAKE_INSTALL_LIBDIR=lib
make && make install
Installation within a mamba environment (wasm build instructions)
========================

These instructions will assume you have cmake installed on your system. First clone the repository, and move into that directory
.. code-block:: bash
git clone --depth=1 https://github.com/compiler-research/xeus-cpp.git
cd ./xeus-cpp
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

.. code-block:: bash
cd $HOME
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 3.1.45
./emsdk activate 3.1.45
source $HOME/emsdk/emsdk_env.sh
You are now in a position to build the xeus-cpp kernel. You build it by executing the following

.. code-block:: bash
micromamba create -f environment-wasm-host.yml --platform=emscripten-wasm32
mkdir build
pushd build
export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-host
export CMAKE_PREFIX_PATH=$PREFIX
export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX
emcmake cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=$PREFIX \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
..
emmake make install
To build Jupyter Lite with this kernel without creating a website you can execute the following

.. code-block:: bash
micromamba create -n xeus-lite-host jupyterlite-core
micromamba activate xeus-lite-host
python -m pip install jupyterlite-xeus
jupyter lite build --XeusAddon.prefix=$PREFIX
Once the Jupyter Lite site has built you can test the website locally by executing

.. code-block:: bash
jupyter lite serve --XeusAddon.prefix=$PREFIX
Installing from conda-forge
===========================

Expand Down

0 comments on commit 8259566

Please sign in to comment.