/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 757 by woo409, Mon Jun 26 13:12:56 2006 UTC revision 817 by ksteube, Sat Aug 26 03:08:52 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'):
27       umf_path_default='/opt/UMFPACK/Include'
28       umf_lib_path_default='/opt/UMFPACK/Lib'
29       umf_libs_default=['umfpack']
30    else:
31       umf_path_default=None
32       umf_lib_path_default=None
33       umf_libs_default=None
34    
35    if os.path.isdir('/opt/AMD/Include') and os.path.isdir('/opt/AMD/Lib'):
36       amd_path_default='/opt/AMD/Include'
37       amd_lib_path_default='/opt/AMD/Lib'
38       amd_libs_default=['amd']
39    else:
40       amd_path_default=None
41       amd_lib_path_default=None
42       amd_libs_default=None
43    
44    if os.path.isdir('/opt/UFconfig'):
45       ufc_path_default='/opt/UFconfig'
46    else:
47       ufc_path_default=None
48    
49  # Default options and options help text  # Default options and options help text
50  # 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.
51  # 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 62  opts.AddOptions( Line 86  opts.AddOptions(
86    ('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'),
87    ('cxx_flags', 'C++ compiler flags to use (Release build)', '--no-warn -ansi'),    ('cxx_flags', 'C++ compiler flags to use (Release build)', '--no-warn -ansi'),
88    ('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'),
89      ('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'),
90      ('cc_flags_debug_MPI', 'C compiler flags to use (Debug MPI build)', '-g -O0 -c99 -w1 -fpic -wd161'),
91      ('cxx_flags_MPI', 'C++ compiler flags to use (Release MPI build)', '-ansi -wd1563 -wd161'),
92      ('cxx_flags_debug_MPI', 'C++ compiler flags to use (Debug MPI build)', '-ansi -DDOASSERT -DDOPROF -wd1563 -wd161'),
93    ('ar_flags', 'Static library archiver flags to use', None),    ('ar_flags', 'Static library archiver flags to use', None),
94    ('sys_libs', 'System libraries to link with', None),    ('sys_libs', 'System libraries to link with', None),
95    ('tar_flags','flags for zip files','-c -z'),    ('tar_flags','flags for zip files','-c -z'),
# Line 73  opts.AddOptions( Line 101  opts.AddOptions(
101    PathOption('scsl_path', 'Path to SCSL includes', None),    PathOption('scsl_path', 'Path to SCSL includes', None),
102    PathOption('scsl_lib_path', 'Path to SCSL libs', None),    PathOption('scsl_lib_path', 'Path to SCSL libs', None),
103    ('scsl_libs', 'SCSL libraries to link with', None),    ('scsl_libs', 'SCSL libraries to link with', None),
104      ('scsl_libs_MPI', 'SCSL libraries to link with for MPI build', None),
105  # UMFPACK  # UMFPACK
106    PathOption('umf_path', 'Path to UMF includes', None),    PathOption('ufc_path', 'Path to UFconfig includes', ufc_path_default),
107    PathOption('umf_lib_path', 'Path to UMF libs', None),    PathOption('umf_path', 'Path to UMFPACK includes', umf_path_default),
108    ('umf_libs', 'UMF libraries to link with', None),    PathOption('umf_lib_path', 'Path to UMFPACK libs', umf_lib_path_default),
109      ('umf_libs', 'UMFPACK libraries to link with', umf_libs_default),
110    # AMD (used by UMFPACK)
111      PathOption('amd_path', 'Path to AMD includes', amd_path_default),
112      PathOption('amd_lib_path', 'Path to AMD libs', amd_lib_path_default),
113      ('amd_libs', 'AMD libraries to link with', amd_libs_default),
114    # BLAS
115      PathOption('blas_path', 'Path to BLAS includes', None),
116      PathOption('blas_lib_path', 'Path to BLAS libs', None),
117      ('blas_libs', 'BLAS libraries to link with', None),
118  # Python  # Python
119  # locations of include files for python  # locations of include files for python
120    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 93  opts.AddOptions( Line 131  opts.AddOptions(
131    PathOption('papi_path', 'Path to PAPI includes', None),    PathOption('papi_path', 'Path to PAPI includes', None),
132    PathOption('papi_lib_path', 'Path to PAPI libs', None),    PathOption('papi_lib_path', 'Path to PAPI libs', None),
133    ('papi_libs', 'PAPI libraries to link with', None),    ('papi_libs', 'PAPI libraries to link with', None),
134    # MPI
135      BoolOption('useMPI', 'Compile parallel version using MPI', 'no'),
136  )  )
137    
138  # Initialise Scons Build Environment  # Initialise Scons Build Environment
# Line 175  try: Line 215  try:
215  except KeyError:  except KeyError:
216     dodebug = None       dodebug = None  
217  try:  try:
218       useMPI = env['useMPI']
219    except KeyError:
220       useMPI = None  
221    try:
222     cc_defines = env['cc_defines']     cc_defines = env['cc_defines']
223     env.Append(CPPDEFINES = cc_defines)     env.Append(CPPDEFINES = cc_defines)
224  except KeyError:  except KeyError:
225     pass     pass
226    
227    if 'shake71' == socket.gethostname().split('.')[0]:
228      if useMPI:
229        env['CC'] = 'mpicc'
230        env['CXX'] = 'mpiCC'
231    
232  if dodebug:  if dodebug:
233     try:    if useMPI:
234        try:
235          flags = env['cc_flags_debug_MPI']
236          env.Append(CCFLAGS = flags)
237        except KeyError:
238          pass
239      else:                      
240        try:
241        flags = env['cc_flags_debug']        flags = env['cc_flags_debug']
242        env.Append(CCFLAGS = flags)        env.Append(CCFLAGS = flags)
243     except KeyError:      except KeyError:
244        pass        pass
245  else:  else:
246      if useMPI:
247     try:     try:
248        flags = env['cc_flags']       flags = env['cc_flags_MPI']
249        env.Append(CCFLAGS = flags)       env.Append(CCFLAGS = flags)
250     except KeyError:     except KeyError:
251        pass        pass
252      else:
 if dodebug:  
253     try:     try:
254        flags = env['cxx_flags_debug']        flags = env['cc_flags']
255        env.Append(CXXFLAGS = flags)        env.Append(CCFLAGS = flags)
256     except KeyError:     except KeyError:
257        pass        pass
258    if dodebug:
259       if useMPI:
260         try:
261            flags = env['cxx_flags_debug_MPI']
262            env.Append(CXXFLAGS = flags)
263         except KeyError:
264            pass
265       else:
266         try:
267            flags = env['cxx_flags_debug']
268            env.Append(CXXFLAGS = flags)
269         except KeyError:
270            pass
271  else:  else:
272     try:     if useMPI:
273        flags = env['cxx_flags']       try:
274        env.Append(CXXFLAGS = flags)          flags = env['cxx_flags_MPI']
275     except KeyError:          env.Append(CXXFLAGS = flags)
276        pass       except KeyError:
277            pass
278       else:
279         try:
280            flags = env['cxx_flags']
281            env.Append(CXXFLAGS = flags)
282         except KeyError:
283            pass
284  try:  try:
285     flags = env['ar_flags']     flags = env['ar_flags']
286     env.Append(ARFLAGS = flags)     env.Append(ARFLAGS = flags)
# Line 233  try: Line 309  try:
309  except KeyError:  except KeyError:
310     pass     pass
311    
312  try:  if useMPI:
    mkl_libs = env['mkl_libs']  
 except KeyError:  
313     mkl_libs = ''     mkl_libs = ''
314    else:
315       try:
316          mkl_libs = env['mkl_libs']
317       except KeyError:
318          mkl_libs = ''
319    
320  try:  try:
321     includes = env['scsl_path']     includes = env['scsl_path']
322     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
323  except KeyError:  except KeyError:
324     pass     pass
325    
326  try:  try:
327     lib_path = env['scsl_lib_path']     lib_path = env['scsl_lib_path']
328     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
329  except KeyError:  except KeyError:
330     pass     pass
331  try:  
332     scsl_libs = env['scsl_libs']  if useMPI:  
333  except KeyError:    try:
334     scsl_libs = ''      scsl_libs = env['scsl_libs_MPI']
335      except KeyError:
336        scsl_libs = ''
337    else:        
338      try:
339        scsl_libs = env['scsl_libs']
340      except KeyError:
341        scsl_libs = ''
342    
343  try:  try:
344     includes = env['umf_path']     includes = env['umf_path']
345     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
346  except KeyError:  except KeyError:
347     pass     pass
348    
349  try:  try:
350     lib_path = env['umf_lib_path']     lib_path = env['umf_lib_path']
351     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
352  except KeyError:  except KeyError:
353     pass     pass
354    
355    if useMPI:  
356        umf_libs = ''
357    else:
358       try:
359          umf_libs = env['umf_libs']
360       except KeyError:
361          umf_libs = ''
362    
363    try:
364       includes = env['ufc_path']
365       env.Append(CPPPATH = [includes,])
366    except KeyError:
367       pass
368    
369  try:  try:
370     umf_libs = env['umf_libs']     includes = env['amd_path']
371       env.Append(CPPPATH = [includes,])
372  except KeyError:  except KeyError:
373     umf_libs = ''     pass
374    
375    try:
376       lib_path = env['amd_lib_path']
377       env.Append(LIBPATH = [lib_path,])
378    except KeyError:
379       pass
380    
381    if useMPI:  
382        amd_libs = ''
383    else:
384       try:
385          amd_libs = env['amd_libs']
386       except KeyError:
387          amd_libs = ''
388    
389    try:
390       includes = env['blas_path']
391       env.Append(CPPPATH = [includes,])
392    except KeyError:
393       pass
394    
395    try:
396       lib_path = env['blas_lib_path']
397       env.Append(LIBPATH = [lib_path,])
398    except KeyError:
399       pass
400    
401    try:
402       blas_libs = env['blas_libs']
403    except KeyError:
404       blas_libs = ''
405    
406  try:  try:
407     includes = env['boost_path']     includes = env['boost_path']
408     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
# Line 367  env.Alias('release_src',[ src_zipfile, s Line 505  env.Alias('release_src',[ src_zipfile, s
505  env.Alias('release_tests',[ test_zipfile, test_tarfile])  env.Alias('release_tests',[ test_zipfile, test_tarfile])
506  env.Alias('release_examples',[ examples_zipfile, examples_tarfile])  env.Alias('release_examples',[ examples_zipfile, examples_tarfile])
507  env.Alias('api_epydoc',api_epydoc)  env.Alias('api_epydoc',api_epydoc)
508  env.Alias('docs',[ 'release_examples', guide_pdf, guide_html_index, api_epydoc])  env.Alias('guide_pdf', guide_pdf)
509    env.Alias('docs',[ 'release_examples', 'guide_pdf', guide_html_index, api_epydoc])
510  env.Alias('release', ['release_src', 'release_tests', 'docs'])  env.Alias('release', ['release_src', 'release_tests', 'docs'])
511  env.Alias('build_tests')    # target to build all C++ tests  env.Alias('build_tests')    # target to build all C++ tests
512  env.Alias('build_py_tests') # target to build all python tests  env.Alias('build_py_tests') # target to build all python tests
# Line 381  init_target = env.Command(pyinstall+'/__ Line 520  init_target = env.Command(pyinstall+'/__
520  env.Alias(init_target)  env.Alias(init_target)
521    
522  # Allow sconscripts to see the env  # Allow sconscripts to see the env
523  Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs",  Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs",
524      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs",      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs",
525          "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",
526          "guide_pdf", "guide_html_index", "api_epydoc"])          "guide_pdf", "guide_html_index", "api_epydoc", "useMPI"])
527    
528  # End initialisation section  # End initialisation section
529  # Begin configuration section  # Begin configuration section
# Line 413  env.SConscript(dirs = ['pyvisi/py_src'], Line 552  env.SConscript(dirs = ['pyvisi/py_src'],
552    
553  # added by Ben Cumming  # added by Ben Cumming
554  env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)  env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)
555    #env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0)

Legend:
Removed from v.757  
changed lines
  Added in v.817

  ViewVC Help
Powered by ViewVC 1.1.26