Add Emscripten builds to releases #3682
bmaranville
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
This would be interesting, but requires more discussion. Moving to the 'discussion' section. |
Beta Was this translation helpful? Give feedback.
0 replies
-
This seems to be pretty straightforward now - if I check out hdf5 v1.14.6 from github, I can build a usable distribution package for Emscripten with these additional settings: # CMakeWASM.cmake
# (additional settings for building with Emscripten)
set(CMAKE_EXE_LINKER_FLAGS_INIT "-sNODERAWFS=1 -sFORCE_FILESYSTEM=1 -sSINGLE_FILE=1" CACHE INTERNAL "")
set(HDF5_BUILD_JAVA OFF CACHE STRING "turn off building java for WASM target" FORCE)
set(HDF5_BUILD_FORTRAN OFF CACHE STRING "turn off building fortran for WASM target" FORCE)
option(BUILD_TESTING "build testing" OFF)
option(BUILD_SHARED_LIBS "Build shared libs" OFF)
option(HDF5_BUILD_EXAMPLES "Build Examples" OFF)
set(HDF5_PACKAGE_EXTLIBS ON CACHE BOOL "" FORCE)
set (HDF5_ALLOW_EXTERNAL_SUPPORT "GIT" CACHE STRING "Allow External Library Building (NO GIT TGZ)" FORCE)
option(HDF5_ENABLE_Z_LIB_SUPPORT "Enable ZLIB" ON)
option (ZLIB_USE_LOCALCONTENT "Use local file for ZLIB FetchContent" OFF)
set (ZLIB_GIT_URL "https://github.com/madler/zlib.git" CACHE STRING "Use ZLIB from GitHub repository" FORCE)
set (ZLIB_GIT_BRANCH "v1.3.1" CACHE STRING "" FORCE)
option(HDF5_ENABLE_SZIP_SUPPORT "Enable SZIP" ON)
option (LIBAEC_USE_LOCALCONTENT "Use local file for LIBAEC FetchContent" OFF)
set (LIBAEC_GIT_URL "https://github.com/MathisRosenhauer/libaec.git" CACHE STRING "Use LIBAEC from GitHub repository" FORCE)
set (LIBAEC_GIT_BRANCH "v1.1.3" CACHE STRING "" FORCE) (using Emscripten v3.1.68, cmake v3.31.6, ninja v1.12.1) emcmake cmake -C config/cmake/cacheinit.cmake -C CMakeWASM.cmake -G Ninja -S . -B build_wasm
cmake --build build_wasm --target package (results in HDF5-1.14.6-Emscripten.tar.gz among others) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
I would like to have Emscripten added to the list of architectures for which the library is pre-built and distributed with releases, such as osx12 and ubuntu-2204
Describe the solution you'd like
If the hdf5 library was built with emscripten at every release and the binary package attached as a release artifact
Describe alternatives you've considered
I am currently doing this myself for a selected set of HDF5 versions here: https://github.com/usnistgov/libhdf5-wasm - I would like it if this architecture was officially supported and I didn't build it myself. (I'm not particularly good at CMake)
Additional context
I recently changed my build process to use the provided CPack configuration from HDF5, and it seems to work well. I believe this could be built almost as easily as the packages for the other architectures.
Beta Was this translation helpful? Give feedback.
All reactions