Skip to content

Commit 759d5d2

Browse files
Merge pull request #138 from SylvainCorlay/pkg-rebuild-test
Optionally run pkg rebuild upon starting kernel
2 parents dca6a56 + 1b1b580 commit 759d5d2

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
5555
-DCMAKE_FIND_ROOT_PATH="$PREFIX" \
5656
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
57+
-DXEUS_OCTAVE_PKG_REBUILD=ON \
5758
-DCMAKE_VERBOSE_MAKEFILE=ON
5859
5960
emmake make -j${{ env.ncpus }} install
@@ -65,6 +66,8 @@ jobs:
6566
--XeusAddon.prefix=${{ env.PREFIX }} \
6667
--XeusAddon.mounts=$PREFIX/share/octave:/share/octave \
6768
--XeusAddon.mounts=$PREFIX/share/xeus-octave:/share/xeus-octave \
69+
--XeusAddon.default_channels=https://repo.prefix.dev/emscripten-forge-dev \
70+
--XeusAddon.default_channels=https://repo.prefix.dev/conda-forge \
6871
--contents notebooks/xeus-octave-wasm.ipynb \
6972
--output-dir dist
7073

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ option(XEUS_OCTAVE_BUILD_STATIC "Build xeus-octave static library" OFF)
6464
option(XEUS_OCTAVE_BUILD_SHARED "Split xoctave build into executable and library" ON)
6565
option(XEUS_OCTAVE_BUILD_EXECUTABLE "Build the xoctave executable" ON)
6666

67+
option(XEUS_OCTAVE_PKG_REBUILD "Run pkg rebuild upon starting the kernel" OFF)
68+
6769
option(
6870
XEUS_OCTAVE_USE_SHARED_XEUS_ZMQ
6971
"Link xeus-octave with the xeus-zmq shared library (instead of the static library)"
@@ -252,6 +254,10 @@ macro(xeus_octave_create_target target_name linkage output_name)
252254
PRIVATE XEUS_OCTAVE_OVERRIDE_PATH="${CMAKE_INSTALL_PREFIX}/share/xeus-octave"
253255
)
254256

257+
if(XEUS_OCTAVE_PKG_REBUILD)
258+
target_compile_definitions(${target_name} PRIVATE "XEUS_OCTAVE_PKG_REBUILD")
259+
endif()
260+
255261
target_include_directories(
256262
${target_name}
257263
PUBLIC $<BUILD_INTERFACE:${XEUS_OCTAVE_INCLUDE_DIR}> $<INSTALL_INTERFACE:include>

environment-wasm-host.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ dependencies:
88
- nlohmann_json
99
- nlohmann_json-abi
1010
- octave
11+
- octave-fuzzy-logic-toolkit
1112
- libpng
1213
- zlib
1314
- libflang

src/xinterpreter.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,13 @@ void xoctave_interpreter::configure_impl()
437437
// Initialize interpreter
438438
m_octave_interpreter.execute();
439439

440+
#ifdef XEUS_OCTAVE_PKG_REBUILD
441+
// Run pkg rebuild upon starting the kernel
442+
std::string pkg_rebuild("pkg rebuild");
443+
int status = 0;
444+
m_octave_interpreter.eval_string(pkg_rebuild, true, status);
445+
#endif
446+
440447
// Fix disp function and clear display function
441448
m_octave_interpreter.get_symbol_table().install_built_in_function("display", octave_value());
442449

0 commit comments

Comments
 (0)