Skip to content

Commit 889fa08

Browse files
authored
Merge branch 'main' into undo
2 parents 357f5d1 + 8ab4242 commit 889fa08

19 files changed

+483
-72
lines changed

.github/workflows/deploy-github-page.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
-DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \
6262
-DCMAKE_FIND_ROOT_PATH=$PREFIX \
6363
-DSYSROOT_PATH=$SYSROOT_PATH \
64+
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
6465
..
6566
emmake make -j ${{ env.ncpus }} install
6667
@@ -74,6 +75,7 @@ jobs:
7475
--XeusAddon.prefix=${{ env.PREFIX }} \
7576
--contents README.md \
7677
--contents notebooks/xeus-cpp-lite-demo.ipynb \
78+
--contents notebooks/smallpt.ipynb \
7779
--contents notebooks/images/marie.png \
7880
--contents notebooks/audio/audio.wav \
7981
--output-dir dist

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ jobs:
244244
-DXEUS_CPP_EMSCRIPTEN_WASM_BUILD=ON \
245245
-DCMAKE_FIND_ROOT_PATH=$PREFIX \
246246
-DSYSROOT_PATH=$SYSROOT_PATH \
247+
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
247248
..
248249
emmake make -j ${{ env.ncpus }} install
249250

CMakeLists.txt

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ function(configure_native_kernel kernel)
148148
endfunction()
149149

150150
function(configure_wasm_kernel kernel)
151+
set(XEUS_CPP_RESOURCE_DIR "/lib/clang/${CPPINTEROP_LLVM_VERSION_MAJOR}" PARENT_SCOPE)
151152

152153
configure_file (
153154
"${CMAKE_CURRENT_SOURCE_DIR}${kernel}wasm_kernel.json.in"
@@ -169,17 +170,9 @@ endfunction()
169170

170171
message("Configure kernels: ...")
171172
if(EMSCRIPTEN)
172-
# TODO: Currently jupyterlite-xeus and xeus-lite do not provide
173-
# methods to fetch information from the arguments present in the
174-
# generated emscripten kernel.
175-
# The following needs to be done here :
176-
# 1) We need to configure the kernel properly
177-
# Check issue https://github.com/compiler-research/xeus-cpp/issues/185.
178-
# 2) Once the above is done we need to add support in jupyterlite-xeus & xeus-lite
179-
# to be able to deal with arguments present in kernel.json
180-
# 3) Finally we should fetch the C++ version from the kernel.json file and
181-
# be able to pass it to our wasm interpreter rather than forcing a version.
173+
configure_wasm_kernel("/share/jupyter/kernels/xcpp17/")
182174
configure_wasm_kernel("/share/jupyter/kernels/xcpp20/")
175+
configure_wasm_kernel("/share/jupyter/kernels/xcpp23/")
183176
else()
184177
configure_native_kernel("/share/jupyter/kernels/xcpp17/")
185178
configure_native_kernel("/share/jupyter/kernels/xcpp20/")
@@ -443,21 +436,15 @@ if(EMSCRIPTEN)
443436
xeus_wasm_compile_options(xcpp)
444437
xeus_wasm_link_options(xcpp "web,worker")
445438
target_link_options(xcpp
439+
PUBLIC "SHELL: -s USE_SDL=2"
446440
PUBLIC "SHELL: --preload-file ${SYSROOT_PATH}/include@/include"
441+
#PUBLIC "SHELL: --preload-file ${CMAKE_INSTALL_PREFIX}${XEUS_CPP_RESOURCE_DIR}@${XEUS_CPP_RESOURCE_DIR}"
447442
PUBLIC "SHELL: --preload-file ${XEUS_CPP_DATA_DIR}@/share/xeus-cpp"
448443
PUBLIC "SHELL: --preload-file ${XEUS_CPP_CONF_DIR}@/etc/xeus-cpp"
449444
PUBLIC "SHELL: --post-js ${CMAKE_CURRENT_SOURCE_DIR}/wasm_patches/post.js"
450445
)
451-
# TODO: Emscripten supports preloading files just once before it generates
452-
# the xcpp.data file (containing the binary representation of the file(s) we
453-
# want to include in our application).
454-
# Hence although we are adding support for Standard Headers, Libraries etc
455-
# through emscripten's sysroot for now, we need to do the following:
456-
# 1) Enable CppInterOp to provide us with a resource dir.
457-
# 2) If the above cannot be done, we can use the resource dir provided
458-
# by llvm on emscripten-forge but would involve adding a dependency.
459-
# 3) Shift the resource dir and the sysroot to a common location.
460-
# 4) Preload everything required together.
446+
# TODO: Uncomment the above line regarding preloading clang's resource dir
447+
# once has been supported through cppinterop.
461448
endif()
462449
# Tests
463450
# =====

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ minutes of past meetings can be found on our
1818
## Setting up a development environment
1919

2020
First, you need to fork the project. After you have done this clone your forked repo. You can do this by
21-
executing the folowing
21+
executing the following
2222

2323
```bash
2424
git clone https://github.com/<your-github-username>/xeus-cpp.git
@@ -35,7 +35,7 @@ micromamba create -f environment-dev.yml -y
3535
micromamba activate xeus-cpp
3636
```
3737

38-
You are now in a position to install xeus-cpp into this envirnoment. You can do this by executing
38+
You are now in a position to install xeus-cpp into this environment. You can do this by executing
3939

4040
```bash
4141
mkdir build
@@ -61,7 +61,7 @@ pytest -sv test_xcpp_kernel.py
6161
## Setting up a development environment (wasm instructions)
6262

6363
First, you need to fork the project. After you have done this clone your forked repo. You can do this by
64-
executing the folowing
64+
executing the following
6565

6666
```bash
6767
git clone https://github.com/<your-github-username>/xeus-cpp.git

docs/source/InstallationAndUsage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Once the Jupyter Lite site has built you can test the website locally by executi
100100
Installing from conda-forge
101101
===========================
102102

103-
If you have conda installed then you can install xeus-cpp using the follwing command
103+
If you have conda installed then you can install xeus-cpp using the following command
104104

105105
.. code-block:: bash
106106

docs/source/index.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ Introduction
1212
------------
1313

1414
``xeus-cpp`` is a Jupyter kernel for cpp based on the native implementation of
15-
the Jupyter protocol xeus_.
15+
the Jupyter protocol xeus_. Try a Jupyter Lite demo of xeus-cpp by clicking
16+
17+
.. image:: https://jupyterlite.rtfd.io/en/latest/_static/badge.svg
18+
:target: https://compiler-research.github.io/xeus-cpp/lab/index.html
19+
:alt: lite-badge
1620

1721
Licensing
1822
---------
@@ -40,4 +44,4 @@ The Xeus-Cpp is a Jupyter kernel for the C++ programming language
4044
FAQ
4145
reference
4246

43-
.. _xeus: https://github.com/jupyter-xeus/xeus
47+
.. _xeus: https://github.com/jupyter-xeus/xeus

include/xeus-cpp/xinterpreter_wasm.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace xcpp
1919
{
2020
public:
2121

22-
wasm_interpreter();
22+
wasm_interpreter(int argc = 0, char** argv = nullptr);
2323
virtual ~wasm_interpreter() = default;
2424

2525
};

include/xeus-cpp/xutils.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ namespace xcpp
2424
XEUS_CPP_API
2525
void stop_handler(int sig);
2626

27-
XEUS_CPP_API
28-
interpreter_ptr build_interpreter(int argc, char** argv);
29-
3027
XEUS_CPP_API
3128
std::string retrieve_tagconf_dir();
3229

0 commit comments

Comments
 (0)