From 2f2f0320d234491883e561100454ab6a1835fcf8 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Wed, 8 Jan 2025 10:13:49 +0000 Subject: [PATCH] Add correct options to build xeus-cpp-lite deployment correctly --- .github/workflows/deploy-pages.yml | 10 ++++++---- .github/workflows/emscripten.yml | 12 +++++++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index f0b4ffe7..8973ac7f 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -92,12 +92,13 @@ jobs: shell: bash -l {0} run: | ./emsdk/emsdk activate ${{matrix.emsdk_ver}} - source ./emsdk/emsdk_env.sh + source ./emsdk/emsdk_env.sh micromamba create -f environment-wasm.yml --platform=emscripten-wasm32 export PREFIX=$MAMBA_ROOT_PREFIX/envs/CppInterOp-wasm export CMAKE_PREFIX_PATH=$PREFIX export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX + export LDFLAGS="-s MODULARIZE=1 -s LINKABLE=1 -s EXPORT_ALL=1 -s WASM=1 -std=c++14 -s SIDE_MODULE=1 -sWASM_BIGINT" LLVM_DIR="$(pwd)/llvm-project" LLVM_BUILD_DIR="$(pwd)/llvm-project/build" @@ -142,7 +143,7 @@ jobs: ../ fi - emmake make -j ${{ env.ncpus }} + emmake make -j ${{ env.ncpus }} install cd .. @@ -159,6 +160,7 @@ jobs: ./emsdk/emsdk activate ${{matrix.emsdk_ver}} source ./emsdk/emsdk_env.sh export SYSROOT_PATH=$PWD/emsdk/upstream/emscripten/cache/sysroot + export LDFLAGS="-s MODULARIZE=1 -s LINKABLE=1 -s EXPORT_ALL=1 -s WASM=1 -std=c++14 -sWASM_BIGINT" micromamba activate CppInterOp-wasm git clone https://github.com/compiler-research/xeus-cpp.git cd ./xeus-cpp @@ -181,12 +183,12 @@ jobs: shell: bash -l {0} run: | cd ./xeus-cpp/ - 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=${{ env.PREFIX }} --output-dir dist cp ${{ env.PREFIX }}/bin/xcpp.data dist/extensions/@jupyterlite/xeus/static - cp ${{ env.CPPINTEROP_BUILD_DIR }}/lib/libclangCppInterOp.so dist/extensions/@jupyterlite/xeus/static + cp ${{ env.PREFIX }}/lib/libclangCppInterOp.so dist/extensions/@jupyterlite/xeus/static - name: Upload artifact uses: actions/upload-pages-artifact@v3 diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml index ff20de0b..30f9be81 100644 --- a/.github/workflows/emscripten.yml +++ b/.github/workflows/emscripten.yml @@ -302,6 +302,8 @@ jobs: -DLLVM_INCLUDE_EXAMPLES=OFF \ -DLLVM_INCLUDE_TESTS=OFF \ -DLLVM_ENABLE_THREADS=OFF \ + -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \ + -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true \ ../llvm emmake make clang -j ${{ env.ncpus }} emmake make cling -j ${{ env.ncpus }} @@ -331,6 +333,8 @@ jobs: -DLLVM_INCLUDE_EXAMPLES=OFF \ -DLLVM_INCLUDE_TESTS=OFF \ -DLLVM_ENABLE_THREADS=OFF \ + -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \ + -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true \ ../llvm emmake make clang -j ${{ env.ncpus }} emmake make clang-repl -j ${{ env.ncpus }} @@ -541,12 +545,13 @@ jobs: shell: bash -l {0} run: | ./emsdk/emsdk activate ${{matrix.emsdk_ver}} - source ./emsdk/emsdk_env.sh + source ./emsdk/emsdk_env.sh micromamba create -f environment-wasm.yml --platform=emscripten-wasm32 export PREFIX=$MAMBA_ROOT_PREFIX/envs/CppInterOp-wasm export CMAKE_PREFIX_PATH=$PREFIX export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX + export LDFLAGS="-s MODULARIZE=1 -s LINKABLE=1 -s EXPORT_ALL=1 -s WASM=1 -std=c++14 -s SIDE_MODULE=1 -sWASM_BIGINT" LLVM_DIR="$(pwd)/llvm-project" LLVM_BUILD_DIR="$(pwd)/llvm-project/build" @@ -590,7 +595,7 @@ jobs: ../ fi - emmake make -j ${{ env.ncpus }} + emmake make -j ${{ env.ncpus }} install cd .. @@ -607,6 +612,7 @@ jobs: ./emsdk/emsdk activate ${{matrix.emsdk_ver}} source ./emsdk/emsdk_env.sh export SYSROOT_PATH=$PWD/emsdk/upstream/emscripten/cache/sysroot + export LDFLAGS="-s MODULARIZE=1 -s LINKABLE=1 -s EXPORT_ALL=1 -s WASM=1 -std=c++14 -sWASM_BIGINT" micromamba activate CppInterOp-wasm git clone https://github.com/compiler-research/xeus-cpp.git cd ./xeus-cpp @@ -623,4 +629,4 @@ jobs: -DCppInterOp_DIR="${{ env.CPPINTEROP_BUILD_DIR }}/lib/cmake/CppInterOp" \ -DSYSROOT_PATH=$SYSROOT_PATH \ .. - emmake make -j ${{ env.ncpus }} + emmake make -j ${{ env.ncpus }} install