Skip to content
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

Fix kernel configuration for xeus-cpp-lite #185

Open
anutosh491 opened this issue Nov 20, 2024 · 5 comments
Open

Fix kernel configuration for xeus-cpp-lite #185

anutosh491 opened this issue Nov 20, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@anutosh491
Copy link
Collaborator

This is the kernel.json file I see while building xeus-cpp-lite

{
  "display_name": "C++20",
  "env": {
      "PATH":"/Users/anutosh491/micromamba/envs/xeus-cpp/bin:/Users/anutosh491/.pixi/bin:/Users/anutosh491/miniconda3/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/anutosh491/micromamba/condabin:/Users/anutosh491/.pixi/bin:/Users/anutosh491/miniconda3/bin",
      "LD_LIBRARY_PATH":""
  },
  "argv": [
      "/Users/anutosh491/micromamba/envs/xeus-cpp/bin/xcpp",
      "-f",
      "{connection_file}",
      "-resource-dir", "/Users/anutosh491/micromamba/envs/xeus-cpp/lib/clang/19",
      "-I", "/Users/anutosh491/micromamba/envs/xeus-cpp/include",
      "-std=c++20"
  ],
  "language": "cpp",
  "metadata": {"debugger": false
  }
}

Most things are redundant (or can't be used in a wasm context) except

  1. kernel display name
  2. c++ version based on kernel name
  3. language (cpp or c I guess)
  4. debugger info

Things like env, resource dir and other include paths if any can't be put to use.
There is no xcpp exectuable either (a wasm build would give us xcpp.js, xcpp.wasm, xcpp.data) and we just have an empty placeholder there.

@github-actions github-actions bot added the Needs triage Used in auto labelling of new issues label Nov 20, 2024
@anutosh491
Copy link
Collaborator Author

Related #183

@anutosh491
Copy link
Collaborator Author

We should be able to fetch the c++ version out of kernel.json and pass it here

EMSCRIPTEN_BINDINGS(my_module)
{
xeus::export_core();
using interpreter_type = xcpp::wasm_interpreter;
xeus::export_kernel<interpreter_type>("xkernel");
}

@anutosh491
Copy link
Collaborator Author

@mcbarton mcbarton added bug Something isn't working and removed Needs triage Used in auto labelling of new issues labels Dec 16, 2024
@DerThorsten
Copy link
Contributor

DerThorsten commented Dec 17, 2024

@anutosh491 we still use the name of the "executable" on the javascript side
https://github.com/jupyterlite/xeus/blob/main/jupyterlite_xeus/add_on.py#L48

To get the name of the wasm "binary" we use the first value of the args

@anutosh491
Copy link
Collaborator Author

anutosh491 commented Jan 8, 2025

Probably for the wasm case our kernel.json should look like the following for starters

{
  "display_name": "C++20",
  "argv": [
      "/Users/anutosh491/micromamba/envs/xeus-cpp/bin/xcpp",  (this can be just xcpp or xcpp.wasm if we would like)
      "-std=c++20"
  ],
  "language": "cpp",
  "metadata": {"debugger": false
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants