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

Commit

Permalink
sage.env.sage_include_directories: Append sysconfig variable INCLUDEPY
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Sep 26, 2022
1 parent 9a77a81 commit e2688ef
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/sage/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,14 +383,20 @@ def sage_include_directories(use_sources=False):
sage: any(os.path.isfile(os.path.join(d, file)) for d in dirs)
True
"""
TOP = SAGE_SRC if use_sources else SAGE_LIB

dirs = [TOP]
if use_sources:
dirs = [SAGE_SRC]
else:
import sage
dirs = [os.path.dirname(directory)
for directory in sage.__path__]
try:
import numpy
dirs.insert(1, numpy.get_include())
dirs.append(numpy.get_include())
except ModuleNotFoundError:
pass

dirs.append(sysconfig.get_config_var('INCLUDEPY'))

return dirs

def get_cblas_pc_module_name() -> str:
Expand Down

0 comments on commit e2688ef

Please sign in to comment.