Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge branch 't/29785/move_extension_options_from_src_module_list_py_…
Browse files Browse the repository at this point in the history
…to__distutils___directives_in_the_individual_files__part_3__get_rid_of_uname_specific_' into t/29847/install_sage_setup_with_pip__move_sage_include_directories__cython_aliases_from_sage_env_to_sage_setup
  • Loading branch information
Matthias Koeppe committed Jun 13, 2020
2 parents 8a41326 + 2ba1d7b commit bb6cc0c
Show file tree
Hide file tree
Showing 41 changed files with 170 additions and 348 deletions.
329 changes: 9 additions & 320 deletions src/module_list.py

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/sage/algebras/quatalg/quaternion_algebra_cython.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: language = c++
# distutils: libraries = gmp m ntl
"""
Optimized Cython code needed by quaternion algebras
Expand Down
2 changes: 2 additions & 0 deletions src/sage/algebras/quatalg/quaternion_algebra_element.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: language = c++
# distutils: libraries = gmp m ntl
"""
Elements of Quaternion Algebras
Expand Down
65 changes: 37 additions & 28 deletions src/sage/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,47 +381,46 @@ 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']
aliases[var + "LIBDIR"] = pc['library_dirs']
aliases[var + "LIBEXTRA"] = list(filter(lambda s: not s.startswith(('-l','-L')), pkgconfig.libs(lib).split()))
aliases[var + "LIBRARIES"] = pc['libraries']

# uname-specific flags
UNAME = os.uname()

def uname_specific(name, value, alternative):
if name in UNAME[0]:
return value
else:
return alternative

aliases["LINUX_NOEXECSTACK"] = uname_specific("Linux", ["-Wl,-z,noexecstack"],
[])

# LinBox needs special care because it actually requires C++11 with
# GNU extensions: -std=c++11 does not work, you need -std=gnu++11
# (this is true at least with GCC 7.2.0).
Expand All @@ -432,4 +431,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
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/sage/geometry/triangulation/base.pyx
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/sage/libs/libecm.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: libraries = ecm
# distutils: extra_link_args = LINUX_NOEXECSTACK
r"""
The Elliptic Curve Method for Integer Factorization (ECM)
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/convert.pyx
Original file line number Diff line number Diff line change
@@ -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
"""
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/error.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# distutils: libraries = ntl gmp
# distutils: language = c++

"""
NTL error handler
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/ntl_GF2.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# distutils: libraries = ntl gmp
# distutils: language = c++

#*****************************************************************************
# Copyright (C) 2007 Martin Albrecht <[email protected]>
#
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/ntl_GF2E.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++

#*****************************************************************************
# Copyright (C) 2005 William Stein <[email protected]>
# Copyright (C) 2007 Martin Albrecht <[email protected]>
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/ntl_GF2EContext.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++

#*****************************************************************************
# Copyright (C) 2005 William Stein <[email protected]>
#
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/ntl_GF2EX.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++

#*****************************************************************************
# Copyright (C) 2005 William Stein <[email protected]>
#
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/ntl_GF2X.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++

# ****************************************************************************
# Copyright (C) 2005 William Stein <[email protected]>
# Copyright (C) 2007 Martin Albrecht <[email protected]>
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/ntl_ZZ.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++

#*****************************************************************************
# Copyright (C) 2005 William Stein <[email protected]>
#
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/ntl_ZZX.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++

#*****************************************************************************
# Copyright (C) 2005 William Stein <[email protected]>
#
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/ntl_ZZ_p.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++

#*****************************************************************************
# Copyright (C) 2005 William Stein <[email protected]>
#
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/ntl_ZZ_pContext.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++

#*****************************************************************************
# Copyright (C) 2005 William Stein <[email protected]>
#
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/ntl_ZZ_pE.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++

#*****************************************************************************
# Copyright (C) 2005 William Stein <[email protected]>
#
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/ntl_ZZ_pEContext.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++

#*****************************************************************************
# Copyright (C) 2005 William Stein <[email protected]>
#
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/ntl_ZZ_pEX.pyx
Original file line number Diff line number Diff line change
@@ -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.$
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/ntl_ZZ_pX.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++

# ****************************************************************************
# Copyright (C) 2005 William Stein <[email protected]>
#
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/ntl_lzz_p.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++

"""
ntl_lzz_p.pyx
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/ntl_lzz_pContext.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++

#*****************************************************************************
# Copyright (C) 2005 William Stein <[email protected]>
#
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/ntl_lzz_pX.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++

"""
ntl_lzz_pX.pyx
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/ntl_mat_GF2.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++

"""
Matrices over the $\GF{2}$ via NTL
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/ntl_mat_GF2E.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++

#*****************************************************************************
# Copyright (C) 2005 William Stein <[email protected]>
#
Expand Down
3 changes: 3 additions & 0 deletions src/sage/libs/ntl/ntl_mat_ZZ.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# distutils: libraries = ntl gmp m
# distutils: language = c++

#*****************************************************************************
# Copyright (C) 2005 William Stein <[email protected]>
#
Expand Down
2 changes: 2 additions & 0 deletions src/sage/modular/modsym/apply.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: extra_compile_args = -D_XPG6

"""
Monomial expansion of `(aX + bY)^i (cX + dY)^{j-i}`
"""
Expand Down
2 changes: 2 additions & 0 deletions src/sage/modular/modsym/heilbronn.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: extra_compile_args = -D_XPG6

"""
Heilbronn matrix computation
"""
Expand Down
3 changes: 3 additions & 0 deletions src/sage/modular/modsym/p1list.pyx
Original file line number Diff line number Diff line change
@@ -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`
"""
Expand Down
2 changes: 2 additions & 0 deletions src/sage/modular/pollack_stevens/dist.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
# distutils: libraries = gmp zn_poly
# distutils: extra_compile_args = -D_XPG6
"""
`p`-adic distributions spaces
Expand Down
5 changes: 5 additions & 0 deletions src/sage/modules/vector_mod2_dense.pyx
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/sage/schemes/elliptic_curves/descent_two_isogeny.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: libraries = ratpoints

r"""
Descent on elliptic curves over `\QQ` with a 2-isogeny
"""
Expand Down
6 changes: 6 additions & 0 deletions src/sage/schemes/hyperelliptic_curves/hypellfrob.pyx
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/sage/stats/distributions/discrete_gaussian_integer.pyx
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/sage/structure/element.pyx
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/sage/tests/stl_vector.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# distutils: language = c++

"""
Example of a class wrapping an STL vector
Expand Down

0 comments on commit bb6cc0c

Please sign in to comment.