-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xeus-lite kernel compilation error #377
Comments
Did some investigation. The above errors mentioned are for undefined symbols. If you look at the symbols they all contain There are also two other warnings: "function_name" may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library |
Happy New Year ! The error is due to an ABI mismatch in nlohmann json, meaning you're linking with dependencies that link with different versions of nlohmann_json. @DerThorsten I think we had a similar issue that you fixed recently, right? |
Yes, exactly the same issue. Fixed by (re)-building everything with the same version of nlohmann_json |
Thanks for the advice. I got it working. But there was one other issue I faced while building.
Look at https://github.com/Vipul-Cariappa/KariLang-Kernel/actions/runs/7396742302/job/20122493278 mkdir -p /opt/doctest/build
git clone https://github.com/doctest/doctest.git /opt/doctest/src
cd /opt/doctest/src
git checkout v2.4.11
cd /opt/doctest/build
emcmake cmake ../src/ -DCMAKE_INSTALL_PREFIX=/custom_sysroot
emmake make -j2 install Then add the following command line argument for the -Ddoctest_DIR=/custom_sysroot/lib/cmake/doctest I would like to know if it is possible to compile without Should I open a PR at xeus-cookiecutter repository, with the above updates for the GitHub |
Question unrelated to this issue: How do I test the wasm build? When I [Errno 2] No such file or directory: '/home/vipul/micromamba/envs/karilang-wasm-jupyter-test/bin/xkarilang' If I change the [Errno 13] Permission denied: '/home/vipul/micromamba/envs/karilang-wasm-jupyter-test/bin/xkarilang.wasm' I also installed |
Hi, I would suggest that you just use the xeus from emscripten-forge. On emscripten forge we have the whole xeus-stack compiled to wasm already. To run a jupyterlite kernel from a local build of a xeus kernel you can follow these instructions here. The repo https://github.com/jupyterlite/xeus is a relatively new repo which should simplify the deployment / usage of xeus wasm kernels. |
I tried following those instructions; Could not find a package configuration file provided by "xeus-lite" So I run micromamba create -n xeus-python-dev \
--platform=emscripten-wasm32 \
-c https://repo.mamba.pm/emscripten-forge \
-c https://repo.mamba.pm/conda-forge \
--yes \
"python>=3.11" pybind11 nlohmann_json pybind11_json numpy pytest \
bzip2 sqlite zlib libffi xtl pyjs \
xeus xeus-sqlite xeus-lite i.e. included But building jupyterlite files with jupyter lite build --XeusAddon.prefix=$WASM_ENV_PREFIX Does not add my kernel to the final build. I am still not able to access my kernel from the browser. |
So this happens when you try to build your own kernel?
So once you have installed xeus-lite (and the other dependencies) you
Do you install the kernelspec like we do for all our other kernels? https://github.com/jupyter-xeus/xeus-sqlite/blob/main/CMakeLists.txt#L331 And is the name of kernel target the same name as mentioned in the kernelspec? Also, if you want to take any dependency from emscripten forge you need to take emscripten 3.1.45 We changed a few things in the cookie-cutter recently, so maybe just try with running the cookie-cutter again https://github.com/jupyter-xeus/xeus-cookiecutter |
Yes. The error is generated when I try to compile/build.
Yes. I am able to compile and
Yes. That portion of the if (KARILANG_BUILD_EXECUTABLE OR EMSCRIPTEN)
# Configuration and data directories for jupyter and xeus-karilang
set(XJUPYTER_DATA_DIR "share/jupyter" CACHE STRING "Jupyter data directory")
# Install xkarilang Jupyter kernelspec
set(KERNELSPEC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/share/jupyter/kernels)
install(DIRECTORY ${KERNELSPEC_DIR}
DESTINATION ${XJUPYTER_DATA_DIR}
PATTERN "*.in" EXCLUDE)
# Extra path for installing Jupyter kernelspec
if (XEXTRA_JUPYTER_DATA_DIR)
install(DIRECTORY ${KERNELSPEC_DIR}
DESTINATION ${XEXTRA_JUPYTER_DATA_DIR}
PATTERN "*.in" EXCLUDE)
endif ()
endif () You can have a look at the complete CMakeLists.txt here.
Yes. I am pasting the relevant portion of the files below if(EMSCRIPTEN)
include(WasmBuildOptions)
find_package(xeus-lite REQUIRED)
add_executable(xkarilang src/main_emscripten_kernel.cpp )
target_link_libraries(xkarilang PRIVATE xeus-lite KariLang_language)
KARILANG_set_kernel_options(xkarilang)
xeus_wasm_compile_options(xkarilang)
xeus_wasm_link_options(xkarilang "web,worker")
endif() {
"display_name": "KariLang 0.0.1 (xkarilang)",
"argv": [
"@KARILANG_KERNELSPEC_PATH@xkarilang",
"-f",
"{connection_file}"
],
"language": "KariLang",
"metadata": {"debugger": false
}
} I am going to paste some additional information below, if it helps in any means. Output of ❯ emmake make install
make: make install
[ 61%] Built target KariLang_language
[ 84%] Built target xeus-karilang-static
[100%] Built target xkarilang
Install the project...
-- Install configuration: "Release"
-- Up-to-date: /home/vipul/micromamba/envs/xeus-python-dev/share/jupyter/kernels
-- Up-to-date: /home/vipul/micromamba/envs/xeus-python-dev/share/jupyter/kernels/xkarilang
-- Up-to-date: /home/vipul/micromamba/envs/xeus-python-dev/share/jupyter/kernels/xkarilang/logo-32x32.png
-- Up-to-date: /home/vipul/micromamba/envs/xeus-python-dev/share/jupyter/kernels/xkarilang/kernel.json
-- Up-to-date: /home/vipul/micromamba/envs/xeus-python-dev/share/jupyter/kernels/xkarilang/logo-64x64.png
-- Up-to-date: /home/vipul/micromamba/envs/xeus-python-dev/share/jupyter/kernels/xkarilang/logo-svg.svg
-- Up-to-date: /home/vipul/micromamba/envs/xeus-python-dev/lib/cmake/xeus-karilang/xeus-karilangConfig.cmake
-- Up-to-date: /home/vipul/micromamba/envs/xeus-python-dev/lib/cmake/xeus-karilang/xeus-karilangConfigVersion.cmake
-- Up-to-date: /home/vipul/micromamba/envs/xeus-python-dev/bin/xkarilang.js
-- Up-to-date: /home/vipul/micromamba/envs/xeus-python-dev/bin/xkarilang.js
-- Up-to-date: /home/vipul/micromamba/envs/xeus-python-dev/bin/xkarilang.wasm
❯ ccat /home/vipul/micromamba/envs/xeus-python-dev/share/jupyter/kernels/xkarilang/kernel.json
{
"display_name": "KariLang 0.0.1 (xkarilang)",
"argv": [
"/home/vipul/micromamba/envs/xeus-python-dev/bin/xkarilang",
"-f",
"{connection_file}"
],
"language": "KariLang",
"metadata": {"debugger": false
}
} Contents of the ❯ ls /home/vipul/micromamba/envs/xeus-python-dev/bin
bzip2.js bzip2recover.wasm pip py.test python python3.11 sqlite3 xkarilang.js xmylang.js xsqlite.js
bzip2recover.js bzip2.wasm pip3 pytest python3 python.bak wheel xkarilang.wasm xmylang.wasm xsqlite.wasm
I tried the latest version. The compilation and generation of the From my general understanding of stuff; I believe I should copy the Note: Does it make sense to move the above few conversations to a new issue. This issue is concerned with compilation errors. But the last few conversation is about running the compiled output from jupyterlite. Its a suggestion. |
|
I managed to get it working. I created a new mamba environment and installed Previously I had installed Including these details, relating to the virtual environments in the documentation (README.md) would be helpful. I can create a new PR in a few minutes for it and you can have a look at it.
I'm so sorry, for taking your time. And thanks for all the help. The next step would be to publish the "lite" (wasm) version of the kernel. Where would I publish it, to conda forge? or to emscripten forge? Does conda forge support wasm builds? |
nice
No worries, this is a very complicated and not very well documented stack
there is "emscripten-forge" which is a self-made conda-forge-like thing but for emscripten-wasm builds. |
I am trying to create a kernel for a toy programming language I created (Language at https://github.com/Vipul-Cariappa/KariLang).
I followed the instructions from xeus's documentation "Implementing a kernel". I used the xeus-cookiecutter to initialize the boilerplate code. I have marked the
with_wasm
flag asyes
. I looked at the GitHub actions the cookiecutter generated to figure out how to compile it for jupyter-lite (i.e. wasm).I am running the following command:
All the above commands run fine except for the
make
. It fails with long output.I am able to compile the kernel and run it with
xeus-zmp
(dedicated processes), but compiling it withxeus-lite
(run in the browser) fails. You can look at my complete implementation of the kernel at https://github.com/Vipul-Cariappa/KariLang-Kernel. And the log of the GitHub action which builds thexeus-lite
version of the kernel.I am assuming I am doing something wrong, or there is a bug on xeus's side. Any information/suggestions would be helpful.
Happy New Year to you all.
The text was updated successfully, but these errors were encountered: