Changeset 1873 for trunk/SConstruct
- Timestamp:
- 08/13/10 15:03:53 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SConstruct
r1819 r1873 4 4 import platform 5 5 import SCons 6 7 # try to autodetect numpy 8 def get_numpy_incdir(): 9 try: 10 # try to find an egg 11 from pkg_resources import require 12 tmp = require("numpy") 13 import numpy 14 return numpy.__path__[0]+"/core/include" 15 except Exception: 16 # now try standard package 17 try: 18 import numpy 19 return numpy.__path__[0]+"/core/include" 20 except ImportError: 21 pass 22 return "" 6 23 7 24 moduledir = distutils.sysconfig.get_python_lib() … … 58 75 ("pyraproot", "The root directory where libpyrap is installed", 59 76 None), 77 ("numpyincdir", "numpy header file directory", 78 get_numpy_incdir()), 60 79 ("pyraplib", "The name of the pyrap library", "pyrap"), 61 80 ("pyraplibdir", "The directory where libpyrap is installed", … … 128 147 129 148 conf.env.AddCustomPackage('pyrap') 130 if conf.env.get("enable_pyrap") and conf.CheckLib(conf.env["pyraplib"], 131 language='c++', 132 autoadd=0): 149 if conf.CheckLib(conf.env["pyraplib"], language='c++', autoadd=0): 133 150 conf.env.Append(CPPFLAGS=['-DHAVE_PYRAP']) 134 151 conf.env.PrependUnique(LIBS=env['pyraplib']) 135 152 else: 153 conf.env.AppendUnique(CPPPATH=[conf.env["numpyincdir"]]) 154 # numpy 1.0 uses config.h; numpy >= 1.1 uses numpyconfig.h 155 if conf.CheckHeader("numpy/config.h") or \ 156 conf.CheckHeader("numpy/numpyconfig.h"): 157 conf.env.Append(CPPDEFINES=["-DAIPS_USENUMPY"]) 158 else: 159 conf.env.Exit(1) 160 # compile in pyrap here... 161 conf.env["pyrapint"] = "#/external/libpyrap/pyrap-0.3.2" 136 162 # test for cfitsio 137 163 if not conf.CheckLib("m"): Exit(1)
Note:
See TracChangeset
for help on using the changeset viewer.