From f37d4ee23c79288ec7b8391802192fff55c8de12 Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Tue, 28 May 2024 10:39:07 +0200 Subject: [PATCH] Upgraded to xeus 5 --- BuildWasmDockerfile | 19 +------------------ CMakeLists.txt | 8 +------- include/xeus-lite/xembind.hpp | 1 + test/CMakeLists.txt | 2 ++ test/xmock_interpreter.cpp | 9 ++++----- test/xmock_interpreter.hpp | 3 +-- xeus-liteConfig.cmake.in | 1 - 7 files changed, 10 insertions(+), 33 deletions(-) diff --git a/BuildWasmDockerfile b/BuildWasmDockerfile index e22e31c..80f2712 100644 --- a/BuildWasmDockerfile +++ b/BuildWasmDockerfile @@ -10,21 +10,6 @@ RUN mkdir -p /install/lib # make install dir RUN mkdir install -################################################################## -# xtl -################################################################## - -RUN mkdir -p /deps/xtl/build && \ - git clone --branch 0.7.2 https://github.com/xtensor-stack/xtl.git /deps/xtl/src -#RUN cd /deps/xtl/src && git checkout tags/0.7.2 - -RUN cd /deps/xtl/build && \ - emcmake cmake ../src/ -DCMAKE_INSTALL_PREFIX=/install - -RUN cd /deps/xtl/build && \ - emmake make -j8 install - - ################################################################## # nloman json ################################################################## @@ -42,7 +27,7 @@ RUN cd /deps/nlohmannjson/build && \ ################################################################## RUN mkdir -p /deps/xeus/build -RUN git clone --branch 4.0.1 https://github.com/jupyter-xeus/xeus.git /deps/xeus/src +RUN git clone --branch 5.0.0 https://github.com/jupyter-xeus/xeus.git /deps/xeus/src #COPY xeus /deps/xeus/src @@ -50,7 +35,6 @@ RUN cd /deps/xeus/build && \ emcmake cmake ../src \ -DCMAKE_INSTALL_PREFIX=/install \ -Dnlohmann_json_DIR=/install/share/cmake/nlohmann_json \ - -Dxtl_DIR=/install/share/cmake/xtl \ -DXEUS_EMSCRIPTEN_WASM_BUILD=ON RUN cd /deps/xeus/build && \ @@ -69,7 +53,6 @@ RUN mkdir -p /xeus-build && cd /xeus-build && \ emcmake cmake .. \ -DCMAKE_INSTALL_PREFIX=/install \ -Dnlohmann_json_DIR=/install/share/cmake/nlohmann_json \ - -Dxtl_DIR=/install/share/cmake/xtl \ -Dxeus_DIR=/install/lib/cmake/xeus \ -DXEUS_LITE_BUILD_BROWSER_TEST_KERNEL=ON \ -DXEUS_LITE_BUILD_NODE_TESTS=ON diff --git a/CMakeLists.txt b/CMakeLists.txt index 5877289..aade34c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,12 +54,7 @@ message(STATUS "XEUS_LITE_BUILD_NODE_TESTS: ${XEUS_LITE_BUILD_NOD # Dependencies # ============ -set(xtl_REQUIRED_VERSION 0.7) -set(xeus_REQUIRED_VERSION 4.0.0) - -if (NOT TARGET xtl) - find_package(xtl ${xtl_REQUIRED_VERSION} REQUIRED) -endif () +set(xeus_REQUIRED_VERSION 5.0.0) if (NOT TARGET xeus) find_package(xeus ${xeus_REQUIRED_VERSION} REQUIRED) @@ -93,7 +88,6 @@ target_include_directories( ) target_link_libraries( xeus-lite - PUBLIC xtl PUBLIC xeus-static ) diff --git a/include/xeus-lite/xembind.hpp b/include/xeus-lite/xembind.hpp index 6e21630..88b679a 100644 --- a/include/xeus-lite/xembind.hpp +++ b/include/xeus-lite/xembind.hpp @@ -10,6 +10,7 @@ #ifndef XEUS_LITE_XEMBIND_HPP #define XEUS_LITE_XEMBIND_HPP +#include #include #include "xeus/xkernel.hpp" diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 261da69..5b68e51 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -10,6 +10,7 @@ if(XEUS_LITE_BUILD_NODE_TESTS) add_executable(emscripten_wasm_test main_emscripten_wasm.cpp xmock_interpreter.cpp) + target_compile_features(emscripten_wasm_test PRIVATE cxx_std_17) target_link_libraries(emscripten_wasm_test PRIVATE xeus-lite) xeus_wasm_compile_options(emscripten_wasm_test) xeus_wasm_link_options(emscripten_wasm_test "node") @@ -17,6 +18,7 @@ endif() if(XEUS_LITE_BUILD_BROWSER_TEST_KERNEL) add_executable(xlite main_emscripten_wasm.cpp xmock_interpreter.cpp) + target_compile_features(xlite PRIVATE cxx_std_17) target_link_libraries(xlite PRIVATE xeus-lite) xeus_wasm_compile_options(xlite) xeus_wasm_link_options(xlite "web,worker") diff --git a/test/xmock_interpreter.cpp b/test/xmock_interpreter.cpp index b0afafd..eac5b69 100644 --- a/test/xmock_interpreter.cpp +++ b/test/xmock_interpreter.cpp @@ -29,8 +29,7 @@ namespace xeus using function_type = std::function; } - void xmock_interpreter::execute_request_impl(xrequest_context request_context, - send_reply_callback cb, + void xmock_interpreter::execute_request_impl(send_reply_callback cb, int execution_counter, const std::string& code, execute_request_config config, @@ -38,12 +37,12 @@ namespace xeus { if (code.compare("hello, world") == 0) { - publish_stream(request_context, "stdout", code); + publish_stream("stdout", code); } if (code.compare("error") == 0) { - publish_stream(request_context, "stderr", code); + publish_stream("stderr", code); } if (code.compare("?") == 0) @@ -67,7 +66,7 @@ namespace xeus nl::json pub_data; pub_data["text/plain"] = code; - publish_execution_result(request_context, execution_counter, std::move(pub_data), nl::json::object()); + publish_execution_result(execution_counter, std::move(pub_data), nl::json::object()); cb(xeus::create_successful_reply()); return; diff --git a/test/xmock_interpreter.hpp b/test/xmock_interpreter.hpp index 0a9e311..59c2dd4 100644 --- a/test/xmock_interpreter.hpp +++ b/test/xmock_interpreter.hpp @@ -26,8 +26,7 @@ namespace xeus void configure_impl() override; - void execute_request_impl(xrequest_context context, - send_reply_callback cb, + void execute_request_impl(send_reply_callback cb, int execution_counter, const std::string& code, execute_request_config config, diff --git a/xeus-liteConfig.cmake.in b/xeus-liteConfig.cmake.in index f77e43b..4a89e69 100644 --- a/xeus-liteConfig.cmake.in +++ b/xeus-liteConfig.cmake.in @@ -23,7 +23,6 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR};${CMAKE_MODULE_PATH}") @XEUS_LITE_CONFIG_CODE@ include(CMakeFindDependencyMacro) -find_dependency(xtl @xtl_REQUIRED_VERSION@) find_dependency(xeus @xeus_REQUIRED_VERSION@) if(NOT TARGET xeus-lite)