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

Commit

Permalink
sage.env.cython_aliases: Do not fail if one of the listed libraries i…
Browse files Browse the repository at this point in the history
…s not known to pkgconfig
  • Loading branch information
tobiasdiez authored and mkoeppe committed Mar 22, 2021
1 parent 5cb72aa commit 4f42440
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/sage/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,15 @@ def cython_aliases():
pc = defaultdict(list, {'libraries': ['z']})
libs = "-lz"
else:
aliases[var + "CFLAGS"] = pkgconfig.cflags(lib).split()
pc = pkgconfig.parse(lib)
libs = pkgconfig.libs(lib)
try:
aliases[var + "CFLAGS"] = pkgconfig.cflags(lib).split()
pc = pkgconfig.parse(lib)
libs = pkgconfig.libs(lib)
except pkgconfig.PackageNotFoundError:
from distutils import log
log.warn('Package {0} not installed'.format(lib))
continue

# It may seem that INCDIR is redundant because the -I options are also
# passed in CFLAGS. However, "extra_compile_args" are put at the end
# of the compiler command line. "include_dirs" go to the front; the
Expand Down Expand Up @@ -454,7 +460,9 @@ def uname_specific(name, value, alternative):
# file (possibly because of confusion between CFLAGS and CXXFLAGS?).
# This is not a problem in practice since LinBox depends on
# fflas-ffpack and fflas-ffpack does add such a C++11 flag.
aliases["LINBOX_CFLAGS"].append("-std=gnu++11")
if "LINBOX_CFLAGS" in aliases:
aliases["LINBOX_CFLAGS"].append("-std=gnu++11")

aliases["ARB_LIBRARY"] = ARB_LIBRARY

# TODO: Remove Cygwin hack by installing a suitable cblas.pc
Expand All @@ -463,7 +471,7 @@ def uname_specific(name, value, alternative):

try:
aliases["M4RI_CFLAGS"].remove("-pedantic")
except ValueError:
except (ValueError, KeyError):
pass

# Determine ecl-specific compiler arguments using the ecl-config script
Expand Down

0 comments on commit 4f42440

Please sign in to comment.