Opened 7 years ago
Last modified 6 years ago
#18450 closed enhancement
Define library dependencies in .pxd files — at Version 20
Reported by: | Jeroen Demeyer | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-6.8 |
Component: | cython | Keywords: | |
Cc: | Jean-Pierre Flori, Sebastien Gouezel | Merged in: | |
Authors: | Jeroen Demeyer | Reviewers: | |
Report Upstream: | Fixed upstream, but not in a stable release. | Work issues: | |
Branch: | u/jdemeyer/define_library_dependencies_in__pxd_files (Commits, GitHub, GitLab) | Commit: | a1ad51c116ae506ff08e50100b6f83f7c0faec4d |
Dependencies: | #18455 | Stopgaps: |
Description (last modified by )
Rather than defining libraries in module_list.py
or in .pyx
files, we should add them to the .pxd
files where the declarations are.
In this branch, we do this as proof-of-concept for pari
and gmp
. Other tickets can be opened later for other libraries. We still leave the libraries explicitly in module_list.py
when needed as dependency of another library, for example mpfr
depends on gmp
.
One annoying part is that the order of libraries is not defined, so we need to manually re-order them using one global library order. Since the order of libraries currently specified in src/module_list.py
is far from a DAG, many extensions will be compiled with a different library order than before.
To clean up, we also remove the explicit mention of stdc++
for c++
code (which is automatically added anyway).
These are all modules where the list of libraries was actually changed:
These were probably underlinked before:
sage/rings/polynomial/pbori
: addedgmp
sage/rings/real_arb
(optional): addedgmp
These use inline functions or macros of libraries but don't use exported functions. So they don't need to link to the library, but it's added anyway:
sage/rings/rational
: addedpari
sage/rings/padics/common_conversion
: addedpari
Modules using the Sage/PARI interface but not directly using PARI will now link against pari
. Strictly speaking, this is a bug but it's hard to avoid:
sage/rings/padics/padic_capped_absolute_element
: addedpari
sage/rings/padics/padic_capped_relative_element
: addedpari
sage/rings/padics/padic_fixed_mod_element
: addedpari
sage/rings/real_double
: addedpari
This branch adds gmp
for all modules where bitsets are used. Some bitset functions require GMP, others do not. These modules were only using the ones not implemented using GMP:
sage/combinat/debruijn_sequence
: addedgmp
sage/combinat/words/word_char
: addedgmp
sage/graphs/base/static_sparse_backend
: addedgmp
sage/graphs/weakly_chordal
: addedgmp
Unused libraries are removed:
sage/combinat/partitions
: removedgmp
andmpfr
sage/graphs/graph_generators_pyx
: removedgmp
sage/groups/semimonomial_transformations/semimonomial_transformation
: removedgmp
sage/modular/modsym/p1list
: removedgmp
sage/modules/vector_mod2_dense
: removedgmp
We need 2 patches to upstream Cython to fix dependency handling:
- https://github.com/cython/cython/pull/381 (accepted)
- https://github.com/cython/cython/pull/392 (no feedback yet)
Change History (20)
comment:1 Changed 7 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 7 years ago by
Cc: | Jean-Pierre Flori added |
---|
comment:3 Changed 7 years ago by
Description: | modified (diff) |
---|
comment:4 Changed 7 years ago by
Description: | modified (diff) |
---|
comment:5 Changed 7 years ago by
Description: | modified (diff) |
---|
comment:6 Changed 7 years ago by
Description: | modified (diff) |
---|
comment:7 Changed 7 years ago by
Dependencies: | → #18455 |
---|
comment:8 Changed 7 years ago by
Branch: | → u/jdemeyer/define_library_dependencies_in__pxd_files |
---|
comment:9 Changed 7 years ago by
Commit: | → 49029fd4db2d1a2874fab1011c8683ecd7a4bb02 |
---|---|
Description: | modified (diff) |
Report Upstream: | Fixed upstream, but not in a stable release. → Reported upstream. No feedback yet. |
comment:10 Changed 7 years ago by
Description: | modified (diff) |
---|
comment:11 Changed 7 years ago by
Description: | modified (diff) |
---|
comment:12 Changed 7 years ago by
Description: | modified (diff) |
---|
comment:13 Changed 7 years ago by
Description: | modified (diff) |
---|
comment:14 Changed 7 years ago by
Description: | modified (diff) |
---|
comment:15 Changed 7 years ago by
Description: | modified (diff) |
---|
comment:16 Changed 7 years ago by
Description: | modified (diff) |
---|
comment:17 Changed 7 years ago by
Description: | modified (diff) |
---|
comment:18 Changed 7 years ago by
Commit: | 49029fd4db2d1a2874fab1011c8683ecd7a4bb02 → a1ad51c116ae506ff08e50100b6f83f7c0faec4d |
---|
comment:19 Changed 7 years ago by
Status: | new → needs_review |
---|
comment:20 Changed 7 years ago by
Description: | modified (diff) |
---|
New commits:
Remove unneeded inclusions of cdefs.pxi
Add Cython patches to improve handling of dependencies
Define some library dependencies in .pxd/.pxi files