Skip to content

Commit

Permalink
Upgraded to xeus 5
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanMabille committed May 28, 2024
1 parent ca30c6b commit 14f96f8
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 32 deletions.
19 changes: 1 addition & 18 deletions BuildWasmDockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
##################################################################
Expand All @@ -42,15 +27,14 @@ 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

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 && \
Expand All @@ -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
Expand Down
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,8 @@ 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 ()

if (NOT TARGET xeus)
find_package(xeus ${xeus_REQUIRED_VERSION} REQUIRED)
endif ()
Expand Down Expand Up @@ -93,7 +88,6 @@ target_include_directories(
)
target_link_libraries(
xeus-lite
PUBLIC xtl
PUBLIC xeus-static
)

Expand Down
1 change: 1 addition & 0 deletions include/xeus-lite/xembind.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifndef XEUS_LITE_XEMBIND_HPP
#define XEUS_LITE_XEMBIND_HPP

#include <memory>
#include <string>

#include "xeus/xkernel.hpp"
Expand Down
9 changes: 4 additions & 5 deletions test/xmock_interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,20 @@ namespace xeus
using function_type = std::function<void(xeus::xcomm&&, const xeus::xmessage&)>;
}

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,
nl::json /* user_expressions */)
{
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)
Expand All @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions test/xmock_interpreter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion xeus-liteConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 14f96f8

Please sign in to comment.