Skip to content

Commit

Permalink
this works
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermr committed Jul 27, 2023
1 parent a861940 commit b4cdcf8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,6 @@ dmypy.json

# Pyre type checker
.pyre/

# vscode
.vscode/
21 changes: 11 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ def finalize_options(self):
if SYSTEM_FITSIO_LIBDIR is not None:
self.library_dirs.insert(0, SYSTEM_FITSIO_LIBDIR)
else:
# We defer configuration of the bundled cfitsio to build_extensions
# because we will know the compiler there.
self.include_dirs.insert(0, self.cfitsio_build_dir)
# we put our include dir first to avoid other fitsio install's
# header files
self.include_dirs.insert(
0, os.path.join(".", self.cfitsio_build_dir)
)

def run(self):
# For extensions that require 'numpy' in their include dirs,
Expand All @@ -110,13 +112,12 @@ def build_extensions(self):

# Use the compiler for building python to build cfitsio
# for maximized compatibility.
# we put our include dir first to avoid other fitsio install's
# header files
CCold = self.compiler.compiler
self.compiler.compiler = (
[CCold[0]]
+ ["-I%s" % self.cfitsio_build_dir]
+ CCold[1:]

# turns out we need to set the include dirs here too
# directly for the compiler
self.compiler.include_dirs.insert(
0,
os.path.join(".", self.cfitsio_build_dir),
)

CCold = self.compiler.compiler
Expand Down

0 comments on commit b4cdcf8

Please sign in to comment.