From 17ca1d722dde4293be7daca9043a2d4dce9a03fc Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 17 May 2020 22:08:34 -0700 Subject: [PATCH] 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