Changeset 1105 for trunk


Ignore:
Timestamp:
08/03/06 10:21:54 (18 years ago)
Author:
mar637
Message:

more clever use of python...

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SConstruct

    r1090 r1105  
    1 import os,sys
     1import os, sys, glob
    22import distutils.sysconfig
    33import platform
    44
    55#vars = distutils.sysconfig.get_config_vars()
    6 moduledir = "/tmp/dummy"#distutils.sysconfig.get_python_lib()
     6moduledir = "/opt/lib/python2/"#distutils.sysconfig.get_python_lib()
    77
    88opts = Options("userconfig.py", ARGUMENTS)
    99opts.Add("prefix", "The root installation path", distutils.sysconfig.PREFIX)
    1010opts.Add("moduledir", "The python module path (site-packages))", moduledir)
     11
     12def SGlob(pattern):
     13    path = GetBuildPath('SConscript').replace('SConscript', '')
     14    return [ i.replace(path, '') for i in glob.glob(path + pattern) ]
     15
    1116
    1217def addCasaLibs(env):
     
    1520                tables scimath scimath_f casa wcs".split()
    1621    env.Prepend( LIBS =  casalibs )
     22    casaincd = [os.path.join(env['CASAROOT'], 'code/include'), \
     23                os.path.join(env['CASAROOT'], 'code/casa')]
     24    env.Append( CPPPATH = casaincd )
     25    casalibd = os.path.join(env['CASAROOT'], env['CASAARCH'], 'lib')
     26    env.Append( LIBPATH = [ casalibd ] )
    1727    # Explicit templates in casa
    1828    env.Append( CPPFLAGS = ['-DAIPS_NO_TEMPLATE_SRC'] )
     
    6272    if not conf.CheckLib('rpfits'): Exit(1)
    6373    if not conf.CheckLib('cfitsio'): Exit(1)
    64     if not conf.CheckLib('g2c'): Exit(1)
    6574    if not conf.CheckLib('lapack'): Exit(1)
    6675    if not conf.CheckLib('blas'): Exit(1)
     76    if not conf.CheckLib('g2c'): Exit(1)
    6777    if not conf.CheckLib('stdc++',language='c++'): Exit(1)
    6878    if not conf.CheckCasa(): Exit(1)
     
    7484    env.Append(CPPFLAGS='-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__x86_64__ -DAIPS_64B'.split())
    7585
    76 Export("env")
     86Export("env","SGlob")
    7787so = env.SConscript("src/SConscript", build_dir="build", duplicate=0)
    7888env.Install(moduledir, so )
    79 env.Install(moduledir, ["python/__init__.py"] )
    80 env.Alias('install',moduledir)
     89#pys = env.SConscript("python/SConscript")
     90# env.Install(moduledir, pys)
     91env.Alias('install', moduledir)
  • trunk/src/SConscript

    r1090 r1105  
    22
    33# import root environment
    4 Import( "env" )
     4Import( "env", "SGlob" )
    55myenv = env.Copy()
    66
    7 # casa includes
    8 casaincd = [os.path.join(myenv['CASAROOT'], 'code/include'), \
    9             os.path.join(myenv['CASAROOT'], 'code/casa')]
    107
    11 myenv.Append( CPPPATH = casaincd )
    12 
    13 # libaries and objects
    14 # myabe use glob here
    15 # ASAP
    16 cpps = """
    17 Logger.cpp
    18 MathUtils.cpp
    19 MathUtils2.cpp
    20 RowAccumulator.cpp
    21 STAsciiWriter.cpp
    22 STAttr.cpp
    23 STFiller.cpp
    24 STFit.cpp
    25 STFitEntry.cpp
    26 STFitter.cpp
    27 STFocus.cpp
    28 STFrequencies.cpp
    29 STHeader.cpp
    30 STHistory.cpp
    31 STLineFinder.cpp
    32 STMath.cpp
    33 STMolecules.cpp
    34 STPol.cpp
    35 STPolLinear.cpp
    36 STPolStokes.cpp
    37 STSelector.cpp
    38 STSubTable.cpp
    39 STTcal.cpp
    40 STWeather.cpp
    41 STWriter.cpp
    42 Scantable.cpp
    43 Templates.cpp
    44 """.split()
    45 
    46 pycpps = """
    47 python_Fitter.cpp
    48 python_Logger.cpp
    49 python_STFiller.cpp
    50 python_STFitEntry.cpp
    51 python_STLineFinder.cpp
    52 python_STMath.cpp
    53 python_STSelector.cpp
    54 python_STWriter.cpp
    55 python_Scantable.cpp
    56 python_asap.cpp
    57 """.split()
    58 
    59 
    60 # OTHER
    61 #genlibs = """
    62 #g2c stdc++ lapack blas
    63 #""".split()
    64 
    65 #myenv.Append( LIBS =  ['cfitsio_lfs'] )
    66 #myenv.Append( LIBS =  genlibs )
    67 
     8cpps = SGlob("*.cpp")
     9pycpps = SGlob("python_*.cpp")
     10for pf in pycpps: cpps.remove(pf)
     11print cpps
    6812
    6913casalibd = os.path.join(myenv['CASAROOT'],myenv['CASAARCH'],'lib')
     14
    7015# location of libcasav.a
    71 myenv.Append( LIBPATH = ['#/build', casalibd] )
     16myenv.Prepend( LIBPATH = ['#/build'] )
    7217myenv.Install('#build', os.path.join(casalibd, 'libwcs.a'))
    7318myenv['SHLIBPREFIX']=""   #gets rid of lib prefix
Note: See TracChangeset for help on using the changeset viewer.