From 66bf321e35062aeac0364aab969da7bd09471eee Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 17 May 2020 20:28:27 -0700 Subject: [PATCH 01/14] src/sage/algebras: Move Extension options from src/module_list.py to distutils directives --- src/module_list.py | 17 +---------------- .../quatalg/quaternion_algebra_cython.pyx | 2 ++ .../quatalg/quaternion_algebra_element.pyx | 2 ++ 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/module_list.py b/src/module_list.py index d7b5f459cf0..abdebba46d3 100644 --- a/src/module_list.py +++ b/src/module_list.py @@ -133,22 +133,7 @@ def uname_specific(name, value, alternative): ## ################################ - Extension('sage.algebras.quatalg.quaternion_algebra_element', - sources = ['sage/algebras/quatalg/quaternion_algebra_element.pyx'], - language='c++', - libraries = ["gmp", "m", "ntl"]), - - Extension('*', sources = ['sage/algebras/letterplace/*.pyx']), - - Extension('*', sources = ['sage/algebras/finite_dimensional_algebras/*.pyx']), - - Extension('sage.algebras.quatalg.quaternion_algebra_cython', - sources = ['sage/algebras/quatalg/quaternion_algebra_cython.pyx'], - language='c++', - libraries = ["gmp", "m", "ntl"]), - - Extension('sage.algebras.lie_algebras.lie_algebra_element', - sources = ["sage/algebras/lie_algebras/lie_algebra_element.pyx"]), + Extension('*', ['sage/algebras/**/*.pyx']), ################################ ## diff --git a/src/sage/algebras/quatalg/quaternion_algebra_cython.pyx b/src/sage/algebras/quatalg/quaternion_algebra_cython.pyx index 01fb64c1868..d0d291ccdd8 100644 --- a/src/sage/algebras/quatalg/quaternion_algebra_cython.pyx +++ b/src/sage/algebras/quatalg/quaternion_algebra_cython.pyx @@ -1,3 +1,5 @@ +# distutils: language = c++ +# distutils: libraries = gmp m ntl """ Optimized Cython code needed by quaternion algebras diff --git a/src/sage/algebras/quatalg/quaternion_algebra_element.pyx b/src/sage/algebras/quatalg/quaternion_algebra_element.pyx index a578badf0df..929f3910242 100644 --- a/src/sage/algebras/quatalg/quaternion_algebra_element.pyx +++ b/src/sage/algebras/quatalg/quaternion_algebra_element.pyx @@ -1,3 +1,5 @@ +# distutils: language = c++ +# distutils: libraries = gmp m ntl """ Elements of Quaternion Algebras From f31b6a09b38cd9b6e3b9070ab5e20cb605866812 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 17 May 2020 20:41:00 -0700 Subject: [PATCH 02/14] src/sage/geometry: Move Extension options from src/module_list.py to distutils directives --- src/module_list.py | 49 +------------------ .../combinatorial_face.pyx | 4 ++ .../face_iterator.pyx | 4 ++ .../list_of_faces.pyx | 4 ++ .../polyhedron_face_lattice.pyx | 4 ++ src/sage/geometry/triangulation/base.pyx | 4 ++ 6 files changed, 21 insertions(+), 48 deletions(-) diff --git a/src/module_list.py b/src/module_list.py index abdebba46d3..3147d3437f7 100644 --- a/src/module_list.py +++ b/src/module_list.py @@ -264,54 +264,7 @@ def uname_specific(name, value, alternative): ## ################################ - Extension('sage.geometry.point_collection', - sources = ['sage/geometry/point_collection.pyx']), - - Extension('sage.geometry.toric_lattice_element', - sources = ['sage/geometry/toric_lattice_element.pyx']), - - Extension('sage.geometry.integral_points', - sources = ['sage/geometry/integral_points.pyx']), - - Extension('sage.geometry.triangulation.base', - sources = ['sage/geometry/triangulation/base.pyx', - 'sage/geometry/triangulation/functions.cc', - 'sage/geometry/triangulation/data.cc', - 'sage/geometry/triangulation/triangulations.cc'], - depends = ['sage/geometry/triangulation/functions.h', - 'sage/geometry/triangulation/data.h', - 'sage/geometry/triangulation/triangulations.h'], - language="c++"), - - Extension('sage.geometry.polyhedron.combinatorial_polyhedron.base', - sources = ['sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx']), - - Extension('sage.geometry.polyhedron.combinatorial_polyhedron.list_of_faces', - sources = ['sage/geometry/polyhedron/combinatorial_polyhedron/list_of_faces.pyx'], - depends = ['sage/geometry/polyhedron/combinatorial_polyhedron/bit_vector_operations.cc'], - language="c++", - extra_compile_args=['-std=c++11']), - - Extension('sage.geometry.polyhedron.combinatorial_polyhedron.face_iterator', - sources = ['sage/geometry/polyhedron/combinatorial_polyhedron/face_iterator.pyx'], - depends = ['sage/geometry/polyhedron/combinatorial_polyhedron/bit_vector_operations.cc'], - language="c++", - extra_compile_args=['-std=c++11']), - - Extension('sage.geometry.polyhedron.combinatorial_polyhedron.polyhedron_face_lattice', - sources = ['sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pyx'], - depends = ['sage/geometry/polyhedron/combinatorial_polyhedron/bit_vector_operations.cc'], - language="c++", - extra_compile_args=['-std=c++11']), - - Extension('sage.geometry.polyhedron.combinatorial_polyhedron.combinatorial_face', - sources = ['sage/geometry/polyhedron/combinatorial_polyhedron/combinatorial_face.pyx'], - depends = ['sage/geometry/polyhedron/combinatorial_polyhedron/bit_vector_operations.cc'], - language="c++", - extra_compile_args=['-std=c++11']), - - Extension('sage.geometry.polyhedron.combinatorial_polyhedron.conversions', - sources = ['sage/geometry/polyhedron/combinatorial_polyhedron/conversions.pyx']), + Extension('*', ['sage/geometry/**/*.pyx']), ################################ ## diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/combinatorial_face.pyx b/src/sage/geometry/polyhedron/combinatorial_polyhedron/combinatorial_face.pyx index b7131b58e65..e28b4f035ba 100644 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/combinatorial_face.pyx +++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/combinatorial_face.pyx @@ -1,3 +1,7 @@ +# distutils: depends = sage/geometry/polyhedron/combinatorial_polyhedron/bit_vector_operations.cc +# distutils: language = c++ +# distutils: extra_compile_args = -std=c++11 + r""" Combinatorial face of a polyhedron diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/face_iterator.pyx b/src/sage/geometry/polyhedron/combinatorial_polyhedron/face_iterator.pyx index 4e56cb205f2..22f489dbfbe 100644 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/face_iterator.pyx +++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/face_iterator.pyx @@ -1,3 +1,7 @@ +# distutils: depends = sage/geometry/polyhedron/combinatorial_polyhedron/bit_vector_operations.cc +# distutils: language = c++ +# distutils: extra_compile_args = -std=c++11 + r""" Face iterator for polyhedra diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/list_of_faces.pyx b/src/sage/geometry/polyhedron/combinatorial_polyhedron/list_of_faces.pyx index 920f297a89a..0c5c03d9566 100644 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/list_of_faces.pyx +++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/list_of_faces.pyx @@ -1,3 +1,7 @@ +# distutils: depends = sage/geometry/polyhedron/combinatorial_polyhedron/bit_vector_operations.cc +# distutils: language = c++ +# distutils: extra_compile_args = -std=c++11 + r""" List of faces diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pyx b/src/sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pyx index f7af68746e5..76d7552db42 100644 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pyx +++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pyx @@ -1,3 +1,7 @@ +# distutils: depends = sage/geometry/polyhedron/combinatorial_polyhedron/bit_vector_operations.cc +# distutils: language = c++ +# distutils: extra_compile_args = -std=c++11 + r""" PolyhedronFaceLattice diff --git a/src/sage/geometry/triangulation/base.pyx b/src/sage/geometry/triangulation/base.pyx index b575e5af4d1..df958418391 100644 --- a/src/sage/geometry/triangulation/base.pyx +++ b/src/sage/geometry/triangulation/base.pyx @@ -1,3 +1,7 @@ +# distutils: sources = sage/geometry/triangulation/base.pyx sage/geometry/triangulation/functions.cc sage/geometry/triangulation/data.cc sage/geometry/triangulation/triangulations.cc +# distutils: depends = sage/geometry/triangulation/functions.h sage/geometry/triangulation/data.h sage/geometry/triangulation/triangulations.h +# distutils: language = c++ + r""" Base classes for triangulations From 0c0ef436367253b44d7c7dce5c30b18c63b79a73 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 17 May 2020 21:33:31 -0700 Subject: [PATCH 03/14] src/sage/libs/ntl: Move Extension options from src/module_list.py to distutils directives --- src/module_list.py | 105 +------------------------ src/sage/libs/ntl/convert.pyx | 3 + src/sage/libs/ntl/error.pyx | 3 + src/sage/libs/ntl/ntl_GF2.pyx | 3 + src/sage/libs/ntl/ntl_GF2E.pyx | 3 + src/sage/libs/ntl/ntl_GF2EContext.pyx | 3 + src/sage/libs/ntl/ntl_GF2EX.pyx | 3 + src/sage/libs/ntl/ntl_GF2X.pyx | 3 + src/sage/libs/ntl/ntl_ZZ.pyx | 3 + src/sage/libs/ntl/ntl_ZZX.pyx | 3 + src/sage/libs/ntl/ntl_ZZ_p.pyx | 3 + src/sage/libs/ntl/ntl_ZZ_pContext.pyx | 3 + src/sage/libs/ntl/ntl_ZZ_pE.pyx | 3 + src/sage/libs/ntl/ntl_ZZ_pEContext.pyx | 3 + src/sage/libs/ntl/ntl_ZZ_pEX.pyx | 3 + src/sage/libs/ntl/ntl_ZZ_pX.pyx | 3 + src/sage/libs/ntl/ntl_lzz_p.pyx | 3 + src/sage/libs/ntl/ntl_lzz_pContext.pyx | 3 + src/sage/libs/ntl/ntl_lzz_pX.pyx | 3 + src/sage/libs/ntl/ntl_mat_GF2.pyx | 3 + src/sage/libs/ntl/ntl_mat_GF2E.pyx | 3 + src/sage/libs/ntl/ntl_mat_ZZ.pyx | 3 + 22 files changed, 64 insertions(+), 104 deletions(-) diff --git a/src/module_list.py b/src/module_list.py index 3147d3437f7..1125f73b3ec 100644 --- a/src/module_list.py +++ b/src/module_list.py @@ -595,110 +595,7 @@ def uname_specific(name, value, alternative): ## ################################### - Extension('sage.libs.ntl.convert', - sources = ["sage/libs/ntl/convert.pyx"], - libraries = ["ntl", "gmp"], - language='c++'), - - Extension('sage.libs.ntl.error', - sources = ["sage/libs/ntl/error.pyx"], - libraries = ["ntl", "gmp"], - language='c++'), - - Extension('sage.libs.ntl.ntl_GF2', - sources = ["sage/libs/ntl/ntl_GF2.pyx"], - libraries = ["ntl", "gmp"], - language='c++'), - - Extension('sage.libs.ntl.ntl_GF2E', - sources = ["sage/libs/ntl/ntl_GF2E.pyx"], - libraries = ["ntl", "gmp", "m"], - language='c++'), - - Extension('sage.libs.ntl.ntl_GF2EContext', - sources = ["sage/libs/ntl/ntl_GF2EContext.pyx"], - libraries = ["ntl", "gmp", "m"], - language='c++'), - - Extension('sage.libs.ntl.ntl_GF2EX', - sources = ["sage/libs/ntl/ntl_GF2EX.pyx"], - libraries = ["ntl", "gmp", "m"], - language='c++'), - - Extension('sage.libs.ntl.ntl_GF2X', - sources = ["sage/libs/ntl/ntl_GF2X.pyx"], - libraries = ["ntl", "gmp", "m"], - language='c++'), - - Extension('sage.libs.ntl.ntl_lzz_p', - sources = ["sage/libs/ntl/ntl_lzz_p.pyx"], - libraries = ["ntl", "gmp", "m"], - language='c++'), - - Extension('sage.libs.ntl.ntl_lzz_pContext', - sources = ["sage/libs/ntl/ntl_lzz_pContext.pyx"], - libraries = ["ntl", "gmp", "m"], - language='c++'), - - Extension('sage.libs.ntl.ntl_lzz_pX', - sources = ["sage/libs/ntl/ntl_lzz_pX.pyx"], - libraries = ["ntl", "gmp", "m"], - language='c++'), - - Extension('sage.libs.ntl.ntl_mat_GF2', - sources = ["sage/libs/ntl/ntl_mat_GF2.pyx"], - libraries = ["ntl", "gmp", "m"], - language='c++'), - - Extension('sage.libs.ntl.ntl_mat_GF2E', - sources = ["sage/libs/ntl/ntl_mat_GF2E.pyx"], - libraries = ["ntl", "gmp", "m"], - language='c++'), - - Extension('sage.libs.ntl.ntl_mat_ZZ', - sources = ["sage/libs/ntl/ntl_mat_ZZ.pyx"], - libraries = ["ntl", "gmp", "m"], - language='c++'), - - Extension('sage.libs.ntl.ntl_ZZ', - sources = ["sage/libs/ntl/ntl_ZZ.pyx"], - libraries = ["ntl", "gmp", "m"], - language='c++'), - - Extension('sage.libs.ntl.ntl_ZZX', - sources = ["sage/libs/ntl/ntl_ZZX.pyx"], - libraries = ["ntl", "gmp", "m"], - language='c++'), - - Extension('sage.libs.ntl.ntl_ZZ_p', - sources = ["sage/libs/ntl/ntl_ZZ_p.pyx"], - libraries = ["ntl", "gmp", "m"], - language='c++'), - - Extension('sage.libs.ntl.ntl_ZZ_pContext', - sources = ["sage/libs/ntl/ntl_ZZ_pContext.pyx"], - libraries = ["ntl", "gmp", "m"], - language='c++'), - - Extension('sage.libs.ntl.ntl_ZZ_pE', - sources = ["sage/libs/ntl/ntl_ZZ_pE.pyx"], - libraries = ["ntl", "gmp", "m"], - language='c++'), - - Extension('sage.libs.ntl.ntl_ZZ_pEContext', - sources = ["sage/libs/ntl/ntl_ZZ_pEContext.pyx"], - libraries = ["ntl", "gmp", "m"], - language='c++'), - - Extension('sage.libs.ntl.ntl_ZZ_pEX', - sources = ["sage/libs/ntl/ntl_ZZ_pEX.pyx"], - libraries = ["ntl", "gmp", "m"], - language='c++'), - - Extension('sage.libs.ntl.ntl_ZZ_pX', - sources = ["sage/libs/ntl/ntl_ZZ_pX.pyx"], - libraries = ["ntl", "gmp", "m"], - language='c++'), + Extension('*', ["sage/libs/ntl/*.pyx"]), ################################ ## diff --git a/src/sage/libs/ntl/convert.pyx b/src/sage/libs/ntl/convert.pyx index 1da7afd077c..19380ded8ea 100644 --- a/src/sage/libs/ntl/convert.pyx +++ b/src/sage/libs/ntl/convert.pyx @@ -1,4 +1,7 @@ # distutils: depends = NTL/ZZ.h +# distutils: libraries = ntl gmp +# distutils: language = c++ + """ Conversion between NTL's ``ZZ`` and various other types """ diff --git a/src/sage/libs/ntl/error.pyx b/src/sage/libs/ntl/error.pyx index 9052fe0a286..99d6ca92a0c 100644 --- a/src/sage/libs/ntl/error.pyx +++ b/src/sage/libs/ntl/error.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = ntl gmp +# distutils: language = c++ + """ NTL error handler diff --git a/src/sage/libs/ntl/ntl_GF2.pyx b/src/sage/libs/ntl/ntl_GF2.pyx index 5aa701f451f..21f69956b7c 100644 --- a/src/sage/libs/ntl/ntl_GF2.pyx +++ b/src/sage/libs/ntl/ntl_GF2.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = ntl gmp +# distutils: language = c++ + #***************************************************************************** # Copyright (C) 2007 Martin Albrecht # diff --git a/src/sage/libs/ntl/ntl_GF2E.pyx b/src/sage/libs/ntl/ntl_GF2E.pyx index ee6ab1c6adc..f45ad616a94 100644 --- a/src/sage/libs/ntl/ntl_GF2E.pyx +++ b/src/sage/libs/ntl/ntl_GF2E.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = ntl gmp m +# distutils: language = c++ + #***************************************************************************** # Copyright (C) 2005 William Stein # Copyright (C) 2007 Martin Albrecht diff --git a/src/sage/libs/ntl/ntl_GF2EContext.pyx b/src/sage/libs/ntl/ntl_GF2EContext.pyx index ab0ea3b9d0e..b1b453ae781 100644 --- a/src/sage/libs/ntl/ntl_GF2EContext.pyx +++ b/src/sage/libs/ntl/ntl_GF2EContext.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = ntl gmp m +# distutils: language = c++ + #***************************************************************************** # Copyright (C) 2005 William Stein # diff --git a/src/sage/libs/ntl/ntl_GF2EX.pyx b/src/sage/libs/ntl/ntl_GF2EX.pyx index 0067bb6175b..4a3ac4a3c0e 100644 --- a/src/sage/libs/ntl/ntl_GF2EX.pyx +++ b/src/sage/libs/ntl/ntl_GF2EX.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = ntl gmp m +# distutils: language = c++ + #***************************************************************************** # Copyright (C) 2005 William Stein # diff --git a/src/sage/libs/ntl/ntl_GF2X.pyx b/src/sage/libs/ntl/ntl_GF2X.pyx index 19dee747696..f3817f9cac2 100644 --- a/src/sage/libs/ntl/ntl_GF2X.pyx +++ b/src/sage/libs/ntl/ntl_GF2X.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = ntl gmp m +# distutils: language = c++ + # **************************************************************************** # Copyright (C) 2005 William Stein # Copyright (C) 2007 Martin Albrecht diff --git a/src/sage/libs/ntl/ntl_ZZ.pyx b/src/sage/libs/ntl/ntl_ZZ.pyx index 7e040cd9c76..a396e705e2f 100644 --- a/src/sage/libs/ntl/ntl_ZZ.pyx +++ b/src/sage/libs/ntl/ntl_ZZ.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = ntl gmp m +# distutils: language = c++ + #***************************************************************************** # Copyright (C) 2005 William Stein # diff --git a/src/sage/libs/ntl/ntl_ZZX.pyx b/src/sage/libs/ntl/ntl_ZZX.pyx index 228da080442..22e945814ae 100644 --- a/src/sage/libs/ntl/ntl_ZZX.pyx +++ b/src/sage/libs/ntl/ntl_ZZX.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = ntl gmp m +# distutils: language = c++ + #***************************************************************************** # Copyright (C) 2005 William Stein # diff --git a/src/sage/libs/ntl/ntl_ZZ_p.pyx b/src/sage/libs/ntl/ntl_ZZ_p.pyx index e03170bda00..da368d25572 100644 --- a/src/sage/libs/ntl/ntl_ZZ_p.pyx +++ b/src/sage/libs/ntl/ntl_ZZ_p.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = ntl gmp m +# distutils: language = c++ + #***************************************************************************** # Copyright (C) 2005 William Stein # diff --git a/src/sage/libs/ntl/ntl_ZZ_pContext.pyx b/src/sage/libs/ntl/ntl_ZZ_pContext.pyx index dab23a36171..81415974f4b 100644 --- a/src/sage/libs/ntl/ntl_ZZ_pContext.pyx +++ b/src/sage/libs/ntl/ntl_ZZ_pContext.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = ntl gmp m +# distutils: language = c++ + #***************************************************************************** # Copyright (C) 2005 William Stein # diff --git a/src/sage/libs/ntl/ntl_ZZ_pE.pyx b/src/sage/libs/ntl/ntl_ZZ_pE.pyx index 7be19458c2d..c0981c8e9da 100644 --- a/src/sage/libs/ntl/ntl_ZZ_pE.pyx +++ b/src/sage/libs/ntl/ntl_ZZ_pE.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = ntl gmp m +# distutils: language = c++ + #***************************************************************************** # Copyright (C) 2005 William Stein # diff --git a/src/sage/libs/ntl/ntl_ZZ_pEContext.pyx b/src/sage/libs/ntl/ntl_ZZ_pEContext.pyx index 3855eb1cd22..c5abe44a5f8 100644 --- a/src/sage/libs/ntl/ntl_ZZ_pEContext.pyx +++ b/src/sage/libs/ntl/ntl_ZZ_pEContext.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = ntl gmp m +# distutils: language = c++ + #***************************************************************************** # Copyright (C) 2005 William Stein # diff --git a/src/sage/libs/ntl/ntl_ZZ_pEX.pyx b/src/sage/libs/ntl/ntl_ZZ_pEX.pyx index 07efc9ea163..b8f07db7c74 100644 --- a/src/sage/libs/ntl/ntl_ZZ_pEX.pyx +++ b/src/sage/libs/ntl/ntl_ZZ_pEX.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = ntl gmp m +# distutils: language = c++ + """ Wrapper for NTL's polynomials over finite ring extensions of $\Z / p\Z.$ diff --git a/src/sage/libs/ntl/ntl_ZZ_pX.pyx b/src/sage/libs/ntl/ntl_ZZ_pX.pyx index b2336c1c9a1..a31f9a4c807 100644 --- a/src/sage/libs/ntl/ntl_ZZ_pX.pyx +++ b/src/sage/libs/ntl/ntl_ZZ_pX.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = ntl gmp m +# distutils: language = c++ + # **************************************************************************** # Copyright (C) 2005 William Stein # diff --git a/src/sage/libs/ntl/ntl_lzz_p.pyx b/src/sage/libs/ntl/ntl_lzz_p.pyx index 7809288152f..582e6f088f4 100644 --- a/src/sage/libs/ntl/ntl_lzz_p.pyx +++ b/src/sage/libs/ntl/ntl_lzz_p.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = ntl gmp m +# distutils: language = c++ + """ ntl_lzz_p.pyx diff --git a/src/sage/libs/ntl/ntl_lzz_pContext.pyx b/src/sage/libs/ntl/ntl_lzz_pContext.pyx index 9836b7240ab..30667a452d2 100644 --- a/src/sage/libs/ntl/ntl_lzz_pContext.pyx +++ b/src/sage/libs/ntl/ntl_lzz_pContext.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = ntl gmp m +# distutils: language = c++ + #***************************************************************************** # Copyright (C) 2005 William Stein # diff --git a/src/sage/libs/ntl/ntl_lzz_pX.pyx b/src/sage/libs/ntl/ntl_lzz_pX.pyx index c063e30548b..d953a55248f 100644 --- a/src/sage/libs/ntl/ntl_lzz_pX.pyx +++ b/src/sage/libs/ntl/ntl_lzz_pX.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = ntl gmp m +# distutils: language = c++ + """ ntl_lzz_pX.pyx diff --git a/src/sage/libs/ntl/ntl_mat_GF2.pyx b/src/sage/libs/ntl/ntl_mat_GF2.pyx index 19641a869f8..5ac36f96285 100644 --- a/src/sage/libs/ntl/ntl_mat_GF2.pyx +++ b/src/sage/libs/ntl/ntl_mat_GF2.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = ntl gmp m +# distutils: language = c++ + """ Matrices over the $\GF{2}$ via NTL diff --git a/src/sage/libs/ntl/ntl_mat_GF2E.pyx b/src/sage/libs/ntl/ntl_mat_GF2E.pyx index 123dc81e3c0..23c998a6e84 100644 --- a/src/sage/libs/ntl/ntl_mat_GF2E.pyx +++ b/src/sage/libs/ntl/ntl_mat_GF2E.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = ntl gmp m +# distutils: language = c++ + #***************************************************************************** # Copyright (C) 2005 William Stein # diff --git a/src/sage/libs/ntl/ntl_mat_ZZ.pyx b/src/sage/libs/ntl/ntl_mat_ZZ.pyx index 2fa8e3e7487..faeb3a1a552 100644 --- a/src/sage/libs/ntl/ntl_mat_ZZ.pyx +++ b/src/sage/libs/ntl/ntl_mat_ZZ.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = ntl gmp m +# distutils: language = c++ + #***************************************************************************** # Copyright (C) 2005 William Stein # From a4d04d34ebec904216fa846f25b03d8a15a996bd Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 17 May 2020 21:37:06 -0700 Subject: [PATCH 04/14] src/sage/modular: Move Extension options from src/module_list.py to distutils directives --- src/module_list.py | 40 +-------------------------- src/sage/modular/modsym/apply.pyx | 2 ++ src/sage/modular/modsym/heilbronn.pyx | 2 ++ src/sage/modular/modsym/p1list.pyx | 3 ++ 4 files changed, 8 insertions(+), 39 deletions(-) diff --git a/src/module_list.py b/src/module_list.py index 1125f73b3ec..3a80eb9a8a9 100644 --- a/src/module_list.py +++ b/src/module_list.py @@ -768,45 +768,7 @@ def uname_specific(name, value, alternative): ## ################################ - Extension('sage.modular.arithgroup.congroup', - sources = ['sage/modular/arithgroup/congroup.pyx']), - - Extension('sage.modular.arithgroup.farey_symbol', - sources = ['sage/modular/arithgroup/farey_symbol.pyx']), - - Extension('sage.modular.arithgroup.arithgroup_element', - sources = ['sage/modular/arithgroup/arithgroup_element.pyx']), - - Extension('sage.modular.hypergeometric_misc', - sources = ['sage/modular/hypergeometric_misc.pyx']), - - Extension('sage.modular.modform.eis_series_cython', - sources = ['sage/modular/modform/eis_series_cython.pyx']), - - Extension('sage.modular.modform.l_series_gross_zagier_coeffs', - sources = ['sage/modular/modform/l_series_gross_zagier_coeffs.pyx']), - - Extension('sage.modular.modsym.apply', - sources = ['sage/modular/modsym/apply.pyx'], - extra_compile_args=["-D_XPG6"]), - - Extension('sage.modular.modsym.manin_symbol', - sources = ['sage/modular/modsym/manin_symbol.pyx']), - - Extension('sage.modular.modsym.relation_matrix_pyx', - sources = ['sage/modular/modsym/relation_matrix_pyx.pyx']), - - Extension('sage.modular.modsym.heilbronn', - sources = ['sage/modular/modsym/heilbronn.pyx'], - extra_compile_args=["-D_XPG6"]), - - Extension('sage.modular.modsym.p1list', - sources = ['sage/modular/modsym/p1list.pyx']), - - Extension('sage.modular.pollack_stevens.dist', - sources = ['sage/modular/pollack_stevens/dist.pyx'], - libraries = ["gmp", "zn_poly"], - extra_compile_args = ["-D_XPG6"]), + Extension('*', ['sage/modular/**/*.pyx']), ################################ ## diff --git a/src/sage/modular/modsym/apply.pyx b/src/sage/modular/modsym/apply.pyx index a4a1bf6470b..ff22f208c00 100644 --- a/src/sage/modular/modsym/apply.pyx +++ b/src/sage/modular/modsym/apply.pyx @@ -1,3 +1,5 @@ +# distutils: extra_compile_args = -D_XPG6 + """ Monomial expansion of `(aX + bY)^i (cX + dY)^{j-i}` """ diff --git a/src/sage/modular/modsym/heilbronn.pyx b/src/sage/modular/modsym/heilbronn.pyx index 823458318e3..b5d04dab169 100644 --- a/src/sage/modular/modsym/heilbronn.pyx +++ b/src/sage/modular/modsym/heilbronn.pyx @@ -1,3 +1,5 @@ +# distutils: extra_compile_args = -D_XPG6 + """ Heilbronn matrix computation """ diff --git a/src/sage/modular/modsym/p1list.pyx b/src/sage/modular/modsym/p1list.pyx index 841b920f68e..3e0b6d25421 100644 --- a/src/sage/modular/modsym/p1list.pyx +++ b/src/sage/modular/modsym/p1list.pyx @@ -1,3 +1,6 @@ +# distutils: libraries = gmp zn_poly +# distutils: extra_compile_args = -D_XPG6 + r""" Lists of Manin symbols (elements of `\mathbb{P}^1(\ZZ/N\ZZ)`) over `\QQ` """ From 17ca1d722dde4293be7daca9043a2d4dce9a03fc Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 17 May 2020 22:08:34 -0700 Subject: [PATCH 05/14] src/sage/env.py (cython_aliases): Add aliases for libraries use in module_list.py --- src/sage/env.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/sage/env.py b/src/sage/env.py index 18d86fe6c49..4c290c38931 100644 --- a/src/sage/env.py +++ b/src/sage/env.py @@ -413,10 +413,18 @@ def cython_aliases(): aliases = {} - for lib in ['fflas-ffpack', 'givaro', 'gsl', 'linbox', 'Singular']: + for lib in ['fflas-ffpack', 'givaro', 'gsl', 'linbox', 'Singular', + 'libpng', 'gdlib', 'm4ri', 'zlib', 'cblas', 'lapack']: var = lib.upper().replace("-", "") + "_" aliases[var + "CFLAGS"] = pkgconfig.cflags(lib).split() - pc = pkgconfig.parse(lib) + if lib == 'zlib': + try: + pc = pkgconfig.parse('zlib') + except pkgconfig.PackageNotFoundError: + from collections import defaultdict + pc = defaultdict(list, {'libraries': ['z']}) + else: + pc = pkgconfig.parse(lib) # INCDIR should be redundant because the -I options are also # passed in CFLAGS aliases[var + "INCDIR"] = pc['include_dirs'] @@ -434,4 +442,14 @@ def cython_aliases(): # fflas-ffpack and fflas-ffpack does add such a C++11 flag. aliases["LINBOX_CFLAGS"].append("-std=gnu++11") aliases["ARB_LIBRARY"] = ARB_LIBRARY + + # TODO: Remove Cygwin hack by installing a suitable cblas.pc + if os.path.exists('/usr/lib/libblas.dll.a'): + aliases["CBLAS_LIBS"] = ['gslcblas'] + + try: + aliases["M4RI_CFLAGS"].remove("-pedantic") + except ValueError: + pass + return aliases From 346bd8887cc45d189a17174107291c72e8b9ad6a Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 17 May 2020 22:09:00 -0700 Subject: [PATCH 06/14] src/sage/modules: Move Extension options from src/module_list.py to distutils directives --- src/module_list.py | 46 +------------------------- src/sage/modules/vector_mod2_dense.pyx | 5 +++ 2 files changed, 6 insertions(+), 45 deletions(-) diff --git a/src/module_list.py b/src/module_list.py index 3a80eb9a8a9..743e83573ce 100644 --- a/src/module_list.py +++ b/src/module_list.py @@ -776,51 +776,7 @@ def uname_specific(name, value, alternative): ## ################################ - Extension('sage.modules.vector_rational_sparse', - sources = ['sage/modules/vector_rational_sparse.pyx']), - - Extension('sage.modules.vector_integer_sparse', - sources = ['sage/modules/vector_integer_sparse.pyx']), - - Extension('sage.modules.vector_modn_sparse', - sources = ['sage/modules/vector_modn_sparse.pyx']), - - Extension('sage.modules.finite_submodule_iter', - sources = ['sage/modules/finite_submodule_iter.pyx']), - - Extension('sage.modules.free_module_element', - sources = ['sage/modules/free_module_element.pyx']), - - Extension('sage.modules.module', - sources = ['sage/modules/module.pyx']), - - Extension('sage.modules.vector_complex_double_dense', - ['sage/modules/vector_complex_double_dense.pyx']), - - Extension('sage.modules.vector_double_dense', - ['sage/modules/vector_double_dense.pyx']), - - Extension('sage.modules.vector_integer_dense', - sources = ['sage/modules/vector_integer_dense.pyx']), - - Extension('sage.modules.vector_modn_dense', - sources = ['sage/modules/vector_modn_dense.pyx']), - - Extension('sage.modules.vector_mod2_dense', - sources = ['sage/modules/vector_mod2_dense.pyx'], - libraries = m4ri_libs + gd_libs + png_libs, - library_dirs = m4ri_library_dirs + gd_library_dirs + png_library_dirs, - include_dirs = m4ri_include_dirs + gd_include_dirs + png_include_dirs, - extra_compile_args = m4ri_extra_compile_args), - - Extension('sage.modules.vector_rational_dense', - sources = ['sage/modules/vector_rational_dense.pyx']), - - Extension('sage.modules.vector_real_double_dense', - ['sage/modules/vector_real_double_dense.pyx']), - - Extension('sage.modules.with_basis.indexed_element', - sources = ['sage/modules/with_basis/indexed_element.pyx']), + Extension('*', ['sage/modules/**/*.pyx']), ################################ ## diff --git a/src/sage/modules/vector_mod2_dense.pyx b/src/sage/modules/vector_mod2_dense.pyx index 3c12d9e7c1a..026beb08a21 100644 --- a/src/sage/modules/vector_mod2_dense.pyx +++ b/src/sage/modules/vector_mod2_dense.pyx @@ -1,3 +1,8 @@ +# distutils: libraries = M4RI_LIBRARIES GDLIB_LIBRARIES LIBPNG_LIBRARIES +# distutils: library_dirs = M4RI_LIBDIR GDLIB_LIBDIR LIBPNG_LIBDIR +# distutils: include_dirs = M4RI_INCDIR GDLIB_INCDIR LIBPNG_INCDIR +# distutils: extra_compile_args = M4RI_CFLAGS + """ Vectors with elements in GF(2) From 70901ea558546af579693dc17775774922ec7e93 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 17 May 2020 22:54:35 -0700 Subject: [PATCH 07/14] src/sage/env.py (cython_aliases): Update doctest --- src/sage/env.py | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/src/sage/env.py b/src/sage/env.py index 4c290c38931..2bd582c82b1 100644 --- a/src/sage/env.py +++ b/src/sage/env.py @@ -383,31 +383,9 @@ def cython_aliases(): {...} sage: sorted(cython_aliases().keys()) ['ARB_LIBRARY', - 'FFLASFFPACK_CFLAGS', - 'FFLASFFPACK_INCDIR', - 'FFLASFFPACK_LIBDIR', - 'FFLASFFPACK_LIBEXTRA', - 'FFLASFFPACK_LIBRARIES', - 'GIVARO_CFLAGS', - 'GIVARO_INCDIR', - 'GIVARO_LIBDIR', - 'GIVARO_LIBEXTRA', - 'GIVARO_LIBRARIES', - 'GSL_CFLAGS', - 'GSL_INCDIR', - 'GSL_LIBDIR', - 'GSL_LIBEXTRA', - 'GSL_LIBRARIES', - 'LINBOX_CFLAGS', - 'LINBOX_INCDIR', - 'LINBOX_LIBDIR', - 'LINBOX_LIBEXTRA', - 'LINBOX_LIBRARIES', - 'SINGULAR_CFLAGS', - 'SINGULAR_INCDIR', - 'SINGULAR_LIBDIR', - 'SINGULAR_LIBEXTRA', - 'SINGULAR_LIBRARIES'] + 'CBLAS_CFLAGS', + ..., + 'ZLIB_LIBRARIES'] """ import pkgconfig From eed920e167d058b188142612a1f0b8ae670b64bd Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 20 May 2020 21:56:53 -0700 Subject: [PATCH 08/14] src/sage/tests: Move Extension options from src/module_list.py to distutils directives --- src/module_list.py | 6 +----- src/sage/tests/stl_vector.pyx | 2 ++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/module_list.py b/src/module_list.py index 743e83573ce..d578441d7c9 100644 --- a/src/module_list.py +++ b/src/module_list.py @@ -1411,10 +1411,6 @@ def uname_specific(name, value, alternative): ## ################################ - Extension('sage.tests.stl_vector', - sources = ['sage/tests/stl_vector.pyx'], - language = 'c++'), + Extension('*', ['sage/tests/**/*.pyx']) - Extension('sage.tests.cython', - sources = ['sage/tests/cython.pyx']), ] diff --git a/src/sage/tests/stl_vector.pyx b/src/sage/tests/stl_vector.pyx index 5eb733dacd3..f3b29b30dfe 100644 --- a/src/sage/tests/stl_vector.pyx +++ b/src/sage/tests/stl_vector.pyx @@ -1,3 +1,5 @@ +# distutils: language = c++ + """ Example of a class wrapping an STL vector From 0d25d1d82c02eb94369326ab345101799488cf9d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 20 May 2020 21:58:52 -0700 Subject: [PATCH 09/14] src/sage/structure: Move Extension options from src/module_list.py to distutils directives --- src/module_list.py | 7 ------- src/sage/structure/element.pyx | 6 ++++++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/module_list.py b/src/module_list.py index d578441d7c9..b904c74bd48 100644 --- a/src/module_list.py +++ b/src/module_list.py @@ -1388,13 +1388,6 @@ def uname_specific(name, value, alternative): ## ################################ - # Compile this with -Os because it works around a bug with - # GCC-4.7.3 + Cython 0.19 on Itanium, see Trac #14452. Moreover, it - # actually results in faster code than -O3. - Extension('sage.structure.element', - sources = ['sage/structure/element.pyx'], - extra_compile_args=["-Os"]), - Extension('*', ['sage/structure/*.pyx']), ################################ diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx index a5fbd555f2d..7e2c1cbed56 100644 --- a/src/sage/structure/element.pyx +++ b/src/sage/structure/element.pyx @@ -1,3 +1,9 @@ +# Compile this with -Os because it works around a bug with +# GCC-4.7.3 + Cython 0.19 on Itanium, see Trac #14452. Moreover, it +# actually results in faster code than -O3. +# +# distutils: extra_compile_args = -Os + r""" Elements From 808f46abbbbfcddfee56d72399ab23107301dd57 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 20 May 2020 22:01:27 -0700 Subject: [PATCH 10/14] src/sage/stats: Move Extension options from src/module_list.py to distutils directives --- src/module_list.py | 20 +------------------ .../discrete_gaussian_integer.pyx | 5 +++++ 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/module_list.py b/src/module_list.py index b904c74bd48..6939eaab87e 100644 --- a/src/module_list.py +++ b/src/module_list.py @@ -1362,25 +1362,7 @@ def uname_specific(name, value, alternative): ## ################################ - Extension('sage.stats.hmm.util', - sources = ['sage/stats/hmm/util.pyx']), - - Extension('sage.stats.hmm.distributions', - sources = ['sage/stats/hmm/distributions.pyx']), - - Extension('sage.stats.hmm.hmm', - sources = ['sage/stats/hmm/hmm.pyx']), - - Extension('sage.stats.hmm.chmm', - sources = ['sage/stats/hmm/chmm.pyx']), - - Extension('sage.stats.intlist', - sources = ['sage/stats/intlist.pyx']), - - Extension('sage.stats.distributions.discrete_gaussian_integer', - sources = ['sage/stats/distributions/discrete_gaussian_integer.pyx', 'sage/stats/distributions/dgs_gauss_mp.c', 'sage/stats/distributions/dgs_gauss_dp.c', 'sage/stats/distributions/dgs_bern.c'], - depends = ['sage/stats/distributions/dgs_gauss.h', 'sage/stats/distributions/dgs_bern.h', 'sage/stats/distributions/dgs_misc.h'], - extra_compile_args = ["-D_XOPEN_SOURCE=600"]), + Extension('*', ['sage/stats/**/*.pyx']), ################################ ## diff --git a/src/sage/stats/distributions/discrete_gaussian_integer.pyx b/src/sage/stats/distributions/discrete_gaussian_integer.pyx index ac0804b0584..2906b660802 100644 --- a/src/sage/stats/distributions/discrete_gaussian_integer.pyx +++ b/src/sage/stats/distributions/discrete_gaussian_integer.pyx @@ -1,4 +1,9 @@ # -*- coding: utf-8 -*- +# +# distutils: sources = sage/stats/distributions/discrete_gaussian_integer.pyx sage/stats/distributions/dgs_gauss_mp.c sage/stats/distributions/dgs_gauss_dp.c sage/stats/distributions/dgs_bern.c +# distutils: depends = sage/stats/distributions/dgs_gauss.h sage/stats/distributions/dgs_bern.h sage/stats/distributions/dgs_misc.h +# distutils: extra_compile_args = -D_XOPEN_SOURCE=600 + r""" Discrete Gaussian Samplers over the Integers From 10f754224ab62457353dc4385468ef47af413db5 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 20 May 2020 22:06:48 -0700 Subject: [PATCH 11/14] src/sage/schemes: Move Extension options from src/module_list.py to distutils directives --- src/module_list.py | 26 +------------------ .../elliptic_curves/descent_two_isogeny.pyx | 2 ++ .../hyperelliptic_curves/hypellfrob.pyx | 6 +++++ 3 files changed, 9 insertions(+), 25 deletions(-) diff --git a/src/module_list.py b/src/module_list.py index 6939eaab87e..f4b1e599c02 100644 --- a/src/module_list.py +++ b/src/module_list.py @@ -1322,31 +1322,7 @@ def uname_specific(name, value, alternative): ## ################################ - Extension('sage.schemes.elliptic_curves.descent_two_isogeny', - sources = ['sage/schemes/elliptic_curves/descent_two_isogeny.pyx'], - libraries = ['ratpoints']), - - Extension('sage.schemes.elliptic_curves.period_lattice_region', - sources = ['sage/schemes/elliptic_curves/period_lattice_region.pyx']), - - Extension('sage.schemes.elliptic_curves.mod_sym_num', - sources = ['sage/schemes/elliptic_curves/mod_sym_num.pyx']), - - Extension('sage.schemes.hyperelliptic_curves.hypellfrob', - sources = ['sage/schemes/hyperelliptic_curves/hypellfrob.pyx', - 'sage/schemes/hyperelliptic_curves/hypellfrob/hypellfrob.cpp', - 'sage/schemes/hyperelliptic_curves/hypellfrob/recurrences_ntl.cpp', - 'sage/schemes/hyperelliptic_curves/hypellfrob/recurrences_zn_poly.cpp'], - libraries = ['gmp', 'ntl', 'zn_poly'], - depends = ['sage/schemes/hyperelliptic_curves/hypellfrob/hypellfrob.h', - 'sage/schemes/hyperelliptic_curves/hypellfrob/recurrences_ntl.h', - 'sage/schemes/hyperelliptic_curves/hypellfrob/recurrences_zn_poly.h'], - language = 'c++', - include_dirs = ['sage/libs/ntl/', - 'sage/schemes/hyperelliptic_curves/hypellfrob/']), - - Extension('sage.schemes.toric.divisor_class', - sources = ['sage/schemes/toric/divisor_class.pyx']), + Extension('*', ['sage/schemes/**/*.pyx']), ################################ ## diff --git a/src/sage/schemes/elliptic_curves/descent_two_isogeny.pyx b/src/sage/schemes/elliptic_curves/descent_two_isogeny.pyx index e95cd49c88c..3868c0a73b7 100644 --- a/src/sage/schemes/elliptic_curves/descent_two_isogeny.pyx +++ b/src/sage/schemes/elliptic_curves/descent_two_isogeny.pyx @@ -1,3 +1,5 @@ +# distutils: libraries = ratpoints + r""" Descent on elliptic curves over `\QQ` with a 2-isogeny """ diff --git a/src/sage/schemes/hyperelliptic_curves/hypellfrob.pyx b/src/sage/schemes/hyperelliptic_curves/hypellfrob.pyx index 810f41c767d..1bbba251032 100644 --- a/src/sage/schemes/hyperelliptic_curves/hypellfrob.pyx +++ b/src/sage/schemes/hyperelliptic_curves/hypellfrob.pyx @@ -1,3 +1,9 @@ +# distutils: language = c++ +# distutils: sources = sage/schemes/hyperelliptic_curves/hypellfrob.pyx sage/schemes/hyperelliptic_curves/hypellfrob/hypellfrob.cpp sage/schemes/hyperelliptic_curves/hypellfrob/recurrences_ntl.cpp sage/schemes/hyperelliptic_curves/hypellfrob/recurrences_zn_poly.cpp +# distutils: depends = sage/schemes/hyperelliptic_curves/hypellfrob/hypellfrob.h sage/schemes/hyperelliptic_curves/hypellfrob/recurrences_ntl.h sage/schemes/hyperelliptic_curves/hypellfrob/recurrences_zn_poly.h +# distutils: include_dirs = sage/libs/ntl/ sage/schemes/hyperelliptic_curves/hypellfrob/ +# distutils: libraries = gmp ntl zn_poly + r""" Frobenius on Monsky-Washnitzer cohomology of a hyperelliptic curve over a largish prime finite field From 5867c054f9605ecb740120ef9e22d5e3c9b6a5e2 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 1 Jun 2020 16:57:12 -0700 Subject: [PATCH 12/14] src/sage/modular/pollack_stevens/dist.pyx: Add missing distutils directives --- src/sage/modular/pollack_stevens/dist.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sage/modular/pollack_stevens/dist.pyx b/src/sage/modular/pollack_stevens/dist.pyx index f7025f2dec3..1bcb3406539 100644 --- a/src/sage/modular/pollack_stevens/dist.pyx +++ b/src/sage/modular/pollack_stevens/dist.pyx @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- +# distutils: libraries = gmp zn_poly +# distutils: extra_compile_args = -D_XPG6 """ `p`-adic distributions spaces From c536daa32dcc69adbc7b37d9a170e22fd733bca8 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Mon, 1 Jun 2020 17:09:33 -0700 Subject: [PATCH 13/14] Remove self-listing in distutils sources directive --- src/sage/geometry/triangulation/base.pyx | 2 +- src/sage/schemes/hyperelliptic_curves/hypellfrob.pyx | 2 +- src/sage/stats/distributions/discrete_gaussian_integer.pyx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sage/geometry/triangulation/base.pyx b/src/sage/geometry/triangulation/base.pyx index df958418391..5e062327e23 100644 --- a/src/sage/geometry/triangulation/base.pyx +++ b/src/sage/geometry/triangulation/base.pyx @@ -1,4 +1,4 @@ -# distutils: sources = sage/geometry/triangulation/base.pyx sage/geometry/triangulation/functions.cc sage/geometry/triangulation/data.cc sage/geometry/triangulation/triangulations.cc +# distutils: sources = sage/geometry/triangulation/functions.cc sage/geometry/triangulation/data.cc sage/geometry/triangulation/triangulations.cc # distutils: depends = sage/geometry/triangulation/functions.h sage/geometry/triangulation/data.h sage/geometry/triangulation/triangulations.h # distutils: language = c++ diff --git a/src/sage/schemes/hyperelliptic_curves/hypellfrob.pyx b/src/sage/schemes/hyperelliptic_curves/hypellfrob.pyx index 1bbba251032..f60b85e3bd9 100644 --- a/src/sage/schemes/hyperelliptic_curves/hypellfrob.pyx +++ b/src/sage/schemes/hyperelliptic_curves/hypellfrob.pyx @@ -1,5 +1,5 @@ # distutils: language = c++ -# distutils: sources = sage/schemes/hyperelliptic_curves/hypellfrob.pyx sage/schemes/hyperelliptic_curves/hypellfrob/hypellfrob.cpp sage/schemes/hyperelliptic_curves/hypellfrob/recurrences_ntl.cpp sage/schemes/hyperelliptic_curves/hypellfrob/recurrences_zn_poly.cpp +# distutils: sources = sage/schemes/hyperelliptic_curves/hypellfrob/hypellfrob.cpp sage/schemes/hyperelliptic_curves/hypellfrob/recurrences_ntl.cpp sage/schemes/hyperelliptic_curves/hypellfrob/recurrences_zn_poly.cpp # distutils: depends = sage/schemes/hyperelliptic_curves/hypellfrob/hypellfrob.h sage/schemes/hyperelliptic_curves/hypellfrob/recurrences_ntl.h sage/schemes/hyperelliptic_curves/hypellfrob/recurrences_zn_poly.h # distutils: include_dirs = sage/libs/ntl/ sage/schemes/hyperelliptic_curves/hypellfrob/ # distutils: libraries = gmp ntl zn_poly diff --git a/src/sage/stats/distributions/discrete_gaussian_integer.pyx b/src/sage/stats/distributions/discrete_gaussian_integer.pyx index 2906b660802..ae6ec8a0f6a 100644 --- a/src/sage/stats/distributions/discrete_gaussian_integer.pyx +++ b/src/sage/stats/distributions/discrete_gaussian_integer.pyx @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# distutils: sources = sage/stats/distributions/discrete_gaussian_integer.pyx sage/stats/distributions/dgs_gauss_mp.c sage/stats/distributions/dgs_gauss_dp.c sage/stats/distributions/dgs_bern.c +# distutils: sources = sage/stats/distributions/dgs_gauss_mp.c sage/stats/distributions/dgs_gauss_dp.c sage/stats/distributions/dgs_bern.c # distutils: depends = sage/stats/distributions/dgs_gauss.h sage/stats/distributions/dgs_bern.h sage/stats/distributions/dgs_misc.h # distutils: extra_compile_args = -D_XOPEN_SOURCE=600 From b1b378712d10cb15555889e8235d089f3cf0e391 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 6 Jun 2020 12:09:00 -0700 Subject: [PATCH 14/14] sage.env.cython_aliases: Fix for systems without zlib pc --- src/sage/env.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sage/env.py b/src/sage/env.py index 2bd582c82b1..e32f0c52f9b 100644 --- a/src/sage/env.py +++ b/src/sage/env.py @@ -394,14 +394,15 @@ def cython_aliases(): for lib in ['fflas-ffpack', 'givaro', 'gsl', 'linbox', 'Singular', 'libpng', 'gdlib', 'm4ri', 'zlib', 'cblas', 'lapack']: var = lib.upper().replace("-", "") + "_" - aliases[var + "CFLAGS"] = pkgconfig.cflags(lib).split() if lib == 'zlib': + aliases[var + "CFLAGS"] = "" try: pc = pkgconfig.parse('zlib') except pkgconfig.PackageNotFoundError: from collections import defaultdict pc = defaultdict(list, {'libraries': ['z']}) else: + aliases[var + "CFLAGS"] = pkgconfig.cflags(lib).split() pc = pkgconfig.parse(lib) # INCDIR should be redundant because the -I options are also # passed in CFLAGS