Skip to content

Commit

Permalink
WIP transonic with pythran
Browse files Browse the repository at this point in the history
  • Loading branch information
ogiorgis committed Dec 15, 2023
1 parent c29738c commit 300fbeb
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
25 changes: 25 additions & 0 deletions fluidsim/base/time_stepping/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,31 @@ python_sources = [
'simple.py',
]

backend = get_option('deps_backend')
if backend == 'pythran'
pythran = find_program('pythran', native: true)
run_command(['transonic', '-b', 'pythran', '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')
]
)
# _pseudo_spect_pythran = custom_target(
# 'pseudo_spect_pythran',
# output: ['pseudo_spect.cpp'],
# input: 'pseudo_spect.py',
# #command: ['transonic', '@INPUT@', '-af', '-march=native -DUSE_XSIMD -Ofast']
# command: [pythran, '-E', join_paths(meson.current_source_dir(), '__pythran__', 'pseudo_spect.py')]
# )

# _pseudo_spect_pythran = py3.extension_module(
# 'pseudo_spect',
# _pseudo_spect_pythran,
# install: true,
# subdir: 'fluidsim/base/time_stepping',
# )
endif

py3.install_sources(
python_sources,
pure: false,
Expand Down
4 changes: 3 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
project(
'fluidsim',
'cpp',
version: '0.7.4',
license: 'CeCILL',
meson_version: '>= 1.1.0',
Expand All @@ -12,6 +13,7 @@ project(

# https://mesonbuild.com/Python-module.html
py_mod = import('python')
py3 = py_mod.find_installation(pure: false)
py3 = py_mod.find_installation('python3')
py3_dep = py3.dependency()

subdir('fluidsim')
1 change: 1 addition & 0 deletions meson.options
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
option('deps_backend', type: 'string', value: 'pythran', description: 'pythran(default), cython, numpy, numba')
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[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"]
requires = [ "meson-python>=0.15.0", "wheel", "numpy", "transonic", "pythran>=0.9.7", "cython", "setuptools"]
build-backend = 'mesonpy'

[project]
Expand Down

0 comments on commit 300fbeb

Please sign in to comment.