Skip to content

Commit

Permalink
Fix wasm build instructions (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcbarton authored Jan 22, 2025
1 parent ef9d57d commit 11392fb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 33 deletions.
20 changes: 9 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,21 @@ git clone https://github.com/<your-github-username>/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
You'll now want to make sure you are using the same emsdk as the rest of our dependencies. This can be achieved by executing
the following
```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
micromamba create -f environment-wasm-build.yml -y
micromamba activate xeus-cpp-wasm-build
```

You are now in a position to build the xeus-cpp kernel. You build it by executing the following
```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 SYSROOT_PATH=$HOME/emsdk/upstream/emscripten/cache/sysroot
cd build
export BUILD_TOOLS_PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-build
export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-host
export SYSROOT_PATH=$BUILD_TOOLS_PREFIX/opt/emsdk/upstream/emscripten/cache/sysroot

emcmake cmake \
-DCMAKE_BUILD_TYPE=Release \
Expand All @@ -98,7 +96,7 @@ emmake make install

To build Jupyter Lite with this kernel without creating a website you can execute the following
```bash
micromamba create -n xeus-lite-host jupyterlite-core
micromamba create -n xeus-lite-host jupyterlite-core -c conda-forge
micromamba activate xeus-lite-host
python -m pip install jupyterlite-xeus
jupyter lite build --XeusAddon.prefix=$PREFIX
Expand Down
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,21 @@ 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
You'll now want to make sure you are using the same emsdk as the rest of our dependencies. This can be achieved by executing
the following
```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
micromamba create -f environment-wasm-build.yml -y
micromamba activate xeus-cpp-wasm-build
```

You are now in a position to build the xeus-cpp kernel. You build it by executing the following
```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 SYSROOT_PATH=$HOME/emsdk/upstream/emscripten/cache/sysroot
cd build
export BUILD_TOOLS_PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-build
export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-host
export SYSROOT_PATH=$BUILD_TOOLS_PREFIX/opt/emsdk/upstream/emscripten/cache/sysroot

emcmake cmake \
-DCMAKE_BUILD_TYPE=Release \
Expand All @@ -99,7 +97,7 @@ emmake make install

To build Jupyter Lite with this kernel without creating a website you can execute the following
```bash
micromamba create -n xeus-lite-host jupyterlite-core
micromamba create -n xeus-lite-host jupyterlite-core -c conda-forge
micromamba activate xeus-lite-host
python -m pip install jupyterlite-xeus
jupyter lite build --XeusAddon.prefix=$PREFIX
Expand Down
20 changes: 9 additions & 11 deletions docs/source/InstallationAndUsage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,25 @@ These instructions will assume you have cmake installed on your system. First cl
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
You'll now want to make sure you are using the same emsdk as the rest of our dependencies. This can be achieved 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
micromamba create -f environment-wasm-build.yml -y
micromamba activate xeus-cpp-wasm-build
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 SYSROOT_PATH=$HOME/emsdk/upstream/emscripten/cache/sysroot
cd build
export BUILD_TOOLS_PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-build
export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-cpp-wasm-host
export SYSROOT_PATH=$BUILD_TOOLS_PREFIX/opt/emsdk/upstream/emscripten/cache/sysroot
emcmake cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
Expand All @@ -88,7 +86,7 @@ To build Jupyter Lite with this kernel without creating a website you can execut

.. code-block:: bash
micromamba create -n xeus-lite-host jupyterlite-core
micromamba create -n xeus-lite-host jupyterlite-core -c conda-forge
micromamba activate xeus-lite-host
python -m pip install jupyterlite-xeus
jupyter lite build --XeusAddon.prefix=$PREFIX
Expand Down

0 comments on commit 11392fb

Please sign in to comment.