File: meson.build

package info (click to toggle)
scikit-learn 1.7.2%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,752 kB
  • sloc: python: 219,120; cpp: 5,790; ansic: 846; makefile: 191; javascript: 110
file content (75 lines) | stat: -rw-r--r-- 2,575 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# utils is cimported from other subpackages so this is needed for the cimport
# to work
utils_cython_tree = [
  # We add sklearn_root_cython_tree to make sure sklearn/__init__.py is copied
  # early in the build
  sklearn_root_cython_tree,
  fs.copyfile('__init__.py'),
  fs.copyfile('_cython_blas.pxd'),
  fs.copyfile('_heap.pxd'),
  fs.copyfile('_openmp_helpers.pxd'),
  fs.copyfile('_random.pxd'),
  fs.copyfile('_sorting.pxd'),
  fs.copyfile('_typedefs.pxd'),
  fs.copyfile('_vector_sentinel.pxd'),
]

utils_extension_metadata = {
  'sparsefuncs_fast':
    {'sources': [cython_gen.process('sparsefuncs_fast.pyx')]},
  '_cython_blas': {'sources': [cython_gen.process('_cython_blas.pyx')]},
  'arrayfuncs': {'sources': [cython_gen.process('arrayfuncs.pyx')]},
  'murmurhash': {
      'sources': [cython_gen.process('murmurhash.pyx'), 'src' / 'MurmurHash3.cpp'],
  },
  '_fast_dict':
    {'sources': [cython_gen_cpp.process('_fast_dict.pyx')]},
  '_openmp_helpers': {'sources': [cython_gen.process('_openmp_helpers.pyx')], 'dependencies': [openmp_dep]},
  '_random': {'sources': [cython_gen.process('_random.pyx')]},
  '_typedefs': {'sources': [cython_gen.process('_typedefs.pyx')]},
  '_heap': {'sources': [cython_gen.process('_heap.pyx')]},
  '_sorting': {'sources': [cython_gen.process('_sorting.pyx')]},
  '_vector_sentinel':
    {'sources': [cython_gen_cpp.process('_vector_sentinel.pyx')],
     'dependencies': [np_dep]},
  '_isfinite': {'sources': [cython_gen.process('_isfinite.pyx')]},
}

foreach ext_name, ext_dict : utils_extension_metadata
  py.extension_module(
    ext_name,
    [ext_dict.get('sources'), utils_cython_tree],
    dependencies: ext_dict.get('dependencies', []),
    subdir: 'sklearn/utils',
    install: true
  )
endforeach

util_extension_names = ['_seq_dataset', '_weight_vector']

foreach name: util_extension_names
  pxd = custom_target(
    name + '_pxd',
    output: name + '.pxd',
    input: name + '.pxd.tp',
    command: [tempita, '@INPUT@', '-o', '@OUTDIR@'],
  )
  utils_cython_tree += [pxd]

  pyx = custom_target(
    name + '_pyx',
    output: name + '.pyx',
    input: name + '.pyx.tp',
    command: [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,
    cython_gen.process(pyx),
    subdir: 'sklearn/utils',
    install: true
   )
endforeach