/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 685 by gross, Mon Mar 27 22:16:33 2006 UTC revision 712 by elspeth, Thu Apr 27 02:08:50 2006 UTC
# Line 15  Line 15 
15  EnsureSConsVersion(0,96,91)  EnsureSConsVersion(0,96,91)
16  EnsurePythonVersion(2,3)  EnsurePythonVersion(2,3)
17    
18    # import tools:
19    import glob
20  import sys, os  import sys, os
21  # Add our extensions  # Add our extensions
22  if sys.path.count('scons')==0: sys.path.append('scons')  if sys.path.count('scons')==0: sys.path.append('scons')
# Line 43  opts.AddOptions( Line 45  opts.AddOptions(
45    ('incinstall', 'where the esys headers will be installed', Dir('#.').abspath+'/include'),    ('incinstall', 'where the esys headers will be installed', Dir('#.').abspath+'/include'),
46    ('libinstall', 'where the esys libraries will be installed', Dir('#.').abspath+'/lib'),    ('libinstall', 'where the esys libraries will be installed', Dir('#.').abspath+'/lib'),
47    ('pyinstall', 'where the esys python modules will be installed', Dir('#.').abspath),    ('pyinstall', 'where the esys python modules will be installed', Dir('#.').abspath),
48      ('src_zipfile', 'the source zip file will be installed.', Dir('#.').abspath+"/release/escript_src.zip"),
49      ('test_zipfile', 'the test zip file will be installed.', Dir('#.').abspath+"/release/escript_tests.zip"),
50      ('src_tarfile', 'the source tar file will be installed.', Dir('#.').abspath+"/release/escript_src.tar.gz"),
51      ('test_tarfile', 'the test tar file will be installed.', Dir('#.').abspath+"/release/escript_tests.tar.gz"),
52      ('examples_tarfile', 'the examples tar file will be installed.', Dir('#.').abspath+"/release/doc/escript_examples.tar.gz"),
53      ('examples_zipfile', 'the examples zip file will be installed.', Dir('#.').abspath+"/release/doc/escript_examples.zip"),
54      ('guide_pdf', 'name of the user guide in pdf format', Dir('#.').abspath+"/release/doc/user/guide.pdf"),
55      ('api_epydoc', 'name of the epydoc api docs directory',Dir('#.').abspath+"/release/doc/epydoc"),
56      ('guide_html', 'name of the directory for user guide in html format', Dir('#.').abspath+"/release/doc/user/html"),
57  # Compilation options  # Compilation options
58    BoolOption('dodebug', 'Do you want a debug build?', 'yes'),    BoolOption('dodebug', 'Do you want a debug build?', 'no'),
59    ('options_file', "Optional file containing preferred options. Ignored if it doesn't exist (default: scons/hostname_options.py)", options_file),    ('options_file', "Optional file containing preferred options. Ignored if it doesn't exist (default: scons/hostname_options.py)", options_file),
60    ('cc_defines','C/C++ defines to use', None),    ('cc_defines','C/C++ defines to use', None),
61    ('cc_flags','C compiler flags to use (Release build)', None),    ('cc_flags','C compiler flags to use (Release build)', '-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas'),
62    ('cc_flags_debug', 'C compiler flags to use (Debug build)', None),    ('cc_flags_debug', 'C compiler flags to use (Debug build)', '-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas'),
63    ('cxx_flags', 'C++ compiler flags to use (Release build)', None),    ('cxx_flags', 'C++ compiler flags to use (Release build)', '--no-warn -ansi'),
64    ('cxx_flags_debug', 'C++ compiler flags to use (Debug build)', None),    ('cxx_flags_debug', 'C++ compiler flags to use (Debug build)', '--no-warn -ansi -DDOASSERT -DDOPROF'),
65    ('ar_flags', 'Static library archiver flags to use', None),    ('ar_flags', 'Static library archiver flags to use', None),
66    ('sys_libs', 'System libraries to link with', None),    ('sys_libs', 'System libraries to link with', None),
67      ('tar_flags','flags for zip files','-c -z'),
68  # MKL  # MKL
69    PathOption('mkl_path', 'Path to MKL includes', None),    PathOption('mkl_path', 'Path to MKL includes', None),
70    PathOption('mkl_lib_path', 'Path to MKL libs', None),    PathOption('mkl_lib_path', 'Path to MKL libs', None),
# Line 74  opts.AddOptions( Line 86  opts.AddOptions(
86    PathOption('boost_path', 'Path to Boost includes', '/usr/include'),    PathOption('boost_path', 'Path to Boost includes', '/usr/include'),
87    PathOption('boost_lib_path', 'Path to Boost libs', '/usr/lib'),    PathOption('boost_lib_path', 'Path to Boost libs', '/usr/lib'),
88    ('boost_lib', 'Boost libraries to link with', ['boost_python',]),    ('boost_lib', 'Boost libraries to link with', ['boost_python',]),
 # CppUnit  
   PathOption('cppunit_path', 'Path to CppUnit includes', Dir('#.').abspath+'/tools/CppUnitTest/inc'),  
   PathOption('cppunit_lib_path', 'Path to CppUnit libs', Dir('#.').abspath+'/lib'),  
   ('cppunit_lib', 'CppUnit libraries to link with', ['CppUnitTest',]),  
89  # Doc building  # Doc building
90    PathOption('doxygen_path', 'Path to Doxygen executable', None),    PathOption('doxygen_path', 'Path to Doxygen executable', None),
91    PathOption('epydoc_path', 'Path to Epydoc executable', None),    PathOption('epydoc_path', 'Path to Epydoc executable', None),
# Line 112  except KeyError: Line 120  except KeyError:
120  # FIXME: Perhaps a modification to intelc.py will allow better support for ia64 on altix  # FIXME: Perhaps a modification to intelc.py will allow better support for ia64 on altix
121    
122  if os.name != "nt" and os.uname()[4]=='ia64':  if os.name != "nt" and os.uname()[4]=='ia64':
123     env = Environment(tools = ['default', 'intelc'], options = opts)     env = Environment(ENV = {'PATH':path}, tools = ['default', 'intelc'], options = opts)
124     env['ENV']['PATH'] = path     env['ENV']['PATH'] = path
125     env['ENV']['LD_LIBRARY_PATH'] = ld_library_path     env['ENV']['LD_LIBRARY_PATH'] = ld_library_path
126     env['ENV']['PYTHONPATH'] = python_path     env['ENV']['PYTHONPATH'] = python_path
# Line 207  except KeyError: Line 215  except KeyError:
215     sys_libs = ''     sys_libs = ''
216    
217  try:  try:
218       tar_flags = env['tar_flags']
219       env.Replace(TARFLAGS = tar_flags)
220    except KeyError:
221       pass
222    
223    try:
224     includes = env['mkl_path']     includes = env['mkl_path']
225     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
226  except KeyError:  except KeyError:
227     pass     pass
228    
229  try:  try:
230     lib_path = env['mkl_lib_path']     lib_path = env['mkl_lib_path']
231     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
232  except KeyError:  except KeyError:
233     pass     pass
234    
235  try:  try:
236     mkl_libs = env['mkl_libs']     mkl_libs = env['mkl_libs']
237  except KeyError:  except KeyError:
# Line 263  try: Line 279  try:
279  except KeyError:  except KeyError:
280     boost_lib = None       boost_lib = None  
281  try:  try:
    includes = env['cppunit_path']  
    env.Append(CPPPATH = [includes,])  
 except KeyError:  
    pass  
 try:  
    lib_path = env['cppunit_lib_path']  
    env.Append(LIBPATH = [lib_path,])  
 except KeyError:  
    pass  
 try:  
    cppunit_lib = env['cppunit_lib']  
 except KeyError:  
    boost_lib = None    
 try:  
282     includes = env['python_path']     includes = env['python_path']
283     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
284  except KeyError:  except KeyError:
# Line 317  try: Line 319  try:
319  except KeyError:  except KeyError:
320     papi_libs = None       papi_libs = None  
321    
322  # Targets  
323    try:
324       src_zipfile = env.File(env['src_zipfile'])
325    except KeyError:
326       src_zipfile = None  
327    try:
328       test_zipfile = env.File(env['test_zipfile'])
329    except KeyError:
330       test_zipfile = None  
331    try:
332       examples_zipfile = env.File(env['examples_zipfile'])
333    except KeyError:
334       examples_zipfile = None  
335    
336    try:
337       src_tarfile = env.File(env['src_tarfile'])
338    except KeyError:
339       src_tarfile = None  
340    try:
341       test_tarfile = env.File(env['test_tarfile'])
342    except KeyError:
343       test_tarfile = None  
344    try:
345       examples_tarfile = env.File(env['examples_tarfile'])
346    except KeyError:
347       examples_tarfile = None  
348    
349    try:
350       guide_pdf = env.File(env['guide_pdf'])
351    except KeyError:
352       guide_pdf = None  
353    
354    try:
355       guide_html_index = env.File('index.htm',env['guide_html'])
356    except KeyError:
357       guide_html_index = None  
358    
359    try:
360       api_epydoc = env.Dir(env['api_epydoc'])
361    except KeyError:
362       api_epydoc = None  
363    
364    # Zipgets
365      
366  env.Default(libinstall)  env.Default(libinstall)
367  env.Default(incinstall)  env.Default(incinstall)
368  env.Default(pyinstall)  env.Default(pyinstall)
369  env.Alias('build_tests')  env.Alias('release_src',[ src_zipfile, src_tarfile ])  
370  env.Alias('run_tests')  env.Alias('release_tests',[ test_zipfile, test_tarfile])
371  env.Alias('py_tests')  env.Alias('release_examples',[ examples_zipfile, examples_tarfile])
372  env.Alias('all_tests', ['run_tests', 'py_tests'])  env.Alias('docs',[ 'release_examples', guide_pdf, guide_html_index, api_epydoc])
373    env.Alias('release', ['release_src', 'release_tests', 'docs'])
374    env.Alias('build_tests')    # target to build all C++ tests
375    env.Alias('build_py_tests') # target to build all python tests
376    env.Alias('build_all_tests', [ 'build_tests', 'build_py_tests' ] ) # target to build all python tests
377    env.Alias('run_tests', 'build_tests')   # target to run all C++ test
378    env.Alias('py_tests', 'build_py_tests') # taget to run all released python tests
379    env.Alias('all_tests', ['run_tests', 'py_tests']) # target to run all C++ and released python tests
380    
381  # Python install - esys __init__.py  # Python install - esys __init__.py
382  # This is just an empty file but stills need to be touched so add a special target and Command. Note you can't use the scons Touch() function as it will not  # This is just an empty file but stills need to be touched so add a special target and Command. Note you can't use the scons Touch() function as it will not
383  # create the file if it doesn't exist  # create the file if it doesn't exist
384  env.Command('esys/__init__.py', None, 'touch $TARGET')  env.Command(pyinstall+'/__init__.py', None, 'touch $TARGET')
385    
386  # Allow sconscripts to see the env  # Allow sconscripts to see the env
387  Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs",  Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs",
388      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "epydoc_pythonpath", "papi_libs", "cppunit_lib", "sys_libs" ])      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "epydoc_pythonpath", "papi_libs",
389            "sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "examples_tarfile", "examples_zipfile",
390            "guide_pdf", "guide_html_index", "api_epydoc"])
391    
392  # End initialisation section  # End initialisation section
393  # Begin configuration section  # Begin configuration section
394    # adds this file and the scons option directore to the source tar
395    release_srcfiles=[env.File('SConstruct'),]+[ env.File(x) for x in glob.glob('scons/*.py') ]
396    release_testfiles=[env.File('README_TESTS'),]
397    env.Zip(src_zipfile, release_srcfiles)
398    env.Zip(test_zipfile, release_testfiles)
399    env.Tar(src_tarfile, release_srcfiles)
400    env.Tar(test_tarfile, release_testfiles)
401    
402  # Insert new components to be build here  # Insert new components to be build here
403  # FIXME: might be nice to replace this verbosity with a list of targets and some  # FIXME: might be nice to replace this verbosity with a list of targets and some
404  # FIXME: nifty python to create the lengthy but very similar env.Sconscript lines  # FIXME: nifty python to create the lengthy but very similar env.Sconscript lines
# Line 349  env.SConscript(dirs = ['escript/src'], b Line 411  env.SConscript(dirs = ['escript/src'], b
411  env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)  env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)
412  env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)  env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)
413  env.SConscript(dirs = ['modellib/py_src'], build_dir='build/$PLATFORM/modellib', duplicate=0)  env.SConscript(dirs = ['modellib/py_src'], build_dir='build/$PLATFORM/modellib', duplicate=0)
414    env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0)
415  # FIXME:need to be incorporated into build system  #env.SConscript(dirs = ['pyvisi/py_src'], build_dir='build/$PLATFORM/pyvisi', duplicate=0) not part of beta.0
 # FIXME: 'pyvisi/SConstruct']  
 # FIXME: 'doc/SConstruct']  
 # FIXME: 'doc/SConstruct']  

Legend:
Removed from v.685  
changed lines
  Added in v.712

  ViewVC Help
Powered by ViewVC 1.1.26