feat: migrate build system from Makefile to CMake#21
feat: migrate build system from Makefile to CMake#21
Conversation
- Replace cpp/build.py with CMake-based build system - Remove obsolete cpp/Makefile (CMake handles compilation now) - Update GitHub workflows to set EMSDK_PATH environment variable - Build now uses emcmake cmake to configure LAMMPS with Emscripten - Supports configurable packages via PACKAGES env var (default: MOLECULE) - Supports SINGLE_FILE mode to embed WASM in JS (default: enabled) - Supports debug builds with --debug flag - Supports force recompilation with --recompile flag This modernizes the build system to match the approach used in atomify-main, providing better dependency management and cleaner build orchestration.
|
|
||
| # Configuration | ||
| LAMMPS_TAG = os.environ.get("LAMMPS_TAG", "patch_10Sep2025") | ||
| PACKAGES = os.environ.get("PACKAGES", "MOLECULE").split() |
There was a problem hiding this comment.
I think we should consider maybe deploying multiple versions with different set of packages. Not sure exactly how we should do it though.
|
Looks good! important improvements. It means that now if I'm trying to use the build:wasm install script, then a Otherwise, tested, works well on my machine and the threejs examples continues work. |
Right, yes. Maybe we don't want that and want to have sourced emscripten first and just use global ref to binaries? |
So you mean that the developer will first source it independently, and the project expects to have it as a global ref? I think it's a fine solution. But I also think that having this export param is OK for now. |
Summary
This PR migrates the build system from the old Makefile-based approach to a modern CMake-based build system, matching the approach used in atomify-main.
Changes
Replaced
cpp/build.pywith CMake-based version that:emcmake cmaketo configure LAMMPS with EmscriptenPACKAGESenv var (default:MOLECULE)SINGLE_FILEmode to embed WASM in JS (default: enabled)--debugflag--recompileflagRemoved
cpp/Makefile- no longer needed since CMake handles compilationUpdated GitHub workflows to set
EMSDK_PATHenvironment variable required by the new build scriptBenefits
Testing
cpp/lammps.jsgenerated correctly (10MB with embedded WASM)Usage