Skip to content

Commit 29db39c

Browse files
author
Release Manager
committed
gh-38913: Meson: Improve handling of dependencies <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes #12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes #12345". --> Make the dependency declaration in the meson build files more precise and add a few missing dependencies for some files. Extracted from #38872. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #38913 Reported by: Tobias Diez Reviewer(s): Dima Pasechnik
2 parents 461bb11 + 0416a96 commit 29db39c

File tree

17 files changed

+137
-106
lines changed

17 files changed

+137
-106
lines changed

src/meson.build

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,15 @@ gsl = dependency(
8484
required: true,
8585
)
8686
gd = cc.find_library('gd')
87-
m = cc.find_library('m')
87+
# Only some platforms have a standalone math library (https://mesonbuild.com/howtox.html#add-math-library-lm-portably)
88+
m = cc.find_library('m', required: false)
8889
m4ri = cc.find_library('m4ri')
8990
m4rie = cc.find_library('m4rie')
9091
mtx = cc.find_library('mtx', required: false, disabler: true)
91-
png = cc.find_library('png')
92+
png = cc.find_library('png', required: false)
93+
if not png.found()
94+
png = cc.find_library('png16')
95+
endif
9296
zlib = cc.find_library('z')
9397
# Cannot be found via pkg-config
9498
ec = cc.find_library('ec')

src/sage/coding/codecan/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ foreach name, pyx : extension_data
1717
inc_partn_ref2,
1818
inc_rings,
1919
],
20-
dependencies: [py_dep, cysignals, gmp],
20+
dependencies: [py_dep, cysignals, gap, gmp],
2121
)
2222
endforeach
2323

src/sage/combinat/meson.build

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,18 @@ extension_data = {
145145
}
146146

147147
foreach name, pyx : extension_data
148+
deps = [py_dep, cysignals, gmp]
149+
if name == 'enumeration_mod_permgroup'
150+
deps += [gap]
151+
endif
152+
148153
py.extension_module(
149154
name,
150155
sources: pyx,
151156
subdir: 'sage/combinat',
152157
install: true,
153158
include_directories: [inc_cpython, inc_data_structures, inc_rings],
154-
dependencies: [py_dep, cysignals, gmp],
159+
dependencies: deps,
155160
)
156161
endforeach
157162

src/sage/combinat/root_system/meson.build

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,18 @@ extension_data = {
6464
}
6565

6666
foreach name, pyx : extension_data
67+
deps = [py_dep, cysignals, gmp]
68+
if name.startswith('reflection_group')
69+
deps += [gap]
70+
endif
71+
6772
py.extension_module(
6873
name,
6974
sources: pyx,
7075
subdir: 'sage/combinat/root_system',
7176
install: true,
7277
include_directories: [inc_cpython, inc_rings],
73-
dependencies: [py_dep, cysignals, gmp],
78+
dependencies: deps,
7479
)
7580
endforeach
7681

src/sage/geometry/meson.build

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,18 @@ extension_data = {
3232
}
3333

3434
foreach name, pyx : extension_data
35+
deps = [py_dep, cysignals, flint, gmp]
36+
if name == 'palp_normal_form'
37+
deps += [gap]
38+
endif
39+
3540
py.extension_module(
3641
name,
3742
sources: pyx,
3843
subdir: 'sage/geometry',
3944
install: true,
4045
include_directories: [inc_cpython, inc_ext, inc_flint, inc_rings],
41-
dependencies: [py_dep, cysignals, flint, gmp],
46+
dependencies: deps,
4247
)
4348
endforeach
4449

src/sage/groups/matrix_gps/meson.build

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,18 @@ extension_data = {
3333
}
3434

3535
foreach name, pyx : extension_data
36+
deps = [py_dep, gmp]
37+
if name == 'group_element_gap'
38+
deps += [gap]
39+
endif
40+
3641
py.extension_module(
3742
name,
3843
sources: pyx,
3944
subdir: 'sage/groups/matrix_gps',
4045
install: true,
4146
include_directories: [inc_cpython],
42-
dependencies: [py_dep, gmp],
47+
dependencies: deps,
4348
)
4449
endforeach
4550

src/sage/groups/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ foreach name, pyx : extension_data
4343
subdir: 'sage/groups',
4444
install: true,
4545
include_directories: [inc_cpython],
46-
dependencies: [py_dep, gmp],
46+
dependencies: [py_dep, gmp, gap],
4747
)
4848
endforeach
4949

src/sage/groups/perm_gps/partn_ref2/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ foreach name, pyx : extension_data
1313
subdir: 'sage/groups/perm_gps/partn_ref2',
1414
install: true,
1515
include_directories: [inc_cpython, inc_data_structures, inc_partn_ref2],
16-
dependencies: [py_dep, cysignals, gmp],
16+
dependencies: [py_dep, cysignals, gmp, gap],
1717
)
1818
endforeach
1919

src/sage/libs/mpmath/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ foreach name, pyx : extension_data
2121
subdir: 'sage/libs/mpmath',
2222
install: true,
2323
include_directories: [inc_cpython, inc_ext, inc_rings],
24-
dependencies: [py_dep, cypari2, cysignals, gmp, mpfr],
24+
dependencies: [py_dep, cysignals, gmp, mpfr],
2525
)
2626
endforeach
2727

src/sage/matrix/meson.build

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -96,31 +96,17 @@ extension_data = {
9696
}
9797

9898
foreach name, pyx : extension_data
99-
dependencies = [
100-
py_dep,
101-
blas,
102-
cypari2,
103-
cysignals,
104-
fflas,
105-
flint,
106-
gd,
107-
givaro,
108-
gmp,
109-
gmpxx,
110-
iml,
111-
linbox,
112-
m,
113-
m4ri,
114-
m4rie,
115-
mpfi,
116-
mpfr,
117-
ntl,
118-
pari,
119-
png,
120-
zlib,
121-
]
99+
dependencies = [py_dep, cysignals, gmp]
122100
if name == 'matrix_gfpn_dense'
123101
dependencies += [mtx, meataxe]
102+
elif name == 'matrix_gap'
103+
dependencies += [gap]
104+
elif name == 'misc_mpfr'
105+
dependencies += [mpfr]
106+
elif name == 'matrix_complex_ball_dense'
107+
dependencies += [mpfi]
108+
elif name == 'misc_flint' or name == 'matrix_rational_sparse'
109+
dependencies += [flint]
124110
endif
125111

126112
py.extension_module(

0 commit comments

Comments
 (0)