diff --git a/src/module_list.py b/src/module_list.py index bea455a3b90..081ef5bb58b 100644 --- a/src/module_list.py +++ b/src/module_list.py @@ -125,22 +125,7 @@ ## ################################ - 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']), ################################ ## @@ -271,54 +256,7 @@ ## ################################ - 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']), ################################ ## @@ -646,110 +584,7 @@ ## ################################### - 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"]), ################################ ## @@ -922,45 +757,7 @@ ## ################################ - 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']), ################################ ## @@ -968,51 +765,7 @@ ## ################################ - 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']), ################################ ## @@ -1558,31 +1311,7 @@ ## ################################ - 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']), ################################ ## @@ -1598,25 +1327,7 @@ ## ################################ - 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']), ################################ ## @@ -1624,13 +1335,6 @@ ## ################################ - # 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']), ################################ @@ -1647,10 +1351,6 @@ ## ################################ - 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/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 diff --git a/src/sage/env.py b/src/sage/env.py index 1aba25a1ed1..36fe7f8701f 100644 --- a/src/sage/env.py +++ b/src/sage/env.py @@ -383,40 +383,27 @@ 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 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': + 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 aliases[var + "INCDIR"] = pc['include_dirs'] @@ -446,4 +433,14 @@ def uname_specific(name, value, alternative): # 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 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..5e062327e23 100644 --- a/src/sage/geometry/triangulation/base.pyx +++ b/src/sage/geometry/triangulation/base.pyx @@ -1,3 +1,7 @@ +# 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++ + r""" Base classes for triangulations 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 # 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` """ 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 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) 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..f60b85e3bd9 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/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 diff --git a/src/sage/stats/distributions/discrete_gaussian_integer.pyx b/src/sage/stats/distributions/discrete_gaussian_integer.pyx index 4b27cc98e12..6ee3cdb4a00 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/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 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 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