Skip to content

Commit

Permalink
Fix building error if numpy is not installed before
Browse files Browse the repository at this point in the history
  • Loading branch information
jlombacher committed May 23, 2015
1 parent 93377e4 commit ab38f55
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion setup_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,14 @@ def _make_extensions(config):
except EnvironmentError:
pass

settings['include_dirs'] += [numpy.get_include()]
try:
numpy_includes = numpy.get_include()
except AttributeError:
# if numpy is not installed get the headers from the .egg directory
import numpy.core
numpy_includes = os.path.join(os.path.dirname(numpy.core.__file__), 'include')

settings['include_dirs'] += [numpy_includes]
if config.mpi:
import mpi4py
settings['include_dirs'] += [mpi4py.get_include()]
Expand Down

0 comments on commit ab38f55

Please sign in to comment.