/[escript]/branches/dirac/SConstruct
ViewVC logotype

Diff of /branches/dirac/SConstruct

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

revision 684 by robwdcock, Mon Mar 27 07:34:07 2006 UTC revision 722 by gross, Mon May 1 11:49:18 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 66  opts.AddOptions( Line 78  opts.AddOptions(
78    PathOption('umf_lib_path', 'Path to UMF libs', None),    PathOption('umf_lib_path', 'Path to UMF libs', None),
79    ('umf_libs', 'UMF libraries to link with', None),    ('umf_libs', 'UMF libraries to link with', None),
80  # Python  # Python
81    PathOption('python_path', 'Path to Python includes', '/usr/include'),  # locations of include files for python
82      PathOption('python_path', 'Path to Python includes', '/usr/include/python%s.%s'%(sys.version_info[0],sys.version_info[1])),
83    PathOption('python_lib_path', 'Path to Python libs', '/usr/lib'),    PathOption('python_lib_path', 'Path to Python libs', '/usr/lib'),
84    ('python_lib', 'Python libraries to link with', ['python2.3',]),    ('python_lib', 'Python libraries to link with', ["python%s.%s"%(sys.version_info[0],sys.version_info[1]),]),
85  # Boost  # Boost
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),
   PathOption('epydoc_pythonpath', 'Path to Epydoc python files', None),  
92  # PAPI  # PAPI
93    PathOption('papi_path', 'Path to PAPI includes', None),    PathOption('papi_path', 'Path to PAPI includes', None),
94    PathOption('papi_lib_path', 'Path to PAPI libs', None),    PathOption('papi_lib_path', 'Path to PAPI libs', None),
# Line 111  except KeyError: Line 119  except KeyError:
119  # 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
120    
121  if os.name != "nt" and os.uname()[4]=='ia64':  if os.name != "nt" and os.uname()[4]=='ia64':
122     env = Environment(tools = ['default', 'intelc'], options = opts)     env = Environment(ENV = {'PATH':path}, tools = ['default', 'intelc'], options = opts)
123     env['ENV']['PATH'] = path     env['ENV']['PATH'] = path
124     env['ENV']['LD_LIBRARY_PATH'] = ld_library_path     env['ENV']['LD_LIBRARY_PATH'] = ld_library_path
125     env['ENV']['PYTHONPATH'] = python_path     env['ENV']['PYTHONPATH'] = python_path
# Line 206  except KeyError: Line 214  except KeyError:
214     sys_libs = ''     sys_libs = ''
215    
216  try:  try:
217       tar_flags = env['tar_flags']
218       env.Replace(TARFLAGS = tar_flags)
219    except KeyError:
220       pass
221    
222    try:
223     includes = env['mkl_path']     includes = env['mkl_path']
224     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
225  except KeyError:  except KeyError:
226     pass     pass
227    
228  try:  try:
229     lib_path = env['mkl_lib_path']     lib_path = env['mkl_lib_path']
230     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
231  except KeyError:  except KeyError:
232     pass     pass
233    
234  try:  try:
235     mkl_libs = env['mkl_libs']     mkl_libs = env['mkl_libs']
236  except KeyError:  except KeyError:
# Line 262  try: Line 278  try:
278  except KeyError:  except KeyError:
279     boost_lib = None       boost_lib = None  
280  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:  
281     includes = env['python_path']     includes = env['python_path']
282     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
283  except KeyError:  except KeyError:
# Line 298  try: Line 300  try:
300  except KeyError:  except KeyError:
301     epydoc_path = None       epydoc_path = None  
302  try:  try:
    epydoc_pythonpath = env['epydoc_pythonpath']  
 except KeyError:  
    epydoc_pythonpath = None    
 try:  
303     includes = env['papi_path']     includes = env['papi_path']
304     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
305  except KeyError:  except KeyError:
# Line 316  try: Line 314  try:
314  except KeyError:  except KeyError:
315     papi_libs = None       papi_libs = None  
316    
317  # Targets  
318    try:
319       src_zipfile = env.File(env['src_zipfile'])
320    except KeyError:
321       src_zipfile = None  
322    try:
323       test_zipfile = env.File(env['test_zipfile'])
324    except KeyError:
325       test_zipfile = None  
326    try:
327       examples_zipfile = env.File(env['examples_zipfile'])
328    except KeyError:
329       examples_zipfile = None  
330    
331    try:
332       src_tarfile = env.File(env['src_tarfile'])
333    except KeyError:
334       src_tarfile = None  
335    try:
336       test_tarfile = env.File(env['test_tarfile'])
337    except KeyError:
338       test_tarfile = None  
339    try:
340       examples_tarfile = env.File(env['examples_tarfile'])
341    except KeyError:
342       examples_tarfile = None  
343    
344    try:
345       guide_pdf = env.File(env['guide_pdf'])
346    except KeyError:
347       guide_pdf = None  
348    
349    try:
350       guide_html_index = env.File('index.htm',env['guide_html'])
351    except KeyError:
352       guide_html_index = None  
353    
354    try:
355       api_epydoc = env.Dir(env['api_epydoc'])
356    except KeyError:
357       api_epydoc = None  
358    
359    # Zipgets
360      
361  env.Default(libinstall)  env.Default(libinstall)
362  env.Default(incinstall)  env.Default(incinstall)
363  env.Default(pyinstall)  env.Default(pyinstall)
364  env.Alias('build_tests')  env.Alias('release_src',[ src_zipfile, src_tarfile ])  
365  env.Alias('run_tests')  env.Alias('release_tests',[ test_zipfile, test_tarfile])
366  env.Alias('py_tests')  env.Alias('release_examples',[ examples_zipfile, examples_tarfile])
367  env.Alias('all_tests', ['run_tests', 'py_tests'])  env.Alias('api_epydoc',api_epydoc)
368    env.Alias('docs',[ 'release_examples', guide_pdf, guide_html_index, api_epydoc])
369    env.Alias('release', ['release_src', 'release_tests', 'docs'])
370    env.Alias('build_tests')    # target to build all C++ tests
371    env.Alias('build_py_tests') # target to build all python tests
372    env.Alias('build_all_tests', [ 'build_tests', 'build_py_tests' ] ) # target to build all python tests
373    env.Alias('run_tests', 'build_tests')   # target to run all C++ test
374    env.Alias('py_tests', 'build_py_tests') # taget to run all released python tests
375    env.Alias('all_tests', ['run_tests', 'py_tests']) # target to run all C++ and released python tests
376    
377  # Python install - esys __init__.py  # Python install - esys __init__.py
378  # 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
379  # create the file if it doesn't exist  # create the file if it doesn't exist
380  env.Command('esys/__init__.py', None, 'touch $TARGET')  env.Command(pyinstall+'/__init__.py', None, 'touch $TARGET')
381    
382  # Allow sconscripts to see the env  # Allow sconscripts to see the env
383  Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs",  Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs",
384      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "epydoc_pythonpath", "papi_libs", "cppunit_lib", "sys_libs" ])      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs",
385            "sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "examples_tarfile", "examples_zipfile",
386            "guide_pdf", "guide_html_index", "api_epydoc"])
387    
388  # End initialisation section  # End initialisation section
389  # Begin configuration section  # Begin configuration section
390    # adds this file and the scons option directore to the source tar
391    release_srcfiles=[env.File('SConstruct'),]+[ env.File(x) for x in glob.glob('scons/*.py') ]
392    release_testfiles=[env.File('README_TESTS'),]
393    env.Zip(src_zipfile, release_srcfiles)
394    env.Zip(test_zipfile, release_testfiles)
395    env.Tar(src_tarfile, release_srcfiles)
396    env.Tar(test_tarfile, release_testfiles)
397    
398  # Insert new components to be build here  # Insert new components to be build here
399  # 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
400  # 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 348  env.SConscript(dirs = ['escript/src'], b Line 407  env.SConscript(dirs = ['escript/src'], b
407  env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)  env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)
408  env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)  env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)
409  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)
410    env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0)
411  # FIXME:need to be incorporated into build system  env.SConscript(dirs = ['pyvisi/py_src'], build_dir='build/$PLATFORM/pyvisi', duplicate=0)
 # FIXME: 'pyvisi/SConstruct']  
 # FIXME: 'doc/SConstruct']  
 # FIXME: 'doc/SConstruct']  

Legend:
Removed from v.684  
changed lines
  Added in v.722

  ViewVC Help
Powered by ViewVC 1.1.26