Skip to content

Commit

Permalink
Trac #29786: Move Extension options from src/module_list.py to "distu…
Browse files Browse the repository at this point in the history
…tils:" directives in the individual files (part 4: sage.rings)

Follow-up from #29706 (which is NOT a dependency of this ticket):

Taking care of `sage.rings.*`, except for those few that would need the
additional `cython_aliases` from #29706.

URL: https://trac.sagemath.org/29786
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): Jonathan Kliem
  • Loading branch information
Release Manager committed Jun 26, 2020
2 parents 876b682 + 1baaa68 commit e05b552
Show file tree
Hide file tree
Showing 34 changed files with 96 additions and 101 deletions.
130 changes: 32 additions & 98 deletions src/module_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,34 +843,19 @@
################################

Extension('sage.rings.sum_of_squares',
sources = ['sage/rings/sum_of_squares.pyx'],
libraries = ['m']),
sources = ['sage/rings/sum_of_squares.pyx']),

Extension('sage.rings.bernmm',
sources = ['sage/rings/bernmm.pyx',
'sage/rings/bernmm/bern_modp.cpp',
'sage/rings/bernmm/bern_modp_util.cpp',
'sage/rings/bernmm/bern_rat.cpp'],
libraries = ['ntl', 'pthread', 'gmp'],
depends = ['sage/rings/bernmm/bern_modp.h',
'sage/rings/bernmm/bern_modp_util.h',
'sage/rings/bernmm/bern_rat.h'],
language = 'c++',
define_macros=[('USE_THREADS', '1'),
('THREAD_STACK_SIZE', '4096')]),
sources = ['sage/rings/bernmm.pyx']),

Extension('sage.rings.bernoulli_mod_p',
sources = ['sage/rings/bernoulli_mod_p.pyx'],
libraries=['ntl', 'gmp'],
language = 'c++'),
sources = ['sage/rings/bernoulli_mod_p.pyx']),

Extension("sage.rings.complex_arb",
["sage/rings/complex_arb.pyx"]),

Extension('sage.rings.complex_double',
sources = ['sage/rings/complex_double.pyx'],
extra_compile_args = ["-D_XPG6"],
libraries = ['m']),
sources = ['sage/rings/complex_double.pyx']),

Extension('sage.rings.complex_interval',
sources = ['sage/rings/complex_interval.pyx']),
Expand All @@ -879,12 +864,10 @@
sources = ['sage/rings/complex_number.pyx']),

Extension('sage.rings.integer',
sources = ['sage/rings/integer.pyx'],
libraries=['ntl']),
sources = ['sage/rings/integer.pyx']),

Extension('sage.rings.integer_ring',
sources = ['sage/rings/integer_ring.pyx'],
libraries=['ntl']),
sources = ['sage/rings/integer_ring.pyx']),

Extension('sage.rings.factorint',
sources = ['sage/rings/factorint.pyx']),
Expand All @@ -896,9 +879,7 @@
sources = ['sage/rings/fraction_field_element.pyx']),

Extension('sage.rings.fraction_field_FpT',
sources = ['sage/rings/fraction_field_FpT.pyx'],
libraries = ["gmp", "ntl", "zn_poly"],
language = 'c++'),
sources = ['sage/rings/fraction_field_FpT.pyx']),

Extension('sage.rings.laurent_series_ring_element',
sources = ['sage/rings/laurent_series_ring_element.pyx']),
Expand Down Expand Up @@ -934,8 +915,7 @@
sources = ['sage/rings/puiseux_series_ring_element.pyx']),

Extension('sage.rings.rational',
sources = ['sage/rings/rational.pyx'],
libraries=['ntl']),
sources = ['sage/rings/rational.pyx']),

Extension('sage.rings.real_double',
sources = ['sage/rings/real_double.pyx']),
Expand Down Expand Up @@ -991,14 +971,10 @@
sources = ['sage/rings/finite_rings/integer_mod.pyx']),

Extension('sage.rings.finite_rings.element_givaro',
sources = ["sage/rings/finite_rings/element_givaro.pyx"],
libraries = ['givaro', 'ntl', 'gmp', 'm'],
language='c++'),
sources = ["sage/rings/finite_rings/element_givaro.pyx"]),

Extension('sage.rings.finite_rings.element_ntl_gf2e',
sources = ['sage/rings/finite_rings/element_ntl_gf2e.pyx'],
libraries = ['ntl'],
language = 'c++'),
sources = ['sage/rings/finite_rings/element_ntl_gf2e.pyx']),

Extension('sage.rings.finite_rings.element_pari_ffelt',
sources = ['sage/rings/finite_rings/element_pari_ffelt.pyx']),
Expand All @@ -1010,9 +986,7 @@
sources = ["sage/rings/finite_rings/hom_prime_finite_field.pyx"]),

Extension('sage.rings.finite_rings.hom_finite_field_givaro',
sources = ["sage/rings/finite_rings/hom_finite_field_givaro.pyx"],
libraries = ['givaro', 'ntl', 'gmp', 'm'],
language='c++'),
sources = ["sage/rings/finite_rings/hom_finite_field_givaro.pyx"]),

################################
##
Expand All @@ -1033,14 +1007,10 @@
sources = ['sage/rings/number_field/number_field_base.pyx']),

Extension('sage.rings.number_field.number_field_element',
sources = ['sage/rings/number_field/number_field_element.pyx'],
libraries=['ntl'],
language = 'c++'),
sources = ['sage/rings/number_field/number_field_element.pyx']),

Extension('sage.rings.number_field.number_field_element_quadratic',
sources = ['sage/rings/number_field/number_field_element_quadratic.pyx'],
libraries=['ntl'],
language = 'c++'),
sources = ['sage/rings/number_field/number_field_element_quadratic.pyx']),

Extension('sage.rings.number_field.number_field_morphisms',
sources = ['sage/rings/number_field/number_field_morphisms.pyx']),
Expand All @@ -1049,8 +1019,7 @@
sources = ['sage/rings/number_field/totallyreal.pyx']),

Extension('sage.rings.number_field.totallyreal_data',
sources = ['sage/rings/number_field/totallyreal_data.pyx'],
libraries = ['gmp']),
sources = ['sage/rings/number_field/totallyreal_data.pyx']),

################################
##
Expand All @@ -1077,9 +1046,7 @@
sources = ['sage/rings/padics/padic_floating_point_element.pyx']),

Extension('sage.rings.padics.padic_ext_element',
sources = ['sage/rings/padics/padic_ext_element.pyx'],
libraries=['ntl', 'gmp', 'm'],
language='c++'),
sources = ['sage/rings/padics/padic_ext_element.pyx']),

Extension('sage.rings.padics.padic_fixed_mod_element',
sources = ['sage/rings/padics/padic_fixed_mod_element.pyx']),
Expand All @@ -1088,49 +1055,31 @@
sources = ['sage/rings/padics/padic_generic_element.pyx']),

Extension('sage.rings.padics.padic_printing',
sources = ['sage/rings/padics/padic_printing.pyx'],
libraries=['gmp', 'ntl', 'm'],
language='c++'),
sources = ['sage/rings/padics/padic_printing.pyx']),

Extension('sage.rings.padics.padic_ZZ_pX_CA_element',
sources = ['sage/rings/padics/padic_ZZ_pX_CA_element.pyx'],
libraries = ['ntl', 'gmp', 'm'],
language='c++'),
sources = ['sage/rings/padics/padic_ZZ_pX_CA_element.pyx']),

Extension('sage.rings.padics.padic_ZZ_pX_CR_element',
sources = ['sage/rings/padics/padic_ZZ_pX_CR_element.pyx'],
libraries=['ntl', 'gmp', 'm'],
language='c++'),
sources = ['sage/rings/padics/padic_ZZ_pX_CR_element.pyx']),

Extension('sage.rings.padics.padic_ZZ_pX_element',
sources = ['sage/rings/padics/padic_ZZ_pX_element.pyx'],
libraries=['ntl', 'gmp', 'm'],
language='c++'),
sources = ['sage/rings/padics/padic_ZZ_pX_element.pyx']),

Extension('sage.rings.padics.padic_ZZ_pX_FM_element',
sources = ['sage/rings/padics/padic_ZZ_pX_FM_element.pyx'],
libraries=['ntl', 'gmp', 'm'],
language='c++'),
sources = ['sage/rings/padics/padic_ZZ_pX_FM_element.pyx']),

Extension('sage.rings.padics.pow_computer',
sources = ['sage/rings/padics/pow_computer.pyx'],
libraries = ["ntl", "gmp", "m"],
language='c++'),
sources = ['sage/rings/padics/pow_computer.pyx']),

Extension('sage.rings.padics.pow_computer_ext',
sources = ['sage/rings/padics/pow_computer_ext.pyx'],
libraries = ["ntl", "gmp", "m"],
language='c++'),
sources = ['sage/rings/padics/pow_computer_ext.pyx']),

Extension('sage.rings.padics.pow_computer_flint',
sources = ['sage/rings/padics/pow_computer_flint.pyx'],
libraries = ["gmp", "ntl"],
language='c++'),
sources = ['sage/rings/padics/pow_computer_flint.pyx']),

Extension('sage.rings.padics.pow_computer_relative',
sources = ['sage/rings/padics/pow_computer_relative.pyx'],
libraries = ["ntl", "gmp", "m"],
language='c++'),
sources = ['sage/rings/padics/pow_computer_relative.pyx']),

Extension('sage.rings.padics.qadic_flint_CR',
sources = ['sage/rings/padics/qadic_flint_CR.pyx']),
Expand All @@ -1142,8 +1091,7 @@
sources = ['sage/rings/padics/qadic_flint_FM.pyx']),

Extension('sage.rings.padics.qadic_flint_FP',
sources = ['sage/rings/padics/qadic_flint_FP.pyx'],
libraries = ["flint"]),
sources = ['sage/rings/padics/qadic_flint_FP.pyx']),

Extension('sage.rings.padics.relative_ramified_FM',
sources = ['sage/rings/padics/relative_ramified_FM.pyx']),
Expand All @@ -1164,9 +1112,7 @@
sources = ['sage/rings/polynomial/cyclotomic.pyx']),

Extension('sage.rings.polynomial.evaluation',
libraries = ["ntl"],
sources = ['sage/rings/polynomial/evaluation.pyx'],
language = 'c++'),
sources = ['sage/rings/polynomial/evaluation.pyx']),

Extension('sage.rings.polynomial.laurent_polynomial',
sources = ['sage/rings/polynomial/laurent_polynomial.pyx']),
Expand Down Expand Up @@ -1211,34 +1157,22 @@
language = 'c++'),

Extension('sage.rings.polynomial.polynomial_zz_pex',
sources = ['sage/rings/polynomial/polynomial_zz_pex.pyx'],
libraries = ['ntl', 'gmp'],
language = 'c++'),
sources = ['sage/rings/polynomial/polynomial_zz_pex.pyx']),

Extension('sage.rings.polynomial.polynomial_zmod_flint',
sources = ['sage/rings/polynomial/polynomial_zmod_flint.pyx'],
libraries = ["gmp", "ntl", "zn_poly"],
language = 'c++'),
sources = ['sage/rings/polynomial/polynomial_zmod_flint.pyx']),

Extension('sage.rings.polynomial.polynomial_integer_dense_flint',
sources = ['sage/rings/polynomial/polynomial_integer_dense_flint.pyx'],
language = 'c++',
libraries = ["ntl", "gmp"]),
sources = ['sage/rings/polynomial/polynomial_integer_dense_flint.pyx']),

Extension('sage.rings.polynomial.polynomial_integer_dense_ntl',
sources = ['sage/rings/polynomial/polynomial_integer_dense_ntl.pyx'],
libraries = ['ntl', 'gmp'],
language = 'c++'),
sources = ['sage/rings/polynomial/polynomial_integer_dense_ntl.pyx']),

Extension('sage.rings.polynomial.polynomial_rational_flint',
sources = ['sage/rings/polynomial/polynomial_rational_flint.pyx'],
libraries = ["ntl", "gmp"],
language = 'c++'),
sources = ['sage/rings/polynomial/polynomial_rational_flint.pyx']),

Extension('sage.rings.polynomial.polynomial_modn_dense_ntl',
sources = ['sage/rings/polynomial/polynomial_modn_dense_ntl.pyx'],
libraries = ['ntl', 'gmp'],
language = 'c++'),
sources = ['sage/rings/polynomial/polynomial_modn_dense_ntl.pyx']),

Extension('sage.rings.polynomial.polynomial_ring_homomorphism',
sources = ['sage/rings/polynomial/polynomial_ring_homomorphism.pyx']),
Expand Down
4 changes: 2 additions & 2 deletions src/sage/misc/sageinspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
sage: sage_getdoc(sage.rings.rational).lstrip()
'Rational Numbers...'
sage: sage_getsource(sage.rings.rational)[5:]
'Rational Numbers...'
sage: sage_getsource(sage.rings.rational)
'# distutils: ...Rational Numbers...'
Python modules::
Expand Down
5 changes: 5 additions & 0 deletions src/sage/rings/bernmm.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# distutils: sources = sage/rings/bernmm/bern_modp.cpp sage/rings/bernmm/bern_modp_util.cpp sage/rings/bernmm/bern_rat.cpp
# distutils: libraries = ntl pthread gmp
# distutils: depends = sage/rings/bernmm/bern_modp.h sage/rings/bernmm/bern_modp_util.h sage/rings/bernmm/bern_rat.h
# distutils: language = c++
# distutils: define_macros = USE_THREADS=1 THREAD_STACK_SIZE=4096
r"""
Cython wrapper for bernmm library
Expand Down
2 changes: 2 additions & 0 deletions src/sage/rings/bernoulli_mod_p.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: libraries = ntl gmp
# distutils: language = c++
r"""
Bernoulli numbers modulo p
Expand Down
2 changes: 2 additions & 0 deletions src/sage/rings/complex_double.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: extra_compile_args = -D_XPG6
# distutils: libraries = m
r"""
Double Precision Complex Numbers
Expand Down
2 changes: 2 additions & 0 deletions src/sage/rings/finite_rings/element_givaro.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: libraries = givaro ntl gmp m
# distutils: language = c++
r"""
Givaro Field Elements
Expand Down
2 changes: 2 additions & 0 deletions src/sage/rings/finite_rings/element_ntl_gf2e.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: libraries = ntl
# distutils: language = c++
r"""
Finite Fields of characteristic 2.
Expand Down
2 changes: 2 additions & 0 deletions src/sage/rings/finite_rings/hom_finite_field_givaro.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: libraries = givaro ntl gmp m
# distutils: language = c++
"""
Finite field morphisms using Givaro
Expand Down
2 changes: 2 additions & 0 deletions src/sage/rings/fraction_field_FpT.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: libraries = gmp ntl zn_poly
# distutils: language = c++
"Univariate rational functions over prime fields"

import sys
Expand Down
1 change: 1 addition & 0 deletions src/sage/rings/integer.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# distutils: libraries = ntl
r"""
Elements of the ring `\ZZ` of integers
Expand Down
1 change: 1 addition & 0 deletions src/sage/rings/integer_ring.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# distutils: libraries = ntl
r"""
Ring `\ZZ` of Integers
Expand Down
2 changes: 2 additions & 0 deletions src/sage/rings/number_field/number_field_element.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: libraries = ntl
# distutils: language = c++
"""
Number Field Elements
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: libraries = ntl
# distutils: language = c++
"""
Optimized Quadratic Number Field Elements
Expand Down
1 change: 1 addition & 0 deletions src/sage/rings/number_field/totallyreal_data.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# distutils: libraries = gmp
"""
Enumeration of Totally Real Fields
Expand Down
2 changes: 2 additions & 0 deletions src/sage/rings/padics/padic_ZZ_pX_CA_element.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++
"""
`p`-Adic ``ZZ_pX`` CA Element
Expand Down
2 changes: 2 additions & 0 deletions src/sage/rings/padics/padic_ZZ_pX_CR_element.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++
"""
`p`-Adic ``ZZ_pX`` CR Element
Expand Down
2 changes: 2 additions & 0 deletions src/sage/rings/padics/padic_ZZ_pX_FM_element.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++
"""
`p`-Adic ``ZZ_pX`` FM Element
Expand Down
2 changes: 2 additions & 0 deletions src/sage/rings/padics/padic_ZZ_pX_element.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++
"""
`p`-Adic ``ZZ_pX Element``
Expand Down
2 changes: 2 additions & 0 deletions src/sage/rings/padics/padic_ext_element.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++
"""
p-Adic Extension Element
Expand Down
2 changes: 2 additions & 0 deletions src/sage/rings/padics/padic_printing.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: libraries = gmp ntl m
# distutils: language = c++
"""
p-Adic Printing
Expand Down
2 changes: 2 additions & 0 deletions src/sage/rings/padics/pow_computer.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++
"""
PowComputer
Expand Down
2 changes: 2 additions & 0 deletions src/sage/rings/padics/pow_computer_ext.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++
"""
PowComputer_ext
Expand Down
3 changes: 2 additions & 1 deletion src/sage/rings/padics/pow_computer_flint.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

# distutils: libraries = gmp ntl
# distutils: language = c++
from cysignals.memory cimport sig_malloc, sig_free
from cysignals.signals cimport sig_on, sig_off

Expand Down
Loading

0 comments on commit e05b552

Please sign in to comment.