Changeset 1325 for trunk/SConstruct
- Timestamp:
- 04/12/07 12:07:38 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SConstruct
r1305 r1325 4 4 import platform 5 5 import SCons 6 # scons plug-ins7 #from installtree import InstallTree8 6 9 7 moduledir = distutils.sysconfig.get_python_lib() … … 14 12 15 13 opts = Options("userconfig.py") 16 opts.AddOptions(PathOption("prefix", 17 "The root installation path", 14 opts.AddOptions( 15 ("FORTRAN", "The fortran compiler", None), 16 ("f2clib", "The fortran to c library", None), 17 PathOption("prefix", 18 "The root installation path", 18 19 distutils.sysconfig.PREFIX), 19 20 PathOption("moduledir", 20 21 "The python module path (site-packages))", 21 22 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 25 53 EnumOption("mode", "The type of build.", "debug", 26 54 ["release","debug"], ignorecase=1), … … 34 62 35 63 env = Environment( toolpath = ['./scons'], 36 tools = ["default", " casa", "archiver", "utils",64 tools = ["default", "archiver", "utils", 37 65 "quietinstall"], 38 66 ENV = { 'PATH' : os.environ[ 'PATH' ], … … 42 70 Help(opts.GenerateHelpText(env)) 43 71 env.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 73 casacoretooldir = os.path.join(env["casacoreroot"],"share", 74 "casacore") 75 if not os.path.exists(casacoretooldir): 76 print "Could not find casacore scons tools" 77 Exit(1) 78 79 # load casacore specific build flags 80 print casacoretooldir 81 env.Tool('casa', [casacoretooldir]) 82 48 83 if not env.GetOption('clean'): 49 84 conf = Configure(env) 50 # import Custom tests51 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)57 85 conf.env.Append(CPPPATH=[distutils.sysconfig.get_python_inc()]) 58 86 if not conf.CheckHeader("Python.h", language='c'): 59 87 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"]) 73 91 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) 77 134 if not conf.CheckLib('stdc++', language='c++'): Exit(1) 78 if not conf.CheckCasa(env["casadir"]): Exit(1)79 135 env = conf.Finish() 80 136 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']) 137 env["version"] = "trunk" 89 138 90 139 if env['mode'] == 'release': … … 94 143 Export("env") 95 144 145 # build externals 146 env.SConscript("external/SConscript") 96 147 # build library 97 148 so = env.SConscript("src/SConscript", build_dir="build", duplicate=0)
Note:
See TracChangeset
for help on using the changeset viewer.