-
Notifications
You must be signed in to change notification settings - Fork 9
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
Emscripten #130
base: main
Are you sure you want to change the base?
Emscripten #130
Changes from 6 commits
1950e84
735b74f
fd12970
40f9233
7bece2b
8f895b0
5c0f39f
685a80e
19cb95b
4973ac0
48f2df7
eaf1bfb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Emscripten | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
defaults: | ||
run: | ||
shell: bash -e -l {0} | ||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set conda environment | ||
uses: mamba-org/setup-micromamba@main | ||
with: | ||
environment-name: myenv | ||
environment-file: environment-dev.yml | ||
init-shell: bash | ||
cache-downloads: true | ||
|
||
- name: install emscripten | ||
run: | | ||
git clone https://github.com/emscripten-core/emsdk | ||
cd emsdk | ||
./emsdk install latest | ||
./emsdk activate latest | ||
source ./emsdk_env.sh | ||
|
||
- name: create wasm prefix | ||
run: | | ||
$MAMBA_EXE create -p $(pwd)/wasm_prefix \ | ||
--platform=emscripten-wasm32 \ | ||
-c https://repo.mamba.pm/emscripten-forge \ | ||
-c https://repo.mamba.pm/conda-forge \ | ||
--yes \ | ||
howardhinnant_date doctest | ||
|
||
- name: build | ||
run: | | ||
|
||
source emsdk/emsdk_env.sh | ||
export PREFIX=$(pwd)/wasm_prefix | ||
export CMAKE_PREFIX_PATH=$PREFIX | ||
export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX | ||
|
||
mkdir build | ||
cd build | ||
|
||
emcmake cmake \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \ | ||
-DCMAKE_INSTALL_PREFIX=$PREFIX \ | ||
-DBUILD_TESTS=ON \ | ||
.. | ||
|
||
emmake make -j9 install | ||
|
||
- name: run tests | ||
run: | | ||
# all teswts with timestamps fail | ||
node build/test/test_sparrow_lib.js -tse=typed_array_timestamp | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,11 @@ dependencies: | |
- ninja | ||
# Tests | ||
- doctest | ||
# Wasm Tests | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to have a condition to not get nodejs if we don't use emscripten ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we could introduce install node at runtime in the ci |
||
- nodejs | ||
# P0355R7 (Extending chrono to Calendars and Time Zones) has not been entirely implemented in libc++ yet. | ||
# See: https://libcxx.llvm.org/Status/Cxx20.html#note-p0355 | ||
# For now, we use HowardHinnant/date as a replacement if we are compiling with libc++. | ||
# TODO: remove this once libc++ has full support for P0355R7. | ||
- howardhinnant_date | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// Copyright 2024 Man Group Operations Limited | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
|
@@ -467,7 +467,7 @@ | |
bool operator==(const typed_array<T, Layout>& ta1, const typed_array<T, Layout>& ta2) | ||
{ | ||
// see https://github.com/man-group/sparrow/issues/108 | ||
#if defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION < 180000) | ||
#if EMSCRIPTEN ||( defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION < 180000)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's possible that you won't need that if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes I think it's better to not have this check (also it should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems this was removed and re-added. Can we confirm that it works without this check if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried with including version 19cb95b but this failed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah it seems that _LIBCPP_VERSION is not defined with Emscripten. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm ok then There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we know if a clang18-based emscripten would also require this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
we don't know. Atm we use the emscripten version of emscripten-forge (3.1.45). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's only to know if there should be an upper bound in these checks. |
||
if(ta1.size() != ta2.size()) | ||
{ | ||
return false; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why j9 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...leftover from copy/pasting