Skip to content

BLD Use work-around for partial recompilation when building with Meson #29140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion sklearn/_loss/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ _loss_pyx = custom_target(
output: '_loss.pyx',
input: '_loss.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
depends: _loss_cython_tree,
)

py.extension_module(
'_loss',
[_loss_pyx, _loss_cython_tree],
_loss_pyx,
cython_args: cython_args,
install: true,
subdir: 'sklearn/_loss',
Expand Down
8 changes: 6 additions & 2 deletions sklearn/linear_model/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ foreach name: name_list
name + '_pyx',
output: name + '.pyx',
input: name + '.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@']
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
depends: [linear_model_cython_tree, utils_cython_tree],
)
py.extension_module(
name,
[pyx, linear_model_cython_tree, utils_cython_tree],
pyx,
cython_args: cython_args,
subdir: 'sklearn/linear_model',
install: true
Expand Down
72 changes: 49 additions & 23 deletions sklearn/metrics/_pairwise_distances_reduction/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ _datasets_pair_pyx = custom_target(
output: '_datasets_pair.pyx',
input: '_datasets_pair.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
depends: [_datasets_pair_pxd, _pairwise_distances_reduction_cython_tree, utils_cython_tree],
)
_datasets_pair = py.extension_module(
'_datasets_pair',
[_datasets_pair_pxd, _datasets_pair_pyx,
_pairwise_distances_reduction_cython_tree, utils_cython_tree],
_datasets_pair_pyx,
dependencies: [np_dep, openmp_dep],
override_options: ['cython_language=cpp'],
cython_args: cython_args,
Expand All @@ -54,12 +57,15 @@ _base_pyx = custom_target(
output: '_base.pyx',
input: '_base.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
depends: [_base_pxd, _pairwise_distances_reduction_cython_tree,
_datasets_pair_pxd, utils_cython_tree],
)
_base = py.extension_module(
'_base',
[_base_pxd, _base_pyx,
_pairwise_distances_reduction_cython_tree,
_datasets_pair_pxd, utils_cython_tree],
_base_pyx,
dependencies: [np_dep, openmp_dep],
override_options: ['cython_language=cpp'],
cython_args: cython_args,
Expand All @@ -78,11 +84,16 @@ _middle_term_computer_pyx = custom_target(
output: '_middle_term_computer.pyx',
input: '_middle_term_computer.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
depends: [_middle_term_computer_pxd,
_pairwise_distances_reduction_cython_tree,
utils_cython_tree],
)
_middle_term_computer = py.extension_module(
'_middle_term_computer',
[_middle_term_computer_pxd, _middle_term_computer_pyx,
_pairwise_distances_reduction_cython_tree, utils_cython_tree],
_middle_term_computer_pyx,
dependencies: [np_dep, openmp_dep],
override_options: ['cython_language=cpp'],
cython_args: cython_args,
Expand All @@ -101,13 +112,16 @@ _argkmin_pyx = custom_target(
output: '_argkmin.pyx',
input: '_argkmin.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
)
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
depends: [_argkmin_pxd,
_pairwise_distances_reduction_cython_tree,
_datasets_pair_pxd, _base_pxd, _middle_term_computer_pxd],
)
_argkmin = py.extension_module(
'_argkmin',
[_argkmin_pxd, _argkmin_pyx,
_pairwise_distances_reduction_cython_tree,
_datasets_pair_pxd, _base_pxd, _middle_term_computer_pxd,
utils_cython_tree],
_argkmin_pyx,
dependencies: [np_dep, openmp_dep],
override_options: ['cython_language=cpp'],
cython_args: cython_args,
Expand All @@ -126,12 +140,16 @@ _radius_neighbors_pyx = custom_target(
output: '_radius_neighbors.pyx',
input: '_radius_neighbors.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
)
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
depends: [_radius_neighbors_pxd,
_datasets_pair_pxd, _base_pxd, _middle_term_computer_pxd,
_pairwise_distances_reduction_cython_tree, utils_cython_tree],
)
_radius_neighbors = py.extension_module(
'_radius_neighbors',
[_radius_neighbors_pxd, _radius_neighbors_pyx,
_datasets_pair_pxd, _base_pxd, _middle_term_computer_pxd,
_pairwise_distances_reduction_cython_tree, utils_cython_tree],
_radius_neighbors_pyx,
dependencies: [np_dep, openmp_dep],
override_options: ['cython_language=cpp'],
cython_args: cython_args,
Expand All @@ -144,12 +162,16 @@ _argkmin_classmode_pyx = custom_target(
output: '_argkmin_classmode.pyx',
input: '_argkmin_classmode.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
depends: [_classmode_pxd,
_argkmin_pxd, _pairwise_distances_reduction_cython_tree,
_datasets_pair_pxd, _base_pxd, _middle_term_computer_pxd, utils_cython_tree],
)
_argkmin_classmode = py.extension_module(
'_argkmin_classmode',
[_argkmin_classmode_pyx, _classmode_pxd,
_argkmin_pxd, _pairwise_distances_reduction_cython_tree,
_datasets_pair_pxd, _base_pxd, _middle_term_computer_pxd, utils_cython_tree],
_argkmin_classmode_pyx,
dependencies: [np_dep],
override_options: ['cython_language=cpp'],
cython_args: cython_args,
Expand All @@ -166,13 +188,17 @@ _radius_neighbors_classmode_pyx = custom_target(
output: '_radius_neighbors_classmode.pyx',
input: '_radius_neighbors_classmode.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
depends: [_classmode_pxd,
_middle_term_computer_pxd, _radius_neighbors_pxd,
_pairwise_distances_reduction_cython_tree,
_datasets_pair_pxd, _base_pxd, utils_cython_tree],
)
_radius_neighbors_classmode = py.extension_module(
'_radius_neighbors_classmode',
[_radius_neighbors_classmode_pyx, _classmode_pxd,
_middle_term_computer_pxd, _radius_neighbors_pxd,
_pairwise_distances_reduction_cython_tree,
_datasets_pair_pxd, _base_pxd, utils_cython_tree],
_radius_neighbors_classmode_pyx,
dependencies: [np_dep],
override_options: ['cython_language=cpp'],
cython_args: cython_args,
Expand Down
8 changes: 6 additions & 2 deletions sklearn/metrics/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,16 @@ _dist_metrics_pyx = custom_target(
'_dist_metrics_pyx',
output: '_dist_metrics.pyx',
input: '_dist_metrics.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@']
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
depends: metrics_cython_tree,
)

_dist_metrics = py.extension_module(
'_dist_metrics',
[_dist_metrics_pyx, metrics_cython_tree],
_dist_metrics_pyx,
dependencies: [np_dep],
cython_args: cython_args,
subdir: 'sklearn/metrics',
Expand Down
8 changes: 6 additions & 2 deletions sklearn/neighbors/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ foreach name: name_list
name + '_pyx',
output: name + '.pyx',
input: name + '.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@']
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
depends: [neighbors_cython_tree, utils_cython_tree, metrics_cython_tree],
)
py.extension_module(
name,
[pyx, neighbors_cython_tree, utils_cython_tree, metrics_cython_tree],
pyx,
dependencies: [np_dep],
cython_args: cython_args,
subdir: 'sklearn/neighbors',
Expand Down
8 changes: 6 additions & 2 deletions sklearn/utils/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,15 @@ foreach name: util_extension_names
name + '_pyx',
output: name + '.pyx',
input: name + '.pyx.tp',
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@']
command: [py, tempita, '@INPUT@', '-o', '@OUTDIR@'],
# TODO in principle this should go in py.exension_module below. This is
# temporary work-around for dependency issue with .pyx.tp files. For more
# details, see https://github.com/mesonbuild/meson/issues/13212
depends: [pxd, utils_cython_tree],
)
py.extension_module(
name,
[pxd, pyx, utils_cython_tree],
pyx,
cython_args: cython_args,
subdir: 'sklearn/utils',
install: true
Expand Down
Loading