From 027e9a3d5f5ea49f1a727c2c18a557366931afd6 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Sun, 9 Feb 2025 16:11:15 +0000 Subject: [PATCH] Update Emscripten build documentation to reflect that CppInterOp can now be tested --- Emscripten-build-instructions.md | 13 ++++++++++--- docs/Emscripten-build-instructions.rst | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Emscripten-build-instructions.md b/Emscripten-build-instructions.md index 662643db3..943062f07 100644 --- a/Emscripten-build-instructions.md +++ b/Emscripten-build-instructions.md @@ -25,11 +25,12 @@ git clone https://github.com/emscripten-core/emsdk.git ./emsdk/emsdk install 3.1.73 ``` -and activate the emsdk environment +and activate the emsdk environment (we are defining SYSROOT_PATH for use later) ```bash ./emsdk/emsdk activate 3.1.73 source ./emsdk/emsdk_env.sh +export SYSROOT_PATH=$PWD/emsdk/upstream/emscripten/cache/sysroot ``` Now clone the 19.x release of the LLVM project repository and CppInterOp (the building of the emscripten version of llvm can be @@ -97,7 +98,7 @@ export CMAKE_PREFIX_PATH=$PREFIX export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX ``` -Now to build CppInterOp execute the following +Now to build and test your Emscripten build of CppInterOp by executing the following ```bash mkdir build @@ -109,7 +110,14 @@ emcmake cmake -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=ON \ -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \ -DCMAKE_INSTALL_PREFIX=$PREFIX \ + -DSYSROOT_PATH=$SYSROOT_PATH \ ../ +emmake make -j $(nproc --all) check-cppinterop +``` + +Assuming it passes all test you can install by executing the following + +```bash emmake make -j $(nproc --all) install ``` @@ -126,7 +134,6 @@ the CppInterOp build folder, you can build the wasm version of xeus-cpp by execu ```bash cd ../.. -export SYSROOT_PATH=$PWD/emsdk/upstream/emscripten/cache/sysroot git clone --depth=1 https://github.com/compiler-research/xeus-cpp.git cd ./xeus-cpp mkdir build diff --git a/docs/Emscripten-build-instructions.rst b/docs/Emscripten-build-instructions.rst index aa0254c3f..f849f64bf 100644 --- a/docs/Emscripten-build-instructions.rst +++ b/docs/Emscripten-build-instructions.rst @@ -35,12 +35,13 @@ This can be installed by executing (we only currently support version git clone https://github.com/emscripten-core/emsdk.git ./emsdk/emsdk install 3.1.73 -and activate the emsdk environment +and activate the emsdk environment (we are defining SYSROOT_PATH for use later) .. code:: bash ./emsdk/emsdk activate 3.1.73 source ./emsdk/emsdk_env.sh + export SYSROOT_PATH=$PWD/emsdk/upstream/emscripten/cache/sysroot Now clone the 19.x release of the LLVM project repository and CppInterOp (the building of the emscripten version of llvm can be avoided by @@ -115,7 +116,7 @@ You will also want to set a few environment variables export CMAKE_PREFIX_PATH=$PREFIX export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX -Now to build CppInterOp execute the following +Now to build and test your Emscripten build of CppInterOp by executing the following .. code:: bash @@ -128,7 +129,14 @@ Now to build CppInterOp execute the following -DBUILD_SHARED_LIBS=ON \ -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \ -DCMAKE_INSTALL_PREFIX=$PREFIX \ + -DSYSROOT_PATH=$SYSROOT_PATH \ ../ + emmake make -j $(nproc --all) check-cppinterop + +Assuming it passes all test you can install by executing the following. + +.. code:: bash + emmake make -j $(nproc --all) install Once this finishes building we need to take note of where we built @@ -147,7 +155,6 @@ build folder, you can build the wasm version of xeus-cpp by executing .. code:: bash cd ../.. - export SYSROOT_PATH=$PWD/emsdk/upstream/emscripten/cache/sysroot git clone --depth=1 https://github.com/compiler-research/xeus-cpp.git cd ./xeus-cpp mkdir build