Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 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
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
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?

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?

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',
)
31 changes: 31 additions & 0 deletions python/_version.py.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
__all__ = [
"__version__",
"__version_tuple__",
"version",
"version_tuple",
"__commit_id__",
"commit_id",
]

TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Tuple
from typing import Union

VERSION_TUPLE = Tuple[Union[int, str], ...]
COMMIT_ID = Union[str, None]
else:
VERSION_TUPLE = object
COMMIT_ID = object

version: str
__version__: str
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE
commit_id: COMMIT_ID
__commit_id__: COMMIT_ID

__version__ = version = "@VERSION@"
__version_tuple__ = version_tuple = @VERSION_TUPLE@

__commit_id__ = commit_id = "@COMMIT_ID@"
105 changes: 105 additions & 0 deletions python/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
add_languages('cython', native: false)

# =============================================================================
# Version File
# =============================================================================
# Get version using setuptools-scm
version = run_command(
find_program('python3'),
'-m', 'setuptools_scm',
check: true,
).stdout().strip()

# Create tuple: split version like "5.5.2", ignoring dirty suffix etc.
split_ver = version.split('.')
ver_tuple = '(@0@, @1@, @2@)'.format(
split_ver[0],
split_ver[1],
split_ver[2],
)

# Get commit id
git_commit = run_command(
find_program('git'),
'rev-parse',
'--short', 'HEAD',
check: false,
).stdout().strip()

if git_commit == ''
git_commit = 'None'
endif

# Generate _version.py
version_file = configure_file(
input: '_version.py.in',
output: '_version.py',
configuration: {
'VERSION': version,
'VERSION_TUPLE': ver_tuple,
'COMMIT_ID': git_commit,
},
)

# =============================================================================
# Modules and Dependencies
# =============================================================================
fs = import('fs')
py = import('python').find_installation(pure: false)
py_dep = py.dependency()
numpy_dep = dependency('numpy', required: false)

if not numpy_dep.found()
# Get numpy include directory and library using Python
_incdic_numpy_abs = run_command(
py,
'-c', 'import numpy; print(numpy.get_include())',
check: true,
).stdout().strip()

# Create numpy dependency using include directory
numpy_dep = declare_dependency(
include_directories: include_directories(_incdic_numpy_abs),
)
endif

cython_args = ['--annotate']

# =============================================================================
# Source files
# =============================================================================
py_files = files(
'imas_core/__init__.py',
'imas_core/exception.py',
'imas_core/imasdef.py',
)
pyx_files = files(
'imas_core/_al_lowlevel.pyx',
'imas_core/al_defs.pyx',
)
pxd_files = files(
'imas_core/al_defs.pxd',
'imas_core/al_lowlevel_interface.pxd',
)

# =============================================================================
# Build Python Extension Module
# =============================================================================
# compile cython
foreach pyx_file : pyx_files
py.extension_module(
fs.stem(pyx_file),
pyx_file,
cython_args: cython_args,
dependencies: [al_core_dep, py_dep, numpy_dep],
install: true,
subdir: 'imas_core',
override_options: ['cython_language=cpp'],
)
endforeach

# Install pure python files
py.install_sources(
py_files + pxd_files + version_file,
subdir: 'imas_core',
)
Loading
Loading