-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
253 additions
and
437 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,6 +113,7 @@ output/ | |
# Transonic | ||
__pythran__ | ||
__numba__ | ||
__python__ | ||
|
||
# PDM | ||
.pdm-python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,9 @@ lock: | |
|
||
test: | ||
pdm test | ||
|
||
build_doc: | ||
nox -s doc -R | ||
|
||
test_in_nox_env: | ||
nox -s test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
project( | ||
'pylandstats', | ||
'cpp', | ||
license: 'GPL-3.0-or-later', | ||
meson_version: '>= 1.1.0', | ||
default_options: [ | ||
'buildtype=release', | ||
'cpp_std=c++11', | ||
], | ||
) | ||
|
||
# https://mesonbuild.com/Python-module.html | ||
py_mod = import('python') | ||
py = py_mod.find_installation('python3', pure: false) | ||
py_dep = py.dependency() | ||
|
||
backend = get_option('transonic-backend') | ||
|
||
if backend.contains(',') | ||
backends = backend.split(',') | ||
else | ||
backends = [backend] | ||
endif | ||
|
||
use_pythran = backend.contains('pythran') | ||
if use_pythran | ||
incdir_numpy = run_command('transonic-get-include', 'numpy', check: true).stdout().strip() | ||
inc_np = include_directories(incdir_numpy) | ||
np_dep = declare_dependency(include_directories: inc_np) | ||
|
||
incdir_pythran = run_command('transonic-get-include', 'pythran', check: true).stdout().strip() | ||
pythran = find_program('pythran', native: true) | ||
|
||
cpp_args_pythran = [ | ||
'-DENABLE_PYTHON_MODULE', | ||
'-D__PYTHRAN__=3', | ||
'-DPYTHRAN_BLAS_NONE' | ||
] | ||
|
||
if get_option('use-xsimd') == true | ||
# xsimd is unvendored from pythran by conda-forge, and due to a compiler | ||
# activation bug the default <prefix>/include/ may not be visible (see | ||
# gh-15698). Hence look for xsimd explicitly. | ||
xsimd_dep = dependency('xsimd', required: false) | ||
pythran_dep = declare_dependency( | ||
include_directories: incdir_pythran, | ||
dependencies: xsimd_dep, | ||
) | ||
cpp_args_pythran += ['-DUSE_XSIMD'] | ||
else | ||
pythran_dep = declare_dependency( | ||
include_directories: incdir_pythran, | ||
) | ||
endif | ||
|
||
pythran_complex_hook = get_option('pythran-complex-hook') | ||
if pythran_complex_hook == 'os-dependent' | ||
pythran_complex_hook = host_machine.system() == 'linux' | ||
endif | ||
|
||
if get_option('native') | ||
cpp_args_pythran += ['-march=native', '-Ofast'] | ||
endif | ||
|
||
endif | ||
|
||
subdir('pylandstats') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
option( | ||
'transonic-backend', | ||
type: 'string', | ||
value: 'pythran,python,numba', | ||
description: | ||
'pythran,python,numba (default), cython, numpy, numba; ' + | ||
'or comma separated value representing multi-backends', | ||
) | ||
option( | ||
'native', | ||
type: 'boolean', | ||
value: false, | ||
description: 'Performance oriented and not portable build', | ||
) | ||
option( | ||
'use-xsimd', | ||
type: 'boolean', | ||
value: true, | ||
description: 'Turns on xsimd vectorization', | ||
) | ||
option( | ||
'pythran-complex-hook', | ||
type: 'combo', | ||
choices: ['os-dependent', 'true', 'false'], | ||
value: 'os-dependent', | ||
description: 'Pythran complex_hook option', | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.