- Timestamp:
- 05/14/12 13:57:45 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SConstruct
r2505 r2506 31 31 PathVariable("casacoreroot", "The location of casacore", 32 32 "/usr/local"), 33 BoolVariable("casacorestatic", 34 "Link statically against casacore", 35 False), 33 36 ("boostroot", "The root dir where boost is installed", None), 34 37 ("boostlib", "The name of the boost python library", … … 96 99 97 100 conf = Configure(env) 98 conf.env.AddCustomPackage('extra') 99 conf.env.AppendUnique(LIBPATH=os.path.join(conf.env["casacoreroot"], 100 "lib")) 101 conf.env.AppendUnique(CPPPATH=os.path.join(conf.env["casacoreroot"], 102 "include", "casacore")) 103 if not conf.CheckLib("casa_casa", language='c++'): Exit(1) 104 conf.env.PrependUnique(LIBS=["casa_images", "casa_ms", "casa_components", 105 "casa_coordinates", "casa_lattices", 106 "casa_fits", "casa_measures", "casa_scimath", 107 "casa_scimath_f", "casa_tables", 108 "casa_mirlib"]) 101 if conf.env["extraroot"]: 102 conf.env.AddCustomPackage('extra') 109 103 conf.env.Append(CPPPATH=[distutils.sysconfig.get_python_inc()]) 110 104 if not conf.CheckHeader("Python.h", language='c'): … … 117 111 118 112 conf.env.AddCustomPackage('boost') 119 if not conf.CheckLibWithHeader(conf.env["boostlib"], 120 'boost/python.hpp', language='c++'): 121 Exit(1) 113 libname = conf.env["boostlib"] 114 if libname.find(".") > -1 and os.path.exists(libname): 115 conf.env.AppendUnique(LIBS=[env.File(libname)]) 116 else: 117 if not conf.CheckLibWithHeader(libname, 118 'boost/python.hpp', language='c++'): 119 Exit(1) 122 120 123 121 if env["enable_pyrap"]: … … 141 139 if not conf.CheckLib("m"): Exit(1) 142 140 conf.env.AddCustomPackage('cfitsio') 143 if not conf.CheckLibWithHeader(conf.env["cfitsiolib"], 144 'fitsio.h', language='c'): 145 Exit(1) 141 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 Exit(1) 146 148 conf.env.AddCustomPackage('wcs') 147 if not conf.CheckLibWithHeader(conf.env["wcslib"], 148 'wcslib/wcs.h', language='c'): 149 Exit(1) 149 libname = conf.env["wcslib"] 150 if libname.find(".") > -1 and os.path.exists(libname): 151 conf.env.AppendUnique(LIBS=[env.File(libname)]) 152 else: 153 if not conf.CheckLibWithHeader(libname, 154 'wcslib/wcs.h', language='c'): 155 Exit(1) 156 150 157 conf.env.AddCustomPackage('rpfits') 151 158 if not conf.CheckLib(conf.env["rpfitslib"], language="c"): 152 159 Exit(1) 160 161 libpath = "" 162 for p in [conf.env["casacoreroot"], conf.env["extraroot"]]: 163 pth = os.path.join(p, "include", "casacore") 164 if os.path.exists(pth): 165 libpth = os.path.join(p, "lib") 166 conf.env.AppendUnique(CPPPATH=[pth]) 167 break 168 cclibs = ["casa_images", "casa_ms", "casa_components", 169 "casa_coordinates", "casa_lattices", 170 "casa_fits", "casa_measures", "casa_scimath", 171 "casa_scimath_f", "casa_tables", 172 "casa_mirlib", "casa_casa"] 173 if conf.env["casacorestatic"]: 174 libs = [ env.File(os.path.join(libpth, "lib"+lib+".a")) \ 175 for lib in cclibs ] 176 else: 177 conf.env.AppendUnique(LIBPATH=libpth) 178 if not conf.CheckLibWithHeader("casa_casa", "casa/aips.h", 179 language='c++', autoadd=0): 180 Exit(1) 181 libs = cclibs 182 conf.env.PrependUnique(LIBS=libs) 153 183 154 184 # test for blas/lapack 155 lapackname = conf.env.get("lapacklib", "lapack")156 185 conf.env.AddCustomPackage("lapack") 157 if not conf.CheckLib(lapackname): Exit(1) 158 blasname = conf.env.get("blaslib", "blas") 159 conf.env.AddCustomPackage("blas") 160 if not conf.CheckLib(blasname): Exit(1) 161 conf.env.CheckFortran(conf) 186 libname = conf.env.get("lapacklib", "lapack") 187 if libname.find(".") > -1 and os.path.exists(libname): 188 conf.env.AppendUnique(LIBS=[env.File(libname)]) 189 else: 190 if not conf.CheckLib(libname): Exit(1) 191 libname = conf.env.get("blaslib", "blas") 192 if libname.find(".") > -1 and os.path.exists(libname): 193 conf.env.AppendUnique(LIBS=[env.File(libname)]) 194 else: 195 if not conf.CheckLib(libname): Exit(1) 196 197 libname = conf.env.get("f2clib", "gfortran") 198 if libname.find(".") > -1 and os.path.exists(libname): 199 conf.env.AppendUnique(LIBS=[env.File(libname)]) 200 else: 201 conf.env.CheckFortran(conf) 162 202 if not conf.CheckLib('stdc++', language='c++'): Exit(1) 163 203 if conf.env["alma"]:
Note:
See TracChangeset
for help on using the changeset viewer.