Changeset 1325 for trunk/SConstruct


Ignore:
Timestamp:
04/12/07 12:07:38 (18 years ago)
Author:
mar637
Message:

Changes to use casacore instead of casa_asap/aips++\nAdded atnf PKSIO library snapshot to external and linking against this local copy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SConstruct

    r1305 r1325  
    44import platform
    55import SCons
    6 # scons plug-ins
    7 #from installtree import InstallTree
    86
    97moduledir = distutils.sysconfig.get_python_lib()
     
    1412
    1513opts = Options("userconfig.py")
    16 opts.AddOptions(PathOption("prefix",
    17                            "The root installation path",
     14opts.AddOptions(               
     15                ("FORTRAN", "The fortran compiler", None),
     16                ("f2clib", "The fortran to c library", None),
     17                PathOption("prefix",
     18                "The root installation path",
    1819                           distutils.sysconfig.PREFIX),
    1920                PathOption("moduledir",
    2021                            "The python module path (site-packages))",
    2122                            moduledir),
    22                 ("rpfitsdir", "Alternative rpfits location.", ""),
    23                 ("cfitsioincdir", "Alternative cfitsio include dir", ""),
    24                 ("casadir", "Alternative casa location", ""),
     23                PathOption("casacoreroot", "The location of casacore",
     24                                    "/usr/local"),
     25                ("boostroot", "The root dir where boost is installed", None),
     26                ("boostlib", "The name of the boost python library",
     27                 "boost_python"),
     28                ("boostlibdir", "The boost library location", None),
     29                ("boostincdir", "The boost header file location", None),
     30                ("lapackroot",
     31                 "The root directory where lapack is installed", None),
     32                ("lapacklibdir", "The lapack library location", None),
     33                ("lapacklib",
     34                 "The lapack library name (e.g. for specialized AMD libraries",
     35                 None),
     36                ("blasroot",
     37                 "The root directory where blas is installed", None),
     38                ("blaslibdir", "The blas library location", None),
     39                ("blaslib",
     40                 "The blas library name (e.g. for specialized AMD libraries",
     41                 None),
     42                ("cfitsioroot",
     43                 "The root directory where cfistio is installed", None),
     44                ("cfitsiolibdir", "The cfitsio library location", None),
     45                ("cfitsioincdir", "The cfitsio include location", None),
     46                ("wcsroot",
     47                 "The root directory where wcs is installed", None),
     48                ("wcslibdir", "The wcs library location", None),
     49                ("rpfitsroot",
     50                 "The root directory where rpfits is installed", None),
     51                ("rpfitslibdir", "The rpfits library location", None),
     52               
    2553                EnumOption("mode", "The type of build.", "debug",
    2654                           ["release","debug"], ignorecase=1),
     
    3462
    3563env = Environment( toolpath = ['./scons'],
    36                    tools = ["default", "casa", "archiver", "utils",
     64                   tools = ["default", "archiver", "utils",
    3765                            "quietinstall"],
    3866                   ENV = { 'PATH' : os.environ[ 'PATH' ],
     
    4270Help(opts.GenerateHelpText(env))
    4371env.SConsignFile()
    44 env.Append(CASAARCH = '', CASAROOT = '')
    45 if (os.path.exists(env["cfitsioincdir"])):
    46     env.Append(CPPPATH=[env["cfitsioincdir"]])
    47 env.AddCustomPath(env["rpfitsdir"])
     72
     73casacoretooldir = os.path.join(env["casacoreroot"],"share",
     74                                   "casacore")
     75if not os.path.exists(casacoretooldir):
     76    print "Could not find casacore scons tools"
     77    Exit(1)
     78
     79# load casacore specific build flags
     80print casacoretooldir
     81env.Tool('casa', [casacoretooldir])
     82
    4883if not env.GetOption('clean'):
    4984    conf = Configure(env)
    50     # import Custom tests
    51     env.AddCasaTest(conf)
    52     pylib = 'python'+distutils.sysconfig.get_python_version()
    53     pyinc = "Python.h"
    54     if env['PLATFORM'] == "darwin":
    55         pylib = "Python"
    56     if not conf.CheckLib(library=pylib, language='c'): Exit(1)
    5785    conf.env.Append(CPPPATH=[distutils.sysconfig.get_python_inc()])
    5886    if not conf.CheckHeader("Python.h", language='c'):
    5987        Exit(1)
    60     if not conf.CheckLibWithHeader('boost_python', 'boost/python.hpp', 'c++'): Exit(1)
    61     conf.env.AddCustomPath(env["rpfitsdir"])
    62     if not conf.CheckLib('rpfits'): Exit(1)
    63     # cfitsio is either in include/ or /include/cfitsio
    64     # handle this
    65     if not conf.CheckLib(library='cfitsio', language='c'): Exit(1)
    66     if not conf.CheckHeader('fitsio.h', language='c'):
    67         if not conf.CheckHeader('cfitsio/fitsio.h', language='c'):
    68             Exit(1)
    69         else:
    70             conf.env.Append(CPPPATH=['/usr/include/cfitsio'])
    71     if (sys.platform == "darwin"):
    72         conf.env.Append(LIBS = ['-framework vecLib'])
     88    pylib = 'python'+distutils.sysconfig.get_python_version()
     89    if env['PLATFORM'] == "darwin":
     90        conf.env.Append(FRAMEWORKS=["Python"])
    7391    else:
    74         if not conf.CheckLib('lapack'): Exit(1)
    75         if not conf.CheckLib('blas'): Exit(1)
    76     if not conf.CheckLib('g2c'): Exit(1)
     92        if not conf.CheckLib(library=pylib, language='c'): Exit(1)
     93
     94    conf.env.AppendUnique(LIBPATH=os.path.join(conf.env["casacoreroot"],
     95                                               "lib"))
     96    conf.env.AppendUnique(CPPPATH=os.path.join(conf.env["casacoreroot"],
     97                                               "include", "casacore"))
     98    print conf.env["CPPPATH"]
     99#    if not conf.CheckLib("casa_images",  language='c++'): Exit(1)
     100    if not conf.CheckLib("casa_ms",  language='c++'): Exit(1)
     101    if not conf.CheckLib("casa_components",  language='c++'): Exit(1)
     102    if not conf.CheckLib("casa_coordinates",  language='c++'): Exit(1)
     103    if not conf.CheckLib("casa_lattices",  language='c++'): Exit(1)
     104    if not conf.CheckLib("casa_fits",  language='c++'): Exit(1)
     105    if not conf.CheckLib("casa_measures",  language='c++'): Exit(1)
     106    if not conf.CheckLib("casa_scimath",  language='c++'): Exit(1)
     107    if not conf.CheckLib("casa_scimath_f",  language='c++'): Exit(1)
     108    if not conf.CheckLib("casa_tables",  language='c++'): Exit(1)
     109    if not conf.CheckLib("casa_mirlib",  language='c++'): Exit(1)
     110    if not conf.CheckLib("casa_casa",  language='c++'): Exit(1)
     111    conf.env.AddCustomPackage('boost')
     112    if not conf.CheckLibWithHeader(env["boostlib"],
     113                                   'boost/python.hpp', language='c++'):
     114        Exit(1)
     115    # test for cfitsio
     116    if not conf.CheckLib("m"): Exit(1)
     117    conf.env.AddCustomPackage('cfitsio')
     118    if not conf.CheckLibWithHeader('cfitsio', 'fitsio.h', language='c'):
     119        Exit(1)
     120    conf.env.AddCustomPackage('wcs')
     121    if not conf.CheckLibWithHeader('wcs', 'wcslib/wcs.h', language='c'):
     122        Exit(1)
     123    conf.env.AddCustomPackage('rpfits')
     124    if not conf.CheckLib("rpfits"): Exit(1)
     125
     126    # test for blas/lapack
     127    blasname = conf.env.get("blaslib", "blas")
     128    conf.env.AddCustomPackage("blas")
     129    if not conf.CheckLib(blasname): Exit(1)
     130    lapackname = conf.env.get("lapacklib", "lapack")
     131    conf.env.AddCustomPackage("lapack")
     132    if not conf.CheckLib(lapackname): Exit(1)
     133    conf.env.CheckFortran(conf)
    77134    if not conf.CheckLib('stdc++', language='c++'): Exit(1)
    78     if not conf.CheckCasa(env["casadir"]): Exit(1)
    79135    env = conf.Finish()
    80136
    81 env["version"] = "2.1.1"
    82 
    83 # general CPPFLAGS
    84 env.Append(CPPFLAGS=['-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-O3'])
    85 
    86 # 64bit flags
    87 if  platform.architecture()[0] == '64bit':
    88     env.Append(CPPFLAGS=['-fPIC', '-D__x86_64__', '-DAIPS_64B'])
     137env["version"] = "trunk"
    89138
    90139if env['mode'] == 'release':
     
    94143Export("env")
    95144
     145# build externals
     146env.SConscript("external/SConscript")
    96147# build library
    97148so = env.SConscript("src/SConscript", build_dir="build", duplicate=0)
Note: See TracChangeset for help on using the changeset viewer.