Add SimpleITK (and libitk dependency) for emscripten-wasm32#5448
Add SimpleITK (and libitk dependency) for emscripten-wasm32#5448
Conversation
Agent-Logs-Url: https://github.com/emscripten-forge/recipes/sessions/4f195ea6-a97a-412c-a2fb-443fbc67f3dd Co-authored-by: martinRenou <21197331+martinRenou@users.noreply.github.com>
…e precisely Agent-Logs-Url: https://github.com/emscripten-forge/recipes/sessions/4f195ea6-a97a-412c-a2fb-443fbc67f3dd Co-authored-by: martinRenou <21197331+martinRenou@users.noreply.github.com>
|
@copilot CI is failing to build libitk with |
…ones Agent-Logs-Url: https://github.com/emscripten-forge/recipes/sessions/a312a5b8-55a7-4304-b751-c97580b14ec1 Co-authored-by: martinRenou <21197331+martinRenou@users.noreply.github.com>
... The issue was that the emscripten toolchain file sets Fixed in commit |
@copilot Can you instead make sure it finds the libraries correctly? Compiling the bundled versions of the dependencies will most likely not work |
… with emscripten toolchain Agent-Logs-Url: https://github.com/emscripten-forge/recipes/sessions/c35ae874-8943-489b-aa3e-e49a140b28f4 Co-authored-by: martinRenou <21197331+martinRenou@users.noreply.github.com>
Done in commit |
|
@copilot it now fails with you need to disable any threading APIs if you can |
…ds/OpenMP for emscripten Agent-Logs-Url: https://github.com/emscripten-forge/recipes/sessions/531c46f8-9c43-433a-8b2a-fe62eb57cfa1 Co-authored-by: martinRenou <21197331+martinRenou@users.noreply.github.com>
... Fixed in commit |
|
@copilot It now fails with, if we really need and if possible, we could disable HDF5 features for now |
Agent-Logs-Url: https://github.com/emscripten-forge/recipes/sessions/d1d2cf31-8fb7-439b-b287-9d73613b6dba Co-authored-by: martinRenou <21197331+martinRenou@users.noreply.github.com>
... Done in commit |
|
@copilot it's still trying to compile third party hdf5, make it not do that |
…DF5 dependency chain Agent-Logs-Url: https://github.com/emscripten-forge/recipes/sessions/8558dea2-8be7-4ab9-bb1c-a65720f64d23 Co-authored-by: martinRenou <21197331+martinRenou@users.noreply.github.com>
Done in commit |
Adds recipes to build SimpleITK (Python image analysis toolkit) and its ITK C++ dependency for the
emscripten-wasm32platform.Template A: Checklist for adding a package
Pre-submission Checks
emscripten-wasm32platform (not a noarch package), in other words, the package requires compilation.Recipe Structure
libitk(ITK 5.4.6 — C++ static library)Added
recipes/recipes_emscripten/libitk/recipe.yaml:contextsection withversionpackagesection with name and versionsourcesection with verified SHA256 (cf28bc7220c57c24ebcbabbd3b2544ea7ab65f0aad430a99f8e157738ed812b7)buildsection — usesemcmake cmake+ninjaviabuild.sh; build number 0requirements: build (gcc,gxx,cmake,ninja), host (expat,libjpeg-turbo,libpng,libtiff,eigen,zlib)tests:package_contentschecks for key headers/libsaboutsection with license and homepageKey build flags:
ITK_DEFAULT_THREADER=Platform(single-threaded fallback, no pthreads/OpenMP/TBB),BUILD_SHARED_LIBS=OFF,ITK_FORBID_DOWNLOADS=ON(no remote modules), entire HDF5 dependency chain disabled, system libs used for expat/jpeg/png/tiff/zlib/eigen.simpleitk(SimpleITK 2.5.3 — Python wrapper)Added
recipes/recipes_emscripten/simpleitk/recipe.yaml:contextsection withversionpackagesection with name and versionsourcesection with verified SHA256 (1ef3642b0695c8eb0a0193fefe7677c57bce94a86d6b01f48f58b2291b4ca935)buildsection — two-stagebuild.sh; build number 0requirements: build (gcc,gxx,cmake,ninja,swig >=4.0.0,cross-python_emscripten-wasm32,python), host (python,pip,libitk), run (python)tests:test_import_simpleitk.pyviapytesteraboutsection with license and homepageBuild uses two stages: (1) build SimpleITK C++ static library (
WRAP_DEFAULT=OFF), install to$PREFIX; (2) build SWIG Python wrapper fromWrapping/Pythonagainst the installed library, thenpip install.overwriteProp.cmakeenables shared lib creation for the.soPython extension module.PR Formatting
Add [package-name]Package Details
libitk,simpleitkBuild Notes
ITK_DEFAULT_THREADER=Platform—Sequentialis not a valid enum value in ITK 5.4.x'sMultiThreaderBaseEnums::Threader. ThePlatformthreader runs single-threaded on platforms without OS thread support (i.e. WASM). All threading APIs are explicitly disabled:ITK_USE_PTHREADS=OFF,ITK_USE_OPENMP=OFF,Module_ITKTBB=OFF,Module_ITKTBBImageToImageFilter=OFF.Module_ITKHDF5=OFF(bundled third-party HDF5 library),Module_ITKIOHDF5=OFF(HDF5 image IO),Module_ITKIOTransformHDF5=OFF(HDF5 transform IO), andModule_ITKIOTransformFactory=OFF(the transform IO factory module that hasITKIOTransformHDF5as a required dependency, which was forcing the bundled HDF5 to be compiled despite the per-module disables).hdf5is not a host dependency.ITK_FORBID_DOWNLOADS=ONto ensure reproducible offline builds.-DCMAKE_FIND_ROOT_PATH=$PREFIXis passed to cmake so thatfind_package()calls (ZLIB, JPEG, PNG, TIFF, Expat, Eigen) correctly resolve to conda packages in$PREFIX. The emscripten toolchain restricts CMake's library/include search toCMAKE_FIND_ROOT_PATHusingONLYmode, which otherwise prevents discovery of host packages.overwriteProp.cmaketo setTARGET_SUPPORTS_SHARED_LIBS TRUEand WASM SIDE_MODULE flags so cmake can create the.soextension.cross-python_emscripten-wasm32activation setsCMAKE_ARGSwith correct Python headers/paths andLDFLAGSwithSIDE_MODULE=1for the extension link step.