Ignore:
Timestamp:
06/09/10 19:03:06 (14 years ago)
Author:
Kana Sugimoto
Message:

New Development: Yes

JIRA Issue: Yes (CAS-2211)

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed: ASAP 3.0.0 interface changes

Test Programs:

Put in Release Notes: Yes

Module(s): all the CASA sd tools and tasks are affected.

Description: Merged ATNF-ASAP 3.0.0 developments to CASA (alma) branch.

Note you also need to update casa/code/atnf.


Location:
branches/alma
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/alma

  • branches/alma/SConstruct

    r1377 r1757  
    66
    77moduledir = distutils.sysconfig.get_python_lib()
    8 if  platform.architecture()[0] == '64bit':
     8
     9if sys.platform.startswith('linux') and platform.architecture()[0] == '64bit':
    910    # hack to install into /usr/lib64 if scons is in the 32bit /usr/lib/
    1011    if moduledir.startswith("/usr/lib/"):
    1112        moduledir = moduledir.replace("lib", "lib64")
    1213
    13 opts = Options("options.cfg")
    14 opts.AddOptions(
     14EnsureSConsVersion(1,1,0)
     15
     16opts = Variables("options.cfg")
     17opts.AddVariables(
    1518                ("FORTRAN", "The fortran compiler", None),
    1619                ("f2clib", "The fortran to c library", None),
    17                 PathOption("prefix",
     20                PathVariable("prefix",
    1821                "The root installation path",
    1922                           distutils.sysconfig.PREFIX),
    20                 PathOption("moduledir",
     23                PathVariable("moduledir",
    2124                            "The python module path (site-packages))",
    2225                            moduledir),
    23                 PathOption("casacoreroot", "The location of casacore",
    24                                     "/usr/local"),
     26                PathVariable("casacoreroot", "The location of casacore",
     27                             "/usr/local"),
    2528                ("boostroot", "The root dir where boost is installed", None),
    2629                ("boostlib", "The name of the boost python library",
     
    4548                ("cfitsiolib", "The cfitsio library name", "cfitsio"),
    4649                ("cfitsioincdir", "The cfitsio include location", None),
     50                ("wcslib", "The wcs library name", "wcs"),
    4751                ("wcsroot",
    4852                 "The root directory where wcs is installed", None),
     
    5256                 "The root directory where rpfits is installed", None),
    5357                ("rpfitslibdir", "The rpfits library location", None),
    54 #               ("rpfitsincdir", "The rpfits include location", None),
    55                 EnumOption("mode", "The type of build.", "debug",
     58                ("pyraproot", "The root directory where libpyrap is installed",
     59                 None),
     60                ("pyraplib", "The name of the pyrap library", "pyrap"),
     61                ("pyraplibdir", "The directory where libpyrap is installed",
     62                 None),
     63                ("pyrapincdir", "The pyrap include location",
     64                 None),
     65                BoolVariable("enable_pyrap", "Use pyrap conversion library",
     66                             False),
     67
     68                EnumVariable("mode", "The type of build.", "release",
    5669                           ["release","debug"], ignorecase=1),
    5770                ("makedist",
    5871                 "Make a binary archive giving a suffix, e.g. sarge or fc5",
    5972                 ""),
    60                 EnumOption("makedoc", "Build the userguide in specified format",
     73                EnumVariable("makedoc", "Build the userguide in specified format",
    6174                           "none",
    62                            ["none", "pdf", "html"], ignorecase=1)
     75                           ["none", "pdf", "html"], ignorecase=1),
     76                BoolVariable("apps", "Build cpp apps", True),
     77                BoolVariable("alma", "Enable alma specific functionality",
     78                             False),
    6379                )
    6480
     
    7389env.SConsignFile()
    7490
    75 if env["PLATFORM"] == "darwin":
    76     env.EnsureSConsVersion(0,96,95)
    77 
    7891casacoretooldir = os.path.join(env["casacoreroot"],"share",
    7992                                   "casacore")
     
    8396
    8497# load casacore specific build flags
     98env.Tool('casaoptions', [casacoretooldir])
     99opts.Update(env)
    85100env.Tool('casa', [casacoretooldir])
    86101
     
    93108                                               "include", "casacore"))
    94109    if not conf.CheckLib("casa_casa", language='c++'): Exit(1)
    95     conf.env.PrependUnique(LIBS=["casa_ms", "casa_components",
     110    conf.env.PrependUnique(LIBS=["casa_images", "casa_ms", "casa_components",
    96111                                 "casa_coordinates", "casa_lattices",
    97112                                 "casa_fits", "casa_measures", "casa_scimath",
     
    108123
    109124    conf.env.AddCustomPackage('boost')
    110     if not conf.CheckLibWithHeader(env["boostlib"],
     125    if not conf.CheckLibWithHeader(conf.env["boostlib"],
    111126                                   'boost/python.hpp', language='c++'):
    112127        Exit(1)
     128
     129    conf.env.AddCustomPackage('pyrap')
     130    if  conf.env.get("enable_pyrap") and conf.CheckLib(conf.env["pyraplib"],
     131                                                       language='c++',
     132                                                       autoadd=0):
     133        conf.env.Append(CPPFLAGS=['-DHAVE_PYRAP'])
     134        conf.env.PrependUnique(LIBS=env['pyraplib'])
     135   
    113136    # test for cfitsio
    114137    if not conf.CheckLib("m"): Exit(1)
     
    118141        Exit(1)
    119142    conf.env.AddCustomPackage('wcs')
    120     if not conf.CheckLibWithHeader('wcs', 'wcslib/wcs.h', language='c'):
     143    if not conf.CheckLibWithHeader(conf.env["wcslib"],
     144                                   'wcslib/wcs.h', language='c'):
    121145        Exit(1)
    122146    conf.env.AddCustomPackage('rpfits')
     
    125149
    126150    # test for blas/lapack
     151    lapackname = conf.env.get("lapacklib", "lapack")
    127152    conf.env.AddCustomPackage("lapack")
    128     if not conf.CheckLib(conf.env["lapacklib"]): Exit(1)
     153    if not conf.CheckLib(lapackname): Exit(1)
    129154    blasname = conf.env.get("blaslib", "blas")
    130155    conf.env.AddCustomPackage("blas")
    131     if not conf.CheckLib(conf.env["blaslib"]): Exit(1)
     156    if not conf.CheckLib(blasname): Exit(1)
    132157    conf.env.CheckFortran(conf)
    133158    if not conf.CheckLib('stdc++', language='c++'): Exit(1)
     159    if conf.env["alma"]:
     160        conf.env.Append(CPPFLAGS=['-DUSE_ALMA'])
    134161    env = conf.Finish()
    135162
    136 env["version"] = "2.2.x"
     163env["version"] = "3.0.0"
    137164
    138165if env['mode'] == 'release':
     
    141168    env.Append(CCFLAGS=["-O2"])
    142169else:
    143     env.Append(CCFLAGS=["-g"])
     170    env.Append(CCFLAGS=["-g", "-Wall"])
    144171
    145172# Export for SConscript files
     
    165192
    166193# install targets
    167 somod = env.Install("$moduledir/asap", so )
    168 pymods = env.Install("$moduledir/asap", env.SGlob("python/*.py"))
    169 bins = env.Install("$prefix/bin", ["bin/asap", "bin/asap_update_data"])
    170 shares = env.Install("$moduledir/asap/data", "share/ipythonrc-asap")
    171 env.Alias('install', [somod, pymods, bins, shares])
     194installs = []
     195installs.append(env.Install("$moduledir/asap", so))
     196installs.append(env.Install("$moduledir/asap", env.SGlob("python/*.py")))
     197installs.append(env.Install("$prefix/bin",
     198                            ["bin/asap", "bin/asap_update_data"]))
     199installs.append(env.Install("$moduledir/asap/data", "share/ipythonrc-asap"))
     200installs.append(env.Install("$moduledir/asap/data", "share/ipy_user_conf.py"))
     201env.Alias('install', installs)
    172202
    173203# install aips++ data repos
    174 rootdir=None
     204rootdir = None
    175205outdir =  os.path.join(env["moduledir"],'asap','data')
    176206sources = ['ephemerides','geodetic']
     
    193223    env.QInstall("$stagedir", ["bin/install"])
    194224    env.QInstall("$stagedir/asap/data", "share/ipythonrc-asap")
     225    env.QInstall("$stagedir/asap/data", "share/ipy_user_conf.py")
    195226    if rootdir is not None:
    196227        # This creates a directory Using data table... - disabled
     
    209240    env.SConscript("doc/SConscript")
    210241
     242if env["apps"]:
     243    env.SConscript("apps/SConscript")
     244
    211245if env.GetOption("clean"):
    212246    Execute(Delete(".sconf_temp"))
Note: See TracChangeset for help on using the changeset viewer.