/[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 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 62  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 73  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 93  opts.AddOptions( Line 122  opts.AddOptions(
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 175  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 247  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 384  env.Alias(init_target) Line 476  env.Alias(init_target)
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", "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", "api_epydoc"])          "guide_pdf", "guide_html_index", "api_epydoc", "useMPI"])
480    
481  # End initialisation section  # End initialisation section
482  # Begin configuration section  # Begin configuration section
# Line 413  env.SConscript(dirs = ['pyvisi/py_src'], Line 505  env.SConscript(dirs = ['pyvisi/py_src'],
505    
506  # added by Ben Cumming  # added by Ben Cumming
507  env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)  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.757  
changed lines
  Added in v.805

  ViewVC Help
Powered by ViewVC 1.1.26