Changeset 2517


Ignore:
Timestamp:
05/15/12 15:17:10 (13 years ago)
Author:
Malte Marquarding
Message:

More updates to get a distutils/scons build going

Location:
trunk
Files:
2 deleted
3 edited
3 moved

Legend:

Unmodified
Added
Removed
  • trunk/SConstruct

    r2510 r2517  
    2121            pass
    2222    return ""
     23
     24def get_libdir():
     25    return os.path.basename(distutils.sysconfig.get_config_var('LIBDIR'))
     26
     27LIBDIR = "lib' #get_libdir()
    2328
    2429EnsureSConsVersion(1,0,0)
     
    127132    else:
    128133        conf.env.AppendUnique(CPPPATH=[conf.env["numpyincdir"]])
    129         # numpy 1.0 uses config.h; numpy >= 1.1 uses numpyconfig.h
    130134        if conf.CheckHeader("numpy/numpyconfig.h"):
    131135            conf.env.Append(CPPDEFINES=["-DAIPS_USENUMPY"])
     
    136140    conf.env.Append(CPPFLAGS=['-DHAVE_LIBPYRAP'])
    137141
     142    if not conf.CheckLib("m"):
     143        Exit(1)
    138144    # test for cfitsio
    139     if not conf.CheckLib("m"): Exit(1)
    140145    conf.env.AddCustomPackage('cfitsio')
    141146    libname = conf.env["cfitsiolib"]
    142     if libname.find(".") > -1 and os.path.exists(libname):
    143         conf.env.AppendUnique(LIBS=[env.File(libname)])
    144     else:
    145         if not conf.CheckLibWithHeader(libname,
    146                                        'fitsio.h', language='c'):
     147    if not conf.CheckHeader("fitsio.h"):
     148        #SuSE is being special
     149        conf.env.AppendUnique(CPPPATH=['/usr/include/libcfitsio0'])
     150        if not conf.CheckHeader("fitsio.h"):
     151            Exit(1)
     152    if libname.find(".") > -1 and os.path.exists(libname):
     153        conf.env.AppendUnique(LIBS=[env.File(libname)])
     154    else:
     155        if not conf.CheckLib(libname, language='c'):
    147156            Exit(1)
    148157    conf.env.AddCustomPackage('wcs')
     
    156165
    157166    conf.env.AddCustomPackage('rpfits')
    158     if not conf.CheckLib(conf.env["rpfitslib"], language="c"):
     167    if not conf.CheckLibWithHeader(conf.env["rpfitslib"], "RPFITS.h",
     168                                   language="c"):
    159169        Exit(1)
    160170   
     
    163173        pth = os.path.join(p, "include", "casacore")       
    164174        if os.path.exists(pth):
    165             libpth = os.path.join(p, "lib")
     175            libpth = os.path.join(p, LIBDIR)
    166176            conf.env.AppendUnique(CPPPATH=[pth])
    167177            break
     
    169179              "casa_coordinates", "casa_lattices",
    170180              "casa_fits", "casa_measures", "casa_scimath",
    171               "casa_scimath_f", "casa_tables",
    172               "casa_mirlib", "casa_casa"]
     181              "casa_scimath_f", "casa_tables", "casa_casa"]
    173182    if conf.env["casacorestatic"]:
    174183        libs = [ env.File(os.path.join(libpth, "lib"+lib+".a")) \
  • trunk/examples/waterfall.py

    r1415 r2517  
    1010scan = scantable("../test/data/tid-t002.rpf", average=False)
    1111print scan
     12
    1213# select only one IF/Pol/Beam
    13 sel = selector()
    14 sel.set_ifs(0)
    15 sel.set_polarisations(0)
    16 sel.set_beams(0)
    17 scan.set_selection(sel)
     14scan.set_selection(ifs=0, beams=0, pols=0)
    1815
    1916# plot in GHz
     
    5047xyplotter.ylabel("Obs. Time")
    5148
    52 #xyplotter.savefig("test.ps",orientation="landscape")
     49xyplotter.savefig("test.png",orientation="landscape")
  • trunk/scons/utils.py

    r1465 r2517  
    44import re
    55import platform
     6
     7def get_libdir():
     8    import distutils.sysconfig
     9    return os.path.basename(distutils.sysconfig.get_config_var('LIBDIR'))
     10
     11LIBDIR = "lib" #get_libdir()
    612
    713def generate(env):
     
    3339            env.Exit(1)
    3440        env.PrependUnique(CPPPATH = [os.path.join(path, "include")])
    35         env.PrependUnique(LIBPATH = [os.path.join(path, "lib")])
     41        env.PrependUnique(LIBPATH = [os.path.join(path, LIBDIR)])
    3642    env.AddCustomPath = AddCustomPath
    3743
     
    4652        if pkgroot is not None:
    4753            incd = os.path.join(pkgroot, "include")
    48             libd = os.path.join(pkgroot, "lib")
     54            libd = os.path.join(pkgroot, LIBDIR)
    4955        else:       
    5056            if pkgincd is not None:
  • trunk/scons_ext.py

    r2515 r2517  
    1919              'Prefix for cfitsio installation location'),
    2020             ('cfitsiolib=', None, 'Name of the cfitsio library'),
     21             ('cfitsioincdir=', None, 'The custom cfitsio include dir'),
    2122             ('wcsroot=', None, 'Prefix for wcslib installation location'),
    2223             ('wcslib=', None, 'Name of the wcs library'),
     
    4950        self.cfitsioroot = None
    5051        self.cfitsiolib = None
     52        self.cfitsioincdir = None
    5153        self.wcsroot = None
    5254        self.wcslib = None
     
    6062        build_ext.build_ext.finalize_options(self)
    6163        for opt in self.user_options:
    62             atr = opt[0].strip("=")
    63             v = getattr(self, atr)
     64            attr = opt[0].strip("=")
     65            v = getattr(self, attr)
    6466            if v is not None:
    6567                if opt[1] is None:
    66                     self._scons_options.append("=".join([atr, v]))
     68                    self._scons_options.append("=".join([attr, v]))
    6769                else:
    6870                    self._scons_options.append(" ".join(["-"+opt[1], v]))
     
    7981            os.makedirs(extdir)
    8082        cmd = ['scons'] + self._scons_options
    81         subprocess.call(cmd)
     83        retcode = subprocess.call(cmd)
     84        if retcode != 0:
     85            raise RuntimeError('scons failed')
    8286        # copy extension into distutils build directory
    8387        if os.path.exists("build/_asap.so"):
  • trunk/setup.py

    r2514 r2517  
    2626      license = 'GPL',
    2727      install_requires = ["ipython>=0.11", "matplotlib>=0.99", "numpy>=1.3"],
    28       setup_requires = [ "scons>=1.0" ],
     28#      setup_requires = [ "scons>=1.0" ],
    2929      ext_modules =[ asapso ],
    3030      cmdclass={'build_ext': scons_ext}
Note: See TracChangeset for help on using the changeset viewer.