Add Meson build system as alternative to CMake#10
Add Meson build system as alternative to CMake#10munechika-koyo wants to merge 35 commits intoiterorganization:developfrom
Conversation
- Introduced meson.build files for project setup and library configuration. - Added options for building internal core library and dummy executable. - Included source files for HDF5 and UDA backends. - Configured public headers and installation paths.
…on and add option for building tests
add test cases for lowlevel executables and modify dummy executable option
…'python -m setuptools_scm'
…2 dependency method in Meson build configuration
…rce handling for UDA and HDF5 backends
…endencies Format code
to make consist between .dll and .lib file name
|
@munechika-koyo Could you please check this PR? This fixes numpy issue on SDCC. munechika-koyo#1 |
prasad-sawantdesai
left a comment
There was a problem hiding this comment.
Thanks for adding this build system @munechika-koyo
It seems faster than normal cmake workflow.
time meson setup --reconfigure builddir --prefix="$HOME/.local"
real 0m20.597s
user 0m3.148s
sys 0m6.954s
time meson compile -C builddir
real 1m19.796s
user 2m2.108s
sys 0m20.637s
| # ============================================================================= | ||
| # Add Optional Backends | ||
| # ============================================================================= | ||
| if get_option('al_backend_hdf5') |
There was a problem hiding this comment.
is it possible to use capital case here or are there any limitations? -DAL_BACKEND_UDA=OFF -DAL_BACKEND_UDAFAT=OFF -DAL_BACKEND_MDSPLUS=OFF
There was a problem hiding this comment.
We should not use capital names in the meson build to follow the style guide.
Additionally, many built-in options are already defined in lowercase, so we should follow that convention to avoid confusion.
| # ============================================================================= | ||
| # Summary | ||
| # ============================================================================= | ||
| if get_option('al_core') |
There was a problem hiding this comment.
Should we add github workflow for testing meson build?
There was a problem hiding this comment.
Is it possible to add small list of steps in the sphinx documentation? https://github.com/iterorganization/IMAS-Core/blob/develop/docs/source/user_guide/installation.rst somewhere here?
Thank you for measuring the compilation time! |
Yes, it is slower.. time cmake -Bbuild -S .
real 0m44.060s
user 0m14.387s
sys 0m6.725s
time cmake --build build
real 7m28.771s
user 4m35.985s
sys 1m53.904s |
Summary
This pull request introduces Meson as an alternative build system for IMAS-Core, complementing the existing CMake build system. This addition provides developers with a modern, fast, and user-friendly build option while maintaining full backward compatibility with the current CMake workflow.
Motivation
Key Features
🔧 Complete Build System Implementation
al-corewith all backends (HDF5, UDA, MDSplus)imas-corePython package📦 Backend Support
🐍 Python Integration
setuptools-scmFiles Added/Modified
New Meson Files
meson.build- Main build configurationmeson_options.txt- Build options and feature togglessrc/meson.build- Core library build configurationinclude/meson.build- Public Header installation configurationpython/meson.build- Python bindings build configurationBuild Options
Compatibility
Testing
imas-coreDevelopment Environment
We used
pixito manage the development environment for testing the Meson build system.The
pixi.tomlfile has been updated to include Meson and Ninja as build tools, ensuring a consistent and reproducible environment for developers.Here is the configuration I used:
pixi.toml
mesoncommand can be used throughpixi run meson ....Note: This is a non-breaking change that purely adds functionality. All existing CMake-based workflows continue to work unchanged.