There are two ways to build pyodide ifcopenshell Python wrapper wheel.
- Using pyodide build system (
build_pyodide.ymldoes it):
- install prebuilt pyodide build and emscripten environment (see
build_pyodide.sh) - clone IfcOpenShell to
IfcOpenShellfolder - create
packages/ifcopenshellfolder that will be used by pyodide build system - from
IfcOpenShellmove building recipepyodide/meta.yamltopackages/ifcopenshell - run
pyodide build-recipes ifcopenshell --install, it will- execute
meta.yamlrecipe - it will:- copy IfcOpenShell source to build folder
packages/ifcopenhell/build/ifcopenshell-0.8.0 - build ifcopenshell and its dependencies
- note that rerunning
pyodide build-recipeswill remove previous build folder and rebuild all dependencies.
The way to avoid it, if build fails, is to usepyodide build-recipes-no-deps ifcopenshell --continueinstead.
- copy IfcOpenShell source to build folder
- run
setup.pyinIfcOpenShellroot, producing a wheel inIfcOpenShell/dist - copy that wheel to
packages/ifcopenshell/dist --installit to current build envrionment- copy the wheel next to
distfolder (in root directory, next topackages) - add wheel to
dist/pyodide-lock.json
- copy the wheel next to
- execute
- Build it outside of pyodide build system.
Building inside pyodide build system should be preferred, option to build it outside is useful for debugging purposes, since it's pure cmake without any additional moving parts.
- setup pyodide environment, see above
- clone IfcOpenShell repo next to it to
IfcOpenShellfolder - run
python nix/build-all.py -wasm -py-313inIfcOpenShell- it will produce Python package in
IfcOpenShell/ifcopenshell
- it will produce Python package in
- run
pyodide build- it will produce a wheel in
IfcOpenShell/dist
- it will produce a wheel in