From 04eaf70e19a1cf743b9e0f71b20f3b578986e063 Mon Sep 17 00:00:00 2001 From: ogiorgis Date: Mon, 18 Dec 2023 16:52:35 +0100 Subject: [PATCH] WIP: test with transonic meson backend --- .gitlab-ci.yml | 2 ++ fluidsim/base/time_stepping/meson.build | 28 ++++++++++++------------- pyproject.toml | 12 +++++++++-- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e3fa827f..f57782f0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,8 @@ variables: tests: image: fluiddyn/python3-stable:lastest + before-script: + - apt-get install -y mercurial script: - pip install -U pip tox --user - tox -e py39,py39-fft,codecov diff --git a/fluidsim/base/time_stepping/meson.build b/fluidsim/base/time_stepping/meson.build index 2248e2bf..14ad57d9 100644 --- a/fluidsim/base/time_stepping/meson.build +++ b/fluidsim/base/time_stepping/meson.build @@ -6,19 +6,19 @@ python_sources = [ 'simple.py', ] -# backend = get_option('deps_backend') -# if backend == 'pythran' -# pythran = find_program('pythran', native: true) -# # run_command(['transonic', '--meson', 'pseudo_spect.py'], check: true) -# # or -# # run_command(['transonic', 'pseudo_spect.py', '-af', '"-march=native -DUSE_XSIMD -Ofast"']) -# # run_command( -# # [ -# # 'pythran', '-E', join_paths(meson.current_source_dir(), '__pythran__', 'pseudo_spect.py'), -# # '-o', join_paths(meson.current_source_dir(), '__pythran__', 'pseudo_spect.cpp') -# # ] -# # ) -# endif +backend = get_option('deps_backend') +if backend == 'pythran' + pythran = find_program('pythran', native: true) + run_command(['transonic', '--meson', 'pseudo_spect.py'], check: true) + # # or + # run_command(['transonic', 'pseudo_spect.py', '-af', '"-march=native -DUSE_XSIMD -Ofast"'], check: true) + # run_command( + # [ + # 'pythran', '-E', join_paths(meson.current_source_dir(), '__pythran__', 'pseudo_spect.py'), + # '-o', join_paths(meson.current_source_dir(), '__pythran__', 'pseudo_spect.cpp') + # ] + # ) +endif py3.install_sources( python_sources, @@ -26,4 +26,4 @@ py3.install_sources( subdir: 'fluidsim/base/time_stepping' ) -#subdir('__pythran__') +subdir('__pythran__') diff --git a/pyproject.toml b/pyproject.toml index ff8f81f9..a834a0b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,15 @@ [build-system] # Further build requirements - like pythran and mpi4py - come from setup.py via # the PEP 517 interface. -requires = [ "meson-python>=0.15.0", "wheel", "numpy", "transonic", "pythran>=0.9.7", "cython", "setuptools"] +requires = [ + "meson-python>=0.15.0", + "wheel", + "numpy", + "transonic@hg+https://foss.heptapod.net/fluiddyn/transonic@d169e827c66c", + "pythran>=0.9.7", + "cython", + "setuptools", + ] build-backend = 'mesonpy' [project] @@ -21,7 +29,7 @@ dependencies = [ "fluidsim-core>=0.7.4", "h5py", "h5netcdf", - "transonic@hg+https://foss.heptapod.net/fluiddyn/transonic", + "transonic@hg+https://foss.heptapod.net/fluiddyn/transonic@d169e827c66c", "xarray", "rich", "matplotlib>=3.3",