Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
cf8a574
Add Meson build configuration and source files for al-core library
munechika-koyo Dec 5, 2025
a83d76a
Update Meson version requirement and improve section formatting in me…
munechika-koyo Dec 5, 2025
fb947cb
Refactor Meson build configuration to use external al-core installati…
munechika-koyo Dec 5, 2025
c7de00b
Add Meson build configuration for Python extension module
munechika-koyo Dec 5, 2025
58407e0
Add Meson build configuration for test executables
munechika-koyo Dec 5, 2025
cf45462
Fix version comparison syntax in Meson build configuration for UDA de…
munechika-koyo Dec 5, 2025
662586d
Add versioning support in Meson build configuration and create _versi…
munechika-koyo Dec 5, 2025
06b1922
Update Meson build configuration
munechika-koyo Dec 5, 2025
e5fe0e2
Format comment bars
munechika-koyo Dec 5, 2025
fbc8419
Update version retrieval command in Meson build configuration to use …
munechika-koyo Dec 9, 2025
5e9b832
Fix variable name for UDA fat client dependency in Meson build config…
munechika-koyo Dec 9, 2025
0b4a380
Replace Windows thread dependency with pthreads and update dlfcn-win3…
munechika-koyo Dec 11, 2025
cf9a7ea
Add conditional compiler flags for HDF5 on Windows
munechika-koyo Dec 15, 2025
ee653f5
Format
munechika-koyo Dec 16, 2025
2c641fe
Refactor Meson build configuration for al_defs.h and public headers
munechika-koyo Dec 18, 2025
06edbaf
Add include directories section to Meson build configuration
munechika-koyo Dec 18, 2025
613bf1a
Enhance Meson build configuration with warning flags and refactor sou…
munechika-koyo Dec 18, 2025
ab5bee6
Add MDSplus backend support in Meson build configuration
munechika-koyo Dec 18, 2025
aeff008
Add additional warning flags for Darwin in Meson build configuration
munechika-koyo Dec 18, 2025
b3c08f6
Refactor Meson build configuration to remove 'required' flag from dep…
munechika-koyo Dec 19, 2025
8e5ceb4
Remove '-Wno-switch' from warning flags in Meson build configuration
munechika-koyo Dec 19, 2025
829a2b7
Merge branch 'iterorganization:develop' into feature/meson
munechika-koyo Jan 20, 2026
b4170b6
Refactor Meson build configuration to use C++ for HDF5 dependency and…
munechika-koyo Feb 6, 2026
f5debf6
Update Meson build configuration to conditionally add C++ language su…
munechika-koyo Feb 6, 2026
c3894e0
Use find_program() func for python and git
munechika-koyo Feb 6, 2026
0599eed
Revert c/c++ std config
munechika-koyo Feb 9, 2026
5edba1e
Remove default warning flags from Meson build configuration
munechika-koyo Feb 9, 2026
d949a4f
Remove version specification from al_core library definition
munechika-koyo Feb 9, 2026
73a337b
Add 'fix_include_windows.h' to the list of installed public headers
munechika-koyo Feb 9, 2026
12344ba
fixed search numpy on SDCC
prasad-sawantdesai Feb 9, 2026
e7c37f0
Refactor numpy dependency handling in meson.build
munechika-koyo Feb 9, 2026
072346e
Migrate to cpp compile for cython transpile
munechika-koyo Feb 9, 2026
8456945
Refactor Python dependency handling in Meson build configuration
munechika-koyo Feb 9, 2026
a71d1d4
Merge branch 'feature/meson' into pr-10
munechika-koyo Feb 10, 2026
8cd89a1
Merge pull request #1 from prasad-sawantdesai/pr-10
munechika-koyo Feb 10, 2026
39a37d1
Update installation documentation to include Meson build system instr…
munechika-koyo Mar 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 69 additions & 12 deletions docs/source/user_guide/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To install IMAS-Core via pip for Python users:
Requirements
~~~~~~~~~~~~

- **Python 3.8+**
- **Python 3.8+**
- **Linux** (fully supported)
- **macOS and Windows** (experimental - in testing)

Expand Down Expand Up @@ -60,9 +60,9 @@ The following dependencies are only required for some of the components:
- **UDA backend**: `UDA <https://github.com/ukaea/UDA/>`__ libraries
(2.7.5 or newer) [#uda_install]_

.. [#uda_install] When installing UDA, make sure you have
.. [#uda_install] When installing UDA, make sure you have
`Cap'n'Proto <https://github.com/capnproto/capnproto>`__ installed in your system
and add its support by adding the CMake switch `-DENABLE_CAPNP=ON` when configuring UDA.
and add its support by adding the CMake switch `-DENABLE_CAPNP=ON` when configuring UDA.


Standard environments:
Expand Down Expand Up @@ -119,10 +119,10 @@ overview of configuration options.
cd IMAS-Core
cmake -B build -D CMAKE_INSTALL_PREFIX=$HOME/install -D OPTION1=VALUE1 -D OPTION2=VALUE2 [...]

.. note::
.. note::

CMake will automatically fetch dependencies from required repositories
for you.
for you.

- `data-dictionary (git@github.com:iterorganization/IMAS-Data-Dictionary.git)
<https://github.com/iterorganization/IMAS-Data-Dictionary>`__
Expand All @@ -131,7 +131,7 @@ overview of configuration options.
repository or to use a HTTPS URL instead of the default SSH URLs, you can update the
:ref:`configuration options`. For example, add the following options to your
``cmake`` command to download the repositories over HTTPS instead of SSH:

.. code-block:: text
:caption: Use explicit options to download dependent repositories over HTTPS

Expand Down Expand Up @@ -222,7 +222,7 @@ Configuration options

When ``AL_DOWNLOAD_DEPENDENCIES`` is enabled, the following settings can be used to
configure the location and/or version of the dependencies that should be used.

- ``AL_CORE_GIT_REPOSITORY``,
, ``DD_GIT_REPOSITORY``. Configure the git URLs
where the ``IMAS-Core`` c.q.
Expand Down Expand Up @@ -276,7 +276,7 @@ available configuration options, use the command-line tool ``ccmake`` or the gui
Build the IMAS-Core
~~~~~~~~~~~~~~~~~~~

Use ``cmake`` to build as shown below.
Use ``cmake`` to build as shown below.

.. code-block:: bash

Expand Down Expand Up @@ -359,9 +359,66 @@ can be passed using this method. The option names remain the same, but are prefi
``-C skbuild.cmake.define.``.


Optional: Build IMAS-Core with Meson
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can also build and install IMAS-Core using the Meson build system as an alternative to CMake. This can be useful for users who prefer Meson or want to try a different build workflow.

First, ensure you have Meson and Ninja installed. You can install them with pip:

.. code-block:: bash

pip install meson ninja

Then, clone the IMAS-Core repository if you haven't already:

.. code-block:: bash

git clone git@github.com:iterorganization/IMAS-Core.git
cd IMAS-Core

Create a build directory and configure the project:

.. code-block:: bash

meson setup builddir

You can pass Meson options at this step. For example, to enable or disable backends:

.. code-block:: bash

meson setup builddir -Dal_backend_hdf5=true -Dal_backend_uda=false

To see all available options, run:

.. code-block:: bash

meson configure builddir

Build the project:

.. code-block:: bash

meson compile -C builddir

Install IMAS-Core (you may need sudo for system-wide installs):

.. code-block:: bash

meson install -C builddir

You can also run tests using Meson:

.. code-block:: bash

meson test -C builddir

For more information on Meson, see the official documentation: https://mesonbuild.com/


Optional: Test the IMAS-Core
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Following snippet shows how to run the test with pytest. Just ensure that you have
Following snippet shows how to run the test with pytest. Just ensure that you have
AL_PYTHON_BINDINGS-ON in cmake configuration.
If you set either of the options ``AL_EXAMPLES`` or ``AL_TESTS`` to ``ON``, you can run
the corresponding test programs as follows:
Expand All @@ -371,7 +428,7 @@ the corresponding test programs as follows:
python3 -m venv build/pip_install
source build/pip_install/bin/activate
pip install --upgrade pip wheel
pip install numpy
pip install numpy
set -x
pip install --find-links=build/dist imas-core[test,cov]
pytest --junitxml results.xml --cov imas_core --cov-report xml --cov-report html
Expand All @@ -393,7 +450,7 @@ Access Layer. To help you with this, a file ``al_env.sh`` is installed. You can
You may want to add this to your ``$HOME/.bashrc`` file to automatically make the IMAS-Core
installation available for you.

.. note::
.. note::

To use a ``public`` dataset, you also need to set the ``IMAS_HOME`` environment
variable. For example, on SDCC, this would be ``export IMAS_HOME=/work/imas``.
Expand All @@ -406,7 +463,7 @@ You may want to add this to your ``$HOME/.bashrc`` file to automatically make th
Once you have set the required environment variables, you may continue Using the
IMAS-Core.

If IMAS-Core is built with Python bindings, you can also use the Python bindings with imas-python.
If IMAS-Core is built with Python bindings, you can also use the Python bindings with imas-python.
`imas_python <https://pypi.org/project/imas-python/>`_. Just install with `pip install imas-python`
and you can use the Python bindings. more information is here `imas-python <https://imas-python.readthedocs.io/en/latest/>`_.

Expand Down
44 changes: 44 additions & 0 deletions include/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# =============================================================================
# Configuration Data for al_defs.h
# =============================================================================

cdata = configuration_data()

# Version information
cdata.set('PROJECT_VERSION', meson.project_version())

# Generate Config Headers
al_defs_h = configure_file(
input: 'al_defs.h.in',
output: 'al_defs.h',
configuration: cdata,
)

install_headers(al_defs_h, subdir: 'al_core')

# =============================================================================
# Install Public Headers
# =============================================================================

install_headers(
'access_layer_base_plugin.h',
'access_layer_plugin.h',
'access_layer_plugin_manager.h',
'al_backend.h',
'al_const.h',
'al_context.h',
'al_exception.h',
'al_lowlevel.h',
'data_interpolation.h',
'extended_access_layer_plugin.h',
'fix_include_windows.h',
'provenance_plugin_feature.h',
'readback_plugin_feature.h',
'uri_parser.h',
subdir: 'al_core',
)

# =============================================================================
# Include Directories
# =============================================================================
public_inc = include_directories('.')
119 changes: 119 additions & 0 deletions meson.build
Copy link
Collaborator

@prasad-sawantdesai prasad-sawantdesai Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be listed after the subsection "Install from source using pip"?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, Thanks

Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
project(
'imas-core',
'cpp',
license: 'LGPL-3.0-or-later',
meson_version: '>=1.1.0',
version: run_command(
find_program('python3'),
'-m', 'setuptools_scm',
'--strip-dev',
check: true,
).stdout().strip(),
default_options: [
'cpp_std=c++17',
'buildtype=debugoptimized',
],
)

# =============================================================================
# Compiler and System Setup
# =============================================================================
cxx = meson.get_compiler('cpp')
host_system = host_machine.system()
host_cpu = host_machine.cpu_family()

# =============================================================================
# Warning Flags
# =============================================================================
warning_flags = []
if host_system == 'darwin'
warning_flags += [
'-Wno-deprecated-declarations',
'-Wno-inconsistent-missing-override',
'-Wno-delete-non-abstract-non-virtual-dtor',
'-Wno-unused-but-set-variable',
'-Wno-unused-variable',
'-Wno-misleading-indentation',
'-Wno-reorder-ctor',
'-Wno-pessimizing-move',
'-Wno-sometimes-uninitialized',
]
endif

# =============================================================================
# Access Layer core (al-core) Library
# =============================================================================
if get_option('al_core')
subdir('include')
subdir('src')
else
# Use external al-core installation
al_core_dep = dependency('al-core')
endif

# =============================================================================
# Dummy Executable for version printing
# =============================================================================
if get_option('al_dummy_exe')
imas_print_version = executable(
'imas_print_version',
'tests/imas_print_version.cpp',
dependencies: [al_core_dep],
install: true,
)
test('imas_print_version_test', imas_print_version)
endif

# =============================================================================
# Test Low-level C API (al-core)
# =============================================================================
if get_option('al_test')
# subdir('tests') # TODO: fix test sources
endif

# =============================================================================
# Python Bindings (imas-core)
# =============================================================================
if get_option('python_bindings')
subdir('python')
endif

# =============================================================================
# MDSplus Models
# =============================================================================
if get_option('mdsplus_models')
warning('MDSplus models are not yet supported in Meson build system.')
# subdir('models/mdsplus')
endif

# =============================================================================
# Summary
# =============================================================================
if get_option('al_core')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add github workflow for testing meson build?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

summary(
{
'HDF5': get_option('al_backend_hdf5'),
'UDA': get_option('al_backend_uda'),
'MDSplus': get_option('al_backend_mdsplus'),
},
section: 'Backends',
)
summary(
{
'Core Arguments': core_args,
'Warning Flags': warning_flags,
},
section: 'Compiler Arguments',
)
endif

if get_option('python_bindings')
summary(
{
'Python Version': py.language_version(),
'Buildtime Python Path': py.full_path(),
'Cython Arguments': cython_args,
},
section: 'Python Bindings',
)
endif
70 changes: 70 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# =============================================================================
# Libraries to build
# =============================================================================

option(
'al_core',
type: 'boolean',
value: true,
description: 'Build internal core library, or use external installation',
)

option(
'al_dummy_exe',
type: 'boolean',
value: false,
description: 'Build dummy executable that prints version information.',
)

option(
'al_test',
type: 'boolean',
value: false,
description: 'Build tests for al-core library',
)

option(
'python_bindings',
type: 'boolean',
value: true,
description: 'Build Python wrapper',
)

option(
'mdsplus_models',
type: 'boolean',
value: false,
description: 'Build MDSplus models (requires MDSplus installation)',
)

# =============================================================================
# Backends Options
# =============================================================================

option(
'al_backend_hdf5',
type: 'boolean',
value: true,
description: 'Enable HDF5 backend',
)

option(
'al_backend_mdsplus',
type: 'boolean',
value: false,
description: 'Enable MDSplus backend',
)

option(
'al_backend_uda',
type: 'boolean',
value: true,
description: 'Enable UDA backend',
)

option(
'uda_fat',
type: 'boolean',
value: false,
description: 'Use UDA FAT client libraries',
)
Loading