Skip to content

Commit e3b9006

Browse files
authored
update meson files
1 parent 3b1c99d commit e3b9006

File tree

113 files changed

+2223
-1497
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+2223
-1497
lines changed

meson.build

+13-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ project(
22
'SageMath',
33
['c', 'cpp', 'cython'],
44
version: files('src/VERSION.txt'),
5-
license: 'GPL v3'
5+
license: 'GPL v3',
66
)
77

88
# Python module
@@ -12,18 +12,21 @@ py = py_module.find_installation(pure: false)
1212
py_dep = py.dependency()
1313

1414
# Additional targets
15-
py_with_pytest = py_module.find_installation(required: false, modules: ['pytest'])
15+
py_with_pytest = py_module.find_installation(
16+
required: false,
17+
modules: ['pytest'],
18+
)
1619
if py_with_pytest.found()
1720
test(
18-
'pytest',
19-
py_with_pytest,
21+
'pytest',
22+
py_with_pytest,
2023
args: [
21-
'-m',
22-
'pytest',
23-
'-c',
24-
meson.current_source_dir() / 'tox.ini',
25-
'--doctest',
26-
meson.current_source_dir() / 'src' / 'sage' / 'categories'
24+
'-m',
25+
'pytest',
26+
'-c',
27+
meson.current_source_dir() / 'tox.ini',
28+
'--doctest',
29+
meson.current_source_dir() / 'src' / 'sage' / 'categories',
2730
],
2831
timeout: 0,
2932
)

meson.format

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
indent_by: ' '

src/meson.build

+68-59
Original file line numberDiff line numberDiff line change
@@ -4,89 +4,95 @@ cpp = meson.get_compiler('cpp')
44
cython = meson.get_compiler('cython')
55

66
# Setup dependencies that are needed by many modules
7-
inc_numpy = run_command(py,
8-
[
7+
inc_numpy = run_command(
8+
py,
9+
[
910
'-c',
1011
'''
1112
import numpy
1213
print(numpy.get_include())
13-
'''.strip()
14-
],
15-
check: true
16-
).stdout().strip()
17-
numpy = declare_dependency(
18-
include_directories: inc_numpy,
19-
)
14+
'''.strip(),
15+
],
16+
check: true,
17+
).stdout().strip()
18+
numpy = declare_dependency(include_directories: inc_numpy)
2019

21-
inc_cysignals = run_command(py,
22-
[
20+
inc_cysignals = run_command(
21+
py,
22+
[
2323
'-c',
2424
'''
2525
import cysignals
2626
print(cysignals.__file__.replace('__init__.py', ''))
27-
'''.strip()
28-
],
29-
check: true
30-
).stdout().strip()
31-
cysignals = declare_dependency(
32-
include_directories: inc_cysignals,
33-
)
27+
'''.strip(),
28+
],
29+
check: true,
30+
).stdout().strip()
31+
cysignals = declare_dependency(include_directories: inc_cysignals)
3432

35-
inc_gmpy2 = run_command(py,
36-
[
33+
inc_gmpy2 = run_command(
34+
py,
35+
[
3736
'-c',
3837
'''
3938
import gmpy2
4039
print(gmpy2.__file__.replace('__init__.py', ''))
41-
'''.strip()
42-
],
43-
check: true
44-
).stdout().strip()
45-
gmpy2 = declare_dependency(
46-
include_directories: inc_gmpy2,
47-
)
40+
'''.strip(),
41+
],
42+
check: true,
43+
).stdout().strip()
44+
gmpy2 = declare_dependency(include_directories: inc_gmpy2)
4845
gmp = dependency('gmp', required: true)
4946

50-
inc_cypari2 = run_command(py,
51-
[
47+
inc_cypari2 = run_command(
48+
py,
49+
[
5250
'-c',
5351
'''
5452
import cypari2
5553
print(cypari2.__file__.replace('__init__.py', ''))
56-
'''.strip()
57-
],
58-
check: true
59-
).stdout().strip()
60-
cypari2 = declare_dependency(
61-
include_directories: inc_cypari2,
62-
)
54+
'''.strip(),
55+
],
56+
check: true,
57+
).stdout().strip()
58+
cypari2 = declare_dependency(include_directories: inc_cypari2)
6359
pari = cc.find_library('pari')
6460

6561
mpfr = cc.find_library('mpfr')
6662

6763
# Once https://github.com/mesonbuild/meson/pull/12616 is released, we can simply do the following:
6864
# flint = dependency('flint', version : '>=3.0.0')
69-
flint = dependency('flint', version : '>=3.0.0', required: false, allow_fallback: false)
65+
flint = dependency(
66+
'flint',
67+
version: '>=3.0.0',
68+
required: false,
69+
allow_fallback: false,
70+
)
7071
if not flint.found()
71-
flint = subproject('flint').get_variable('flint_dep')
72+
flint = subproject('flint').get_variable('flint_dep')
7273
else
73-
# Currently the flint pkg-config file is broken, so we manually use find_library
74-
# Can be removed once we require a version of flint that ships https://github.com/flintlib/flint/pull/1647
75-
flint = cc.find_library('flint')
74+
# Currently the flint pkg-config file is broken, so we manually use find_library
75+
# Can be removed once we require a version of flint that ships https://github.com/flintlib/flint/pull/1647
76+
flint = cc.find_library('flint')
7677
endif
7778

7879
blas_order = []
7980
if host_machine.system() == 'darwin'
80-
blas_order += 'accelerate'
81+
blas_order += 'accelerate'
8182
endif
8283
if host_machine.cpu_family() == 'x86_64'
83-
blas_order += 'mkl'
84+
blas_order += 'mkl'
8485
endif
8586
# pkg-config uses a lower-case name while CMake uses a capitalized name, so try
8687
# that too to make the fallback detection with CMake work
8788
blas_order += ['cblas', 'openblas', 'OpenBLAS', 'flexiblas', 'blis', 'blas']
8889
blas = dependency(blas_order)
89-
gsl = dependency('gsl', fallback: ['gsl', 'gsl_dep'], version : '>=2.5', required: true)
90+
gsl = dependency(
91+
'gsl',
92+
fallback: ['gsl', 'gsl_dep'],
93+
version: '>=2.5',
94+
required: true,
95+
)
9096
gd = cc.find_library('gd')
9197
iml = cc.find_library('iml')
9298
m = cc.find_library('m')
@@ -110,7 +116,7 @@ fplll = dependency('fplll')
110116
givaro = cc.find_library('givaro')
111117
linbox = dependency('linbox', required: false)
112118
if not linbox.found()
113-
linbox = cc.find_library('linbox')
119+
linbox = cc.find_library('linbox')
114120
endif
115121
braiding = cc.find_library('braiding')
116122
gc = cc.find_library('gc')
@@ -122,7 +128,7 @@ mpc = cc.find_library('mpc')
122128
# Test for common.h header that was added in 4.12 as a indirect version check
123129
gap = cc.find_library('gap', has_headers: ['gap/common.h'], required: false)
124130
if not gap.found()
125-
gap = subproject('gap').get_variable('gap_dep')
131+
gap = subproject('gap').get_variable('gap_dep')
126132
endif
127133

128134
singular = dependency('Singular')
@@ -135,22 +141,25 @@ ntl = cc.find_library('ntl', required: true)
135141
# Meson currently ignores include_directories for Cython modules, so we
136142
# have to add them manually.
137143
# https://github.com/mesonbuild/meson/issues/9562
138-
add_project_arguments('-I', meson.current_source_dir(), language : 'cython')
139-
add_project_arguments('-I', meson.current_build_dir(), language : 'cython')
144+
add_project_arguments('-I', meson.current_source_dir(), language: 'cython')
145+
add_project_arguments('-I', meson.current_build_dir(), language: 'cython')
140146

141147
# Add global compiler flags
142-
add_project_arguments('-X auto_pickle=False', language : 'cython')
143-
add_project_arguments('-X autotestdict=False', language : 'cython')
144-
add_project_arguments('-X binding=False', language : 'cython')
145-
add_project_arguments('-X c_api_binop_methods=True', language : 'cython')
146-
add_project_arguments('-X cdivision=True', language : 'cython')
147-
add_project_arguments('-X cpow=True', language : 'cython')
148-
add_project_arguments('-X embedsignature=True', language : 'cython')
149-
add_project_arguments('--embed-positions', language : 'cython')
150-
add_project_arguments('-X fast_getattr=True', language : 'cython')
148+
add_project_arguments('-X auto_pickle=False', language: 'cython')
149+
add_project_arguments('-X autotestdict=False', language: 'cython')
150+
add_project_arguments('-X binding=False', language: 'cython')
151+
add_project_arguments('-X c_api_binop_methods=True', language: 'cython')
152+
add_project_arguments('-X cdivision=True', language: 'cython')
153+
add_project_arguments('-X cpow=True', language: 'cython')
154+
add_project_arguments('-X embedsignature=True', language: 'cython')
155+
add_project_arguments('--embed-positions', language: 'cython')
156+
add_project_arguments('-X fast_getattr=True', language: 'cython')
151157
#add_project_arguments('-X language_level="3"', language : 'cython')
152-
add_project_arguments('-X legacy_implicit_noexcept=True', language : 'cython')
153-
add_project_arguments('-X preliminary_late_includes_cy28=True', language : 'cython')
158+
add_project_arguments('-X legacy_implicit_noexcept=True', language: 'cython')
159+
add_project_arguments(
160+
'-X preliminary_late_includes_cy28=True',
161+
language: 'cython',
162+
)
154163

155164
inc_cpython = include_directories('sage/cpython')
156165
inc_rings = include_directories('sage/rings')

src/sage/algebras/finite_dimensional_algebras/meson.build

+12-9
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,23 @@ py.install_sources(
44
'finite_dimensional_algebra_element.pxd',
55
'finite_dimensional_algebra_ideal.py',
66
'finite_dimensional_algebra_morphism.py',
7-
subdir : 'sage/algebras/finite_dimensional_algebras'
7+
subdir: 'sage/algebras/finite_dimensional_algebras',
88
)
99

1010
extension_data = {
11-
'finite_dimensional_algebra_element' : files('finite_dimensional_algebra_element.pyx')
11+
'finite_dimensional_algebra_element' : files(
12+
'finite_dimensional_algebra_element.pyx',
13+
),
1214
}
1315

1416
foreach name, pyx : extension_data
15-
py.extension_module(name,
16-
sources: pyx,
17-
subdir: 'sage/algebras/finite_dimensional_algebras',
18-
install: true,
19-
include_directories: [inc_cpython],
20-
dependencies: [py_dep, gmp],
21-
)
17+
py.extension_module(
18+
name,
19+
sources: pyx,
20+
subdir: 'sage/algebras/finite_dimensional_algebras',
21+
install: true,
22+
include_directories: [inc_cpython],
23+
dependencies: [py_dep, gmp],
24+
)
2225
endforeach
2326

src/sage/algebras/fusion_rings/meson.build

+24-20
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,41 @@ py.install_sources(
77
'fusion_ring.py',
88
'poly_tup_engine.pxd',
99
'shm_managers.pxd',
10-
subdir : 'sage/algebras/fusion_rings'
10+
subdir: 'sage/algebras/fusion_rings',
1111
)
1212

1313
extension_data = {
14-
'fast_parallel_fusion_ring_braid_repn' : files('fast_parallel_fusion_ring_braid_repn.pyx')
14+
'fast_parallel_fusion_ring_braid_repn' : files(
15+
'fast_parallel_fusion_ring_braid_repn.pyx',
16+
),
1517
}
1618

1719
foreach name, pyx : extension_data
18-
py.extension_module(name,
19-
sources: pyx,
20-
subdir: 'sage/algebras/fusion_rings',
21-
install: true,
22-
include_directories: [inc_cpython, inc_ntl, inc_numpy, inc_rings],
23-
dependencies: [py_dep, cysignals, gmp],
24-
)
20+
py.extension_module(
21+
name,
22+
sources: pyx,
23+
subdir: 'sage/algebras/fusion_rings',
24+
install: true,
25+
include_directories: [inc_cpython, inc_ntl, inc_numpy, inc_rings],
26+
dependencies: [py_dep, cysignals, gmp],
27+
)
2528
endforeach
2629

2730
extension_data_cpp = {
28-
'fast_parallel_fmats_methods': files('fast_parallel_fmats_methods.pyx'),
29-
'poly_tup_engine': files('poly_tup_engine.pyx'),
30-
'shm_managers': files('shm_managers.pyx'),
31+
'fast_parallel_fmats_methods': files('fast_parallel_fmats_methods.pyx'),
32+
'poly_tup_engine': files('poly_tup_engine.pyx'),
33+
'shm_managers': files('shm_managers.pyx'),
3134
}
3235

3336
foreach name, pyx : extension_data_cpp
34-
py.extension_module(name,
35-
sources: pyx,
36-
subdir: 'sage/algebras/fusion_rings',
37-
install: true,
38-
override_options : ['cython_language=cpp'],
39-
include_directories: [inc_cpython, inc_ntl, inc_numpy, inc_rings],
40-
dependencies: [py_dep, cysignals, gmp, singular],
41-
)
37+
py.extension_module(
38+
name,
39+
sources: pyx,
40+
subdir: 'sage/algebras/fusion_rings',
41+
install: true,
42+
override_options: ['cython_language=cpp'],
43+
include_directories: [inc_cpython, inc_ntl, inc_numpy, inc_rings],
44+
dependencies: [py_dep, cysignals, gmp, singular],
45+
)
4246
endforeach
4347

+20-12
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
1-
py.install_sources('all.py', 'free_algebra_element_letterplace.pxd', 'free_algebra_letterplace.pxd', subdir : 'sage/algebras/letterplace')
1+
py.install_sources(
2+
'all.py',
3+
'free_algebra_element_letterplace.pxd',
4+
'free_algebra_letterplace.pxd',
5+
subdir: 'sage/algebras/letterplace',
6+
)
27

38
extension_data_cpp = {
4-
'free_algebra_element_letterplace': files('free_algebra_element_letterplace.pyx'),
5-
'free_algebra_letterplace': files('free_algebra_letterplace.pyx'),
6-
'letterplace_ideal': files('letterplace_ideal.pyx'),
9+
'free_algebra_element_letterplace': files(
10+
'free_algebra_element_letterplace.pyx',
11+
),
12+
'free_algebra_letterplace': files('free_algebra_letterplace.pyx'),
13+
'letterplace_ideal': files('letterplace_ideal.pyx'),
714
}
815

916
foreach name, pyx : extension_data_cpp
10-
py.extension_module(name,
11-
sources: pyx,
12-
subdir: 'sage/algebras/letterplace',
13-
install: true,
14-
override_options : ['cython_language=cpp'],
15-
include_directories: [inc_cpython, inc_rings],
16-
dependencies: [py_dep, gmp, singular],
17-
)
17+
py.extension_module(
18+
name,
19+
sources: pyx,
20+
subdir: 'sage/algebras/letterplace',
21+
install: true,
22+
override_options: ['cython_language=cpp'],
23+
include_directories: [inc_cpython, inc_rings],
24+
dependencies: [py_dep, gmp, singular],
25+
)
1826
endforeach
1927

0 commit comments

Comments
 (0)