Changeset 1873
- Timestamp:
- 08/13/10 15:03:53 (14 years ago)
- Location:
- trunk
- Files:
-
- 2 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) -
trunk/src/SConscript
r1819 r1873 8 8 cpps = env.SGlob("*.cpp") 9 9 pycpps = env.SGlob("python_*.cpp") 10 for pf in pycpps: cpps.remove(pf) 10 for pf in pycpps: 11 cpps.remove(pf) 11 12 12 13 # location of libcasav.a … … 18 19 myenv.Prepend( LIBS = ['asap'] ) 19 20 21 shenv = myenv.Clone() 22 pyrapdir = shenv.get("pyrapint", None) 23 if pyrapdir: 24 shenv.PrependUnique(CPPPATH=pyrapdir) 25 pycpps += shenv.Glob('%s/pyrap/*/*.cc' % pyrapdir) 20 26 # Finally create the library for the module 21 if not hasattr( myenv, "LoadableModule"):22 myenv.LoadableModule = myenv.SharedLibrary23 so = myenv.LoadableModule( target = "_asap.so", source = pycpps, SHLIBSUFFIX="" )24 #test = myenv.Program("test", cpps)27 if not hasattr(shenv, "LoadableModule"): 28 shenv.LoadableModule = shenv.SharedLibrary 29 so = shenv.LoadableModule( target = "_asap.so", source = pycpps, SHLIBSUFFIX="" ) 30 #test = shenv.Program("test", cpps) 25 31 Return("so") 26 32
Note:
See TracChangeset
for help on using the changeset viewer.