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

Diff of /branches/DataC_2092/SConstruct

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

revision 705 by gross, Fri Apr 7 17:57:37 2006 UTC revision 784 by bcumming, Wed Jul 19 05:38:14 2006 UTC
# Line 46  opts.AddOptions( Line 46  opts.AddOptions(
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"),    ('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_src_tests.zip"),    ('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"),    ('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_src_tests.tar.gz"),    ('test_tarfile', 'the test tar file will be installed.', Dir('#.').abspath+"/release/escript_tests.tar.gz"),
52    ('doc', 'where the doc files will be installed', Dir('#.').abspath+'/release/doc'),    ('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?', 'no'),    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),
# Line 59  opts.AddOptions( Line 62  opts.AddOptions(
62    ('cc_flags_debug', 'C compiler flags to use (Debug build)', '-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas'),    ('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)', '--no-warn -ansi'),    ('cxx_flags', 'C++ compiler flags to use (Release build)', '--no-warn -ansi'),
64    ('cxx_flags_debug', 'C++ compiler flags to use (Debug build)', '--no-warn -ansi -DDOASSERT -DDOPROF'),    ('cxx_flags_debug', 'C++ compiler flags to use (Debug build)', '--no-warn -ansi -DDOASSERT -DDOPROF'),
65      ('cc_flags_MPI','C compiler flags to use (Release MPI build)', '-O3 -ftz -IPF_ftlacc- -IPF_fma -fno-alias -fno-alias -c99 -w1 -fpic -wd161'),
66      ('cc_flags_debug_MPI', 'C compiler flags to use (Debug MPI build)', '-g -O0 -c99 -w1 -fpic -wd161'),
67      ('cxx_flags_MPI', 'C++ compiler flags to use (Release MPI build)', '-ansi -wd1563 -wd161'),
68      ('cxx_flags_debug_MPI', 'C++ compiler flags to use (Debug MPI build)', '-ansi -DDOASSERT -DDOPROF -wd1563 -wd161'),
69    ('ar_flags', 'Static library archiver flags to use', None),    ('ar_flags', 'Static library archiver flags to use', None),
70    ('sys_libs', 'System libraries to link with', None),    ('sys_libs', 'System libraries to link with', None),
71    ('tar_flags','flags for zip files','-c -z'),    ('tar_flags','flags for zip files','-c -z'),
# Line 70  opts.AddOptions( Line 77  opts.AddOptions(
77    PathOption('scsl_path', 'Path to SCSL includes', None),    PathOption('scsl_path', 'Path to SCSL includes', None),
78    PathOption('scsl_lib_path', 'Path to SCSL libs', None),    PathOption('scsl_lib_path', 'Path to SCSL libs', None),
79    ('scsl_libs', 'SCSL libraries to link with', None),    ('scsl_libs', 'SCSL libraries to link with', None),
80      ('scsl_libs_MPI', 'SCSL libraries to link with for MPI build', None),
81  # UMFPACK  # UMFPACK
82    PathOption('umf_path', 'Path to UMF includes', None),    PathOption('umf_path', 'Path to UMF includes', None),
83    PathOption('umf_lib_path', 'Path to UMF libs', None),    PathOption('umf_lib_path', 'Path to UMF libs', None),
# Line 84  opts.AddOptions( Line 92  opts.AddOptions(
92    PathOption('boost_lib_path', 'Path to Boost libs', '/usr/lib'),    PathOption('boost_lib_path', 'Path to Boost libs', '/usr/lib'),
93    ('boost_lib', 'Boost libraries to link with', ['boost_python',]),    ('boost_lib', 'Boost libraries to link with', ['boost_python',]),
94  # Doc building  # Doc building
95    PathOption('doxygen_path', 'Path to Doxygen executable', None),  #  PathOption('doxygen_path', 'Path to Doxygen executable', None),
96    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),  
97  # PAPI  # PAPI
98    PathOption('papi_path', 'Path to PAPI includes', None),    PathOption('papi_path', 'Path to PAPI includes', None),
99    PathOption('papi_lib_path', 'Path to PAPI libs', None),    PathOption('papi_lib_path', 'Path to PAPI libs', None),
100    ('papi_libs', 'PAPI libraries to link with', None),    ('papi_libs', 'PAPI libraries to link with', None),
101    # MPI
102      BoolOption('useMPI', 'Compile parallel version using MPI', 'no'),
103  )  )
104    
105  # Initialise Scons Build Environment  # Initialise Scons Build Environment
# Line 124  if os.name != "nt" and os.uname()[4]=='i Line 133  if os.name != "nt" and os.uname()[4]=='i
133     if env['CXX'] == 'icpc':     if env['CXX'] == 'icpc':
134        env['LINK'] = env['CXX'] # version >=9 of intel c++ compiler requires use of icpc to link in C++ runtimes (icc does not). FIXME: this behaviour could be directly incorporated into scons intelc.py        env['LINK'] = env['CXX'] # version >=9 of intel c++ compiler requires use of icpc to link in C++ runtimes (icc does not). FIXME: this behaviour could be directly incorporated into scons intelc.py
135  elif os.name == "nt":  elif os.name == "nt":
    # FIXME: Need to implement equivalent of ld library path for windoze  
136     env = Environment(tools = ['default', 'intelc'], options = opts)     env = Environment(tools = ['default', 'intelc'], options = opts)
137     env['ENV']['PYTHONPATH'] = python_path     env['ENV']['PYTHONPATH'] = python_path
138  else:  else:
# Line 159  try: Line 167  try:
167     libinstall = env['libinstall']     libinstall = env['libinstall']
168     env.Append(LIBPATH = [libinstall,])     env.Append(LIBPATH = [libinstall,])
169     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)
170       if env['PLATFORM'] == "win32":
171          env.PrependENVPath('PATH', libinstall)
172          env.PrependENVPath('PATH', env['boost_lib_path'])
173  except KeyError:  except KeyError:
174     libinstall = None       libinstall = None  
175  try:  try:
# Line 171  try: Line 182  try:
182  except KeyError:  except KeyError:
183     dodebug = None       dodebug = None  
184  try:  try:
185       useMPI = env['useMPI']
186    except KeyError:
187       useMPI = None  
188    try:
189     cc_defines = env['cc_defines']     cc_defines = env['cc_defines']
190     env.Append(CPPDEFINES = [cc_defines,])     env.Append(CPPDEFINES = cc_defines)
191  except KeyError:  except KeyError:
192     pass     pass
193  if dodebug:  if dodebug:
194     try:    if useMPI:
195        try:
196          flags = env['cc_flags_debug_MPI']
197          env.Append(CCFLAGS = flags)
198        except KeyError:
199          pass
200      else:                      
201        try:
202        flags = env['cc_flags_debug']        flags = env['cc_flags_debug']
203        env.Append(CCFLAGS = flags)        env.Append(CCFLAGS = flags)
204     except KeyError:      except KeyError:
205        pass        pass
206  else:  else:
207      if useMPI:
208     try:     try:
209        flags = env['cc_flags']       flags = env['cc_flags_MPI']
210        env.Append(CCFLAGS = flags)       env.Append(CCFLAGS = flags)
211     except KeyError:     except KeyError:
212        pass        pass
213      else:
 if dodebug:  
214     try:     try:
215        flags = env['cxx_flags_debug']        flags = env['cc_flags']
216        env.Append(CXXFLAGS = flags)        env.Append(CCFLAGS = flags)
217     except KeyError:     except KeyError:
218        pass        pass
219    if dodebug:
220       if useMPI:
221         try:
222            flags = env['cxx_flags_debug_MPI']
223            env.Append(CXXFLAGS = flags)
224         except KeyError:
225            pass
226       else:
227         try:
228            flags = env['cxx_flags_debug']
229            env.Append(CXXFLAGS = flags)
230         except KeyError:
231            pass
232  else:  else:
233     try:     if useMPI:
234        flags = env['cxx_flags']       try:
235        env.Append(CXXFLAGS = flags)          flags = env['cxx_flags_MPI']
236     except KeyError:          env.Append(CXXFLAGS = flags)
237        pass       except KeyError:
238            pass
239       else:
240         try:
241            flags = env['cxx_flags']
242            env.Append(CXXFLAGS = flags)
243         except KeyError:
244            pass
245  try:  try:
246     flags = env['ar_flags']     flags = env['ar_flags']
247     env.Append(ARFLAGS = flags)     env.Append(ARFLAGS = flags)
# Line 243  try: Line 284  try:
284     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
285  except KeyError:  except KeyError:
286     pass     pass
287  try:  if useMPI:  
288     scsl_libs = env['scsl_libs']    try:
289  except KeyError:      scsl_libs = env['scsl_libs_MPI']
290     scsl_libs = ''    except KeyError:
291        scsl_libs = ''
292    else:        
293      try:
294        scsl_libs = env['scsl_libs']
295      except KeyError:
296        scsl_libs = ''
297  try:  try:
298     includes = env['umf_path']     includes = env['umf_path']
299     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
# Line 298  try: Line 345  try:
345  except KeyError:  except KeyError:
346     epydoc_path = None       epydoc_path = None  
347  try:  try:
    epydoc_pythonpath = env['epydoc_pythonpath']  
 except KeyError:  
    epydoc_pythonpath = None    
 try:  
348     includes = env['papi_path']     includes = env['papi_path']
349     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
350  except KeyError:  except KeyError:
# Line 316  try: Line 359  try:
359  except KeyError:  except KeyError:
360     papi_libs = None       papi_libs = None  
361    
362    
363  try:  try:
364     src_zipfile = env['src_zipfile']     src_zipfile = env.File(env['src_zipfile'])
365  except KeyError:  except KeyError:
366     src_zipfile = None       src_zipfile = None  
   
   
367  try:  try:
368     test_zipfile = env['test_zipfile']     test_zipfile = env.File(env['test_zipfile'])
369  except KeyError:  except KeyError:
370     test_zipfile = None       test_zipfile = None  
371    try:
372       examples_zipfile = env.File(env['examples_zipfile'])
373    except KeyError:
374       examples_zipfile = None  
375    
376  try:  try:
377     src_tarfile = env['src_tarfile']     src_tarfile = env.File(env['src_tarfile'])
378  except KeyError:  except KeyError:
379     src_tarfile = None       src_tarfile = None  
380    try:
381       test_tarfile = env.File(env['test_tarfile'])
382    except KeyError:
383       test_tarfile = None  
384    try:
385       examples_tarfile = env.File(env['examples_tarfile'])
386    except KeyError:
387       examples_tarfile = None  
388    
389    try:
390       guide_pdf = env.File(env['guide_pdf'])
391    except KeyError:
392       guide_pdf = None  
393    
394  try:  try:
395     test_tarfile = env['test_tarfile']     guide_html_index = env.File('index.htm',env['guide_html'])
396  except KeyError:  except KeyError:
397     test_tarfile = None       guide_html_index = None  
398    
399  try:  try:
400     doc = env['doc']     api_epydoc = env.Dir(env['api_epydoc'])
401  except KeyError:  except KeyError:
402     doc = None       api_epydoc = None  
403    
404  # Zipgets  # Zipgets
405      
406  env.Default(libinstall)  env.Default(libinstall)
407  env.Default(incinstall)  env.Default(incinstall)
408  env.Default(pyinstall)  env.Default(pyinstall)
409  env.Alias('release_src',[ src_zipfile, src_tarfile ])    env.Alias('release_src',[ src_zipfile, src_tarfile ])  
410  env.Alias('release_tests',[ test_zipfile, test_tarfile])  env.Alias('release_tests',[ test_zipfile, test_tarfile])
411  env.Alias('release', ['release_src', 'release_tests'])  env.Alias('release_examples',[ examples_zipfile, examples_tarfile])
412  env.Alias('docs')  env.Alias('api_epydoc',api_epydoc)
413    env.Alias('docs',[ 'release_examples', guide_pdf, guide_html_index, api_epydoc])
414    env.Alias('release', ['release_src', 'release_tests', 'docs'])
415  env.Alias('build_tests')    # target to build all C++ tests  env.Alias('build_tests')    # target to build all C++ tests
416  env.Alias('build_py_tests') # target to build all python tests  env.Alias('build_py_tests') # target to build all python tests
417  env.Alias('run_tests',['build_tests'])   # target to run all C++ test  env.Alias('build_all_tests', [ 'build_tests', 'build_py_tests' ] ) # target to build all python tests
418  env.Alias('py_tests', ['build_py_tests']) # taget to run all released python tests  env.Alias('run_tests', 'build_tests')   # target to run all C++ test
419    env.Alias('py_tests', 'build_py_tests') # taget to run all released python tests
420  env.Alias('all_tests', ['run_tests', 'py_tests']) # target to run all C++ and released python tests  env.Alias('all_tests', ['run_tests', 'py_tests']) # target to run all C++ and released python tests
421    
422  # Python install - esys __init__.py  # Python install - esys __init__.py
423  # 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  init_target = env.Command(pyinstall+'/__init__.py', None, Touch('$TARGET'))
424  # create the file if it doesn't exist  env.Alias(init_target)
 env.Command(pyinstall+'/__init__.py', None, 'touch $TARGET')  
425    
426  # Allow sconscripts to see the env  # Allow sconscripts to see the env
427  Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs",  Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs",
428      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "epydoc_pythonpath", "papi_libs",      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs",
429          "sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "doc" ])          "sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "examples_tarfile", "examples_zipfile",
430            "guide_pdf", "guide_html_index", "api_epydoc", "useMPI"])
431    
432  # End initialisation section  # End initialisation section
433  # Begin configuration section  # Begin configuration section
434  # adds this file and the scons option directore to the source tar  # adds this file and the scons option directore to the source tar
435  release_srcfiles=[env.File('SConstruct'),]+[ env.File(x) for x in glob.glob('scons/*.py') ]  release_srcfiles=[env.File('SConstruct'),]+[ env.File(x) for x in glob.glob('scons/*.py') ]
436  release_testfiles=[env.File('README_TESTS'),]  release_testfiles=[env.File('README_TESTS'),]
437  env.Zip(src_zipfile,release_srcfiles)  env.Zip(src_zipfile, release_srcfiles)
438  env.Zip(test_zipfile, release_testfiles)  env.Zip(test_zipfile, release_testfiles)
439  env.Tar(src_tarfile, release_srcfiles)  env.Tar(src_tarfile, release_srcfiles)
440  env.Tar(test_tarfile, release_testfiles)  env.Tar(test_tarfile, release_testfiles)
# Line 389  env.SConscript(dirs = ['escript/src'], b Line 451  env.SConscript(dirs = ['escript/src'], b
451  env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)  env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)
452  env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)  env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)
453  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)
454  #env.SConscript(dirs = ['pyvisi/py_src'], build_dir='build/$PLATFORM/pyvisi', duplicate=0)  env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0)
455    env.SConscript(dirs = ['pyvisi/py_src'], build_dir='build/$PLATFORM/pyvisi', duplicate=0)
456    
457  # FIXME:need to be incorporated into build system  # added by Ben Cumming
458  # FIXME: 'doc/SConstruct']  env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)
459  # FIXME: 'doc/SConstruct']  #env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0)

Legend:
Removed from v.705  
changed lines
  Added in v.784

  ViewVC Help
Powered by ViewVC 1.1.26