/[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 707 by gross, Wed Apr 12 23:58:02 2006 UTC revision 805 by gross, Thu Aug 10 06:09:02 2006 UTC
# Line 22  import sys, os Line 22  import sys, os
22  if sys.path.count('scons')==0: sys.path.append('scons')  if sys.path.count('scons')==0: sys.path.append('scons')
23  import scons_extensions  import scons_extensions
24    
25    # check if UMFPACK is installed on the system:
26    if os.path.isdir('/opt/UMFPACK/Include') and os.path.isdir('/opt/UMFPACK/Lib') and os.path.isdir('/opt/AMD/Lib'):
27       umf_path_default='/opt/UMFPACK/Include'
28       umf_lib_path_default='/opt/UMFPACK/Lib'
29       amd_lib_path_default='/opt/AMD/Lib'
30       umf_libs_default=['amd', 'umfpack']
31    else:
32       umf_path_default=None
33       umf_lib_path_default=None
34       amd_lib_path_default=None
35       umf_libs_default=None
36    if os.path.isdir('/opt/GotoBLAS'):
37       blas_path_default='/opt/GotoBLAS'
38       blas_lib_path_default='/opt/GotoBLAS'
39       blas_libs_default=['goto',]
40    else:
41       blas_path_default=None
42       blas_lib_path_default=None
43       blas_libs_default=None
44  # Default options and options help text  # Default options and options help text
45  # These are defaults and can be overridden using command line arguments or an options file.  # These are defaults and can be overridden using command line arguments or an options file.
46  # if the options_file or ARGUMENTS do not exist then the ones listed as default here are used  # if the options_file or ARGUMENTS do not exist then the ones listed as default here are used
# Line 52  opts.AddOptions( Line 71  opts.AddOptions(
71    ('examples_tarfile', 'the examples tar file will be installed.', Dir('#.').abspath+"/release/doc/escript_examples.tar.gz"),    ('examples_tarfile', 'the examples tar file will be installed.', Dir('#.').abspath+"/release/doc/escript_examples.tar.gz"),
72    ('examples_zipfile', 'the examples zip file will be installed.', Dir('#.').abspath+"/release/doc/escript_examples.zip"),    ('examples_zipfile', 'the examples zip file will be installed.', Dir('#.').abspath+"/release/doc/escript_examples.zip"),
73    ('guide_pdf', 'name of the user guide in pdf format', Dir('#.').abspath+"/release/doc/user/guide.pdf"),    ('guide_pdf', 'name of the user guide in pdf format', Dir('#.').abspath+"/release/doc/user/guide.pdf"),
74      ('api_epydoc', 'name of the epydoc api docs directory',Dir('#.').abspath+"/release/doc/epydoc"),
75    ('guide_html', 'name of the directory for user guide in html format', Dir('#.').abspath+"/release/doc/user/html"),    ('guide_html', 'name of the directory for user guide in html format', Dir('#.').abspath+"/release/doc/user/html"),
76  # Compilation options  # Compilation options
77    BoolOption('dodebug', 'Do you want a debug build?', 'no'),    BoolOption('dodebug', 'Do you want a debug build?', 'no'),
# Line 61  opts.AddOptions( Line 81  opts.AddOptions(
81    ('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'),
82    ('cxx_flags', 'C++ compiler flags to use (Release build)', '--no-warn -ansi'),    ('cxx_flags', 'C++ compiler flags to use (Release build)', '--no-warn -ansi'),
83    ('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'),
84      ('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'),
85      ('cc_flags_debug_MPI', 'C compiler flags to use (Debug MPI build)', '-g -O0 -c99 -w1 -fpic -wd161'),
86      ('cxx_flags_MPI', 'C++ compiler flags to use (Release MPI build)', '-ansi -wd1563 -wd161'),
87      ('cxx_flags_debug_MPI', 'C++ compiler flags to use (Debug MPI build)', '-ansi -DDOASSERT -DDOPROF -wd1563 -wd161'),
88    ('ar_flags', 'Static library archiver flags to use', None),    ('ar_flags', 'Static library archiver flags to use', None),
89    ('sys_libs', 'System libraries to link with', None),    ('sys_libs', 'System libraries to link with', None),
90    ('tar_flags','flags for zip files','-c -z'),    ('tar_flags','flags for zip files','-c -z'),
# Line 72  opts.AddOptions( Line 96  opts.AddOptions(
96    PathOption('scsl_path', 'Path to SCSL includes', None),    PathOption('scsl_path', 'Path to SCSL includes', None),
97    PathOption('scsl_lib_path', 'Path to SCSL libs', None),    PathOption('scsl_lib_path', 'Path to SCSL libs', None),
98    ('scsl_libs', 'SCSL libraries to link with', None),    ('scsl_libs', 'SCSL libraries to link with', None),
99      ('scsl_libs_MPI', 'SCSL libraries to link with for MPI build', None),
100  # UMFPACK  # UMFPACK
101    PathOption('umf_path', 'Path to UMF includes', None),    PathOption('umf_path', 'Path to UMF includes', umf_path_default),
102    PathOption('umf_lib_path', 'Path to UMF libs', None),    PathOption('umf_lib_path', 'Path to UMF libs', umf_lib_path_default),
103    ('umf_libs', 'UMF libraries to link with', None),    PathOption('amd_lib_path', 'Path to UMF libs', amd_lib_path_default),
104      ('umf_libs', 'UMF libraries to link with', umf_libs_default),
105    # BLAS
106      PathOption('blas_path', 'Path to BLAS includes', blas_path_default),
107      PathOption('blas_lib_path', 'Path to BLAS libs', blas_lib_path_default ),
108      ('blas_libs', 'BLAS libraries to link with', blas_libs_default ),
109  # Python  # Python
110  # locations of include files for python  # locations of include files for python
111    PathOption('python_path', 'Path to Python includes', '/usr/include/python%s.%s'%(sys.version_info[0],sys.version_info[1])),    PathOption('python_path', 'Path to Python includes', '/usr/include/python%s.%s'%(sys.version_info[0],sys.version_info[1])),
# Line 86  opts.AddOptions( Line 116  opts.AddOptions(
116    PathOption('boost_lib_path', 'Path to Boost libs', '/usr/lib'),    PathOption('boost_lib_path', 'Path to Boost libs', '/usr/lib'),
117    ('boost_lib', 'Boost libraries to link with', ['boost_python',]),    ('boost_lib', 'Boost libraries to link with', ['boost_python',]),
118  # Doc building  # Doc building
119    PathOption('doxygen_path', 'Path to Doxygen executable', None),  #  PathOption('doxygen_path', 'Path to Doxygen executable', None),
120    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),  
121  # PAPI  # PAPI
122    PathOption('papi_path', 'Path to PAPI includes', None),    PathOption('papi_path', 'Path to PAPI includes', None),
123    PathOption('papi_lib_path', 'Path to PAPI libs', None),    PathOption('papi_lib_path', 'Path to PAPI libs', None),
124    ('papi_libs', 'PAPI libraries to link with', None),    ('papi_libs', 'PAPI libraries to link with', None),
125    # MPI
126      BoolOption('useMPI', 'Compile parallel version using MPI', 'no'),
127  )  )
128    
129  # Initialise Scons Build Environment  # Initialise Scons Build Environment
# Line 126  if os.name != "nt" and os.uname()[4]=='i Line 157  if os.name != "nt" and os.uname()[4]=='i
157     if env['CXX'] == 'icpc':     if env['CXX'] == 'icpc':
158        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
159  elif os.name == "nt":  elif os.name == "nt":
    # FIXME: Need to implement equivalent of ld library path for windoze  
160     env = Environment(tools = ['default', 'intelc'], options = opts)     env = Environment(tools = ['default', 'intelc'], options = opts)
161     env['ENV']['PYTHONPATH'] = python_path     env['ENV']['PYTHONPATH'] = python_path
162  else:  else:
# Line 161  try: Line 191  try:
191     libinstall = env['libinstall']     libinstall = env['libinstall']
192     env.Append(LIBPATH = [libinstall,])     env.Append(LIBPATH = [libinstall,])
193     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)
194       if env['PLATFORM'] == "win32":
195          env.PrependENVPath('PATH', libinstall)
196          env.PrependENVPath('PATH', env['boost_lib_path'])
197  except KeyError:  except KeyError:
198     libinstall = None       libinstall = None  
199  try:  try:
# Line 173  try: Line 206  try:
206  except KeyError:  except KeyError:
207     dodebug = None       dodebug = None  
208  try:  try:
209       useMPI = env['useMPI']
210    except KeyError:
211       useMPI = None  
212    try:
213     cc_defines = env['cc_defines']     cc_defines = env['cc_defines']
214     env.Append(CPPDEFINES = [cc_defines,])     env.Append(CPPDEFINES = cc_defines)
215  except KeyError:  except KeyError:
216     pass     pass
217  if dodebug:  if dodebug:
218     try:    if useMPI:
219        try:
220          flags = env['cc_flags_debug_MPI']
221          env.Append(CCFLAGS = flags)
222        except KeyError:
223          pass
224      else:                      
225        try:
226        flags = env['cc_flags_debug']        flags = env['cc_flags_debug']
227        env.Append(CCFLAGS = flags)        env.Append(CCFLAGS = flags)
228     except KeyError:      except KeyError:
229        pass        pass
230  else:  else:
231      if useMPI:
232     try:     try:
233        flags = env['cc_flags']       flags = env['cc_flags_MPI']
234        env.Append(CCFLAGS = flags)       env.Append(CCFLAGS = flags)
235     except KeyError:     except KeyError:
236        pass        pass
237      else:
 if dodebug:  
238     try:     try:
239        flags = env['cxx_flags_debug']        flags = env['cc_flags']
240        env.Append(CXXFLAGS = flags)        env.Append(CCFLAGS = flags)
241     except KeyError:     except KeyError:
242        pass        pass
243    if dodebug:
244       if useMPI:
245         try:
246            flags = env['cxx_flags_debug_MPI']
247            env.Append(CXXFLAGS = flags)
248         except KeyError:
249            pass
250       else:
251         try:
252            flags = env['cxx_flags_debug']
253            env.Append(CXXFLAGS = flags)
254         except KeyError:
255            pass
256  else:  else:
257     try:     if useMPI:
258        flags = env['cxx_flags']       try:
259        env.Append(CXXFLAGS = flags)          flags = env['cxx_flags_MPI']
260     except KeyError:          env.Append(CXXFLAGS = flags)
261        pass       except KeyError:
262            pass
263       else:
264         try:
265            flags = env['cxx_flags']
266            env.Append(CXXFLAGS = flags)
267         except KeyError:
268            pass
269  try:  try:
270     flags = env['ar_flags']     flags = env['ar_flags']
271     env.Append(ARFLAGS = flags)     env.Append(ARFLAGS = flags)
# Line 245  try: Line 308  try:
308     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
309  except KeyError:  except KeyError:
310     pass     pass
311  try:  if useMPI:  
312     scsl_libs = env['scsl_libs']    try:
313  except KeyError:      scsl_libs = env['scsl_libs_MPI']
314     scsl_libs = ''    except KeyError:
315        scsl_libs = ''
316    else:        
317      try:
318        scsl_libs = env['scsl_libs']
319      except KeyError:
320        scsl_libs = ''
321    
322  try:  try:
323     includes = env['umf_path']     includes = env['umf_path']
324     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
325  except KeyError:  except KeyError:
326     pass     pass
327    
328  try:  try:
329     lib_path = env['umf_lib_path']     lib_path = env['umf_lib_path']
330     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
331  except KeyError:  except KeyError:
332     pass     pass
333    
334    try:
335       lib_path = env['amd_lib_path']
336       env.Append(LIBPATH = [lib_path,])
337    except KeyError:
338       pass
339    
340  try:  try:
341     umf_libs = env['umf_libs']     umf_libs = env['umf_libs']
342  except KeyError:  except KeyError:
343     umf_libs = ''     umf_libs = ''
344    
345    try:
346       includes = env['blas_path']
347       env.Append(CPPPATH = [includes,])
348    except KeyError:
349       pass
350    try:
351       lib_path = env['blas_lib_path']
352       env.Append(LIBPATH = [lib_path,])
353    except KeyError:
354       pass
355    try:
356       blas_libs = env['blas_libs']
357    except KeyError:
358       blas_libs = ''
359    
360  try:  try:
361     includes = env['boost_path']     includes = env['boost_path']
362     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
# Line 300  try: Line 394  try:
394  except KeyError:  except KeyError:
395     epydoc_path = None       epydoc_path = None  
396  try:  try:
    epydoc_pythonpath = env['epydoc_pythonpath']  
 except KeyError:  
    epydoc_pythonpath = None    
 try:  
397     includes = env['papi_path']     includes = env['papi_path']
398     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
399  except KeyError:  except KeyError:
# Line 355  try: Line 445  try:
445  except KeyError:  except KeyError:
446     guide_html_index = None       guide_html_index = None  
447    
448    try:
449       api_epydoc = env.Dir(env['api_epydoc'])
450    except KeyError:
451       api_epydoc = None  
452    
453  # Zipgets  # Zipgets
454      
455  env.Default(libinstall)  env.Default(libinstall)
456  env.Default(incinstall)  env.Default(incinstall)
457  env.Default(pyinstall)  env.Default(pyinstall)
458  env.Alias('release_src',[ src_zipfile, src_tarfile ])    env.Alias('release_src',[ src_zipfile, src_tarfile ])  
459  env.Alias('release_tests',[ test_zipfile, test_tarfile])  env.Alias('release_tests',[ test_zipfile, test_tarfile])
460  env.Alias('release_examples',[ examples_zipfile, examples_tarfile])  env.Alias('release_examples',[ examples_zipfile, examples_tarfile])
461  env.Alias('docs',[ 'release_examples', guide_pdf, guide_html_index ])  env.Alias('api_epydoc',api_epydoc)
462    env.Alias('docs',[ 'release_examples', guide_pdf, guide_html_index, api_epydoc])
463  env.Alias('release', ['release_src', 'release_tests', 'docs'])  env.Alias('release', ['release_src', 'release_tests', 'docs'])
464  env.Alias('build_tests')    # target to build all C++ tests  env.Alias('build_tests')    # target to build all C++ tests
465  env.Alias('build_py_tests') # target to build all python tests  env.Alias('build_py_tests') # target to build all python tests
# Line 372  env.Alias('py_tests', 'build_py_tests') Line 469  env.Alias('py_tests', 'build_py_tests')
469  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
470    
471  # Python install - esys __init__.py  # Python install - esys __init__.py
472  # 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'))
473  # create the file if it doesn't exist  env.Alias(init_target)
 env.Command(pyinstall+'/__init__.py', None, 'touch $TARGET')  
474    
475  # Allow sconscripts to see the env  # Allow sconscripts to see the env
476  Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs",  Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs",
477      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "epydoc_pythonpath", "papi_libs",      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs",
478          "sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "examples_tarfile", "examples_zipfile",          "sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "examples_tarfile", "examples_zipfile",
479          "guide_pdf", "guide_html_index"])          "guide_pdf", "guide_html_index", "api_epydoc", "useMPI"])
480    
481  # End initialisation section  # End initialisation section
482  # Begin configuration section  # Begin configuration section
# Line 405  env.SConscript(dirs = ['esysUtils/src'], Line 501  env.SConscript(dirs = ['esysUtils/src'],
501  env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)  env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)
502  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)
503  env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0)  env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0)
504  #env.SConscript(dirs = ['pyvisi/py_src'], build_dir='build/$PLATFORM/pyvisi', duplicate=0) not part of beta.0  env.SConscript(dirs = ['pyvisi/py_src'], build_dir='build/$PLATFORM/pyvisi', duplicate=0)
505    
506    # added by Ben Cumming
507    env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)
508    #env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0)

Legend:
Removed from v.707  
changed lines
  Added in v.805

  ViewVC Help
Powered by ViewVC 1.1.26