Commit 1bd6d51e authored by Maude Le Jeune's avatar Maude Le Jeune
Browse files

find numpy core header

parent b25895b1
......@@ -11,7 +11,7 @@ def options(ctx):
ctx.add_option('--healpix_prefix', action='store', default='/usr/local', help='healpix location')
ctx.add_option('--with_gsl', action='store', default='/usr', help='location of gsl')
ctx.add_option('--with_fftw3', action='store', default='/usr', help='location of fftw3')
ctx.add_option('--with_numpy_core', action='store', default='/usr/lib64/python2.6/site-packages/numpy/core', help='location of numpy core headers')
ctx.add_option('--with_numpy_core', action='store', default=None, help='location of numpy core headers')
ctx.tool_options('compiler_cxx')
ctx.tool_options('python')
......@@ -43,6 +43,16 @@ def configure(ctx):
ctx.check(header_name=['fitsio.h'],compile_mode='cxx', mandatory=True)
ctx.check_cxx(lib=['cfitsio'], libpath=ctx.env["CFITSIO_EXT_LIB"], uselib_store='cfitsio', mandatory=True)
ctx.check_python_module('numpy')
if not Options.options.with_numpy_core:
import os.path as path
try:
nppath = ctx.get_python_variables(["numpy.__file__"], imports=["import numpy"])
nppath = path.join(nppath[0].split("__init__.py")[0], "core")
Options.options.with_numpy_core = nppath
except:
ctx.fatal('→ can\'t find numpy core headers')
ctx.env['CXXFLAGS'].append("-I"+str(Options.options.with_gsl)+"/include")
ctx.env['CXXFLAGS'].append("-I"+str(Options.options.with_fftw3)+"/include")
ctx.env['CXXFLAGS'].append("-I"+str(Options.options.with_numpy_core)+"/include")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment