/[escript]/trunk-mpi-branch/SConstruct
ViewVC logotype

Diff of /trunk-mpi-branch/SConstruct

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

trunk/SConstruct revision 684 by robwdcock, Mon Mar 27 07:34:07 2006 UTC trunk-mpi-branch/SConstruct revision 1087 by gross, Thu Apr 12 10:01:47 2007 UTC
# Line 1  Line 1 
1  #          Copyright 2006 by ACcESS MNRF                    #         Copyright 2006 by ACcESS MNRF
2  #                                                            #
3  #              http://www.access.edu.au                      #              http://www.access.edu.au
4  #       Primary Business: Queensland, Australia              #       Primary Business: Queensland, Australia
5  #  Licensed under the Open Software License version 3.0      #  Licensed under the Open Software License version 3.0
6  #     http://www.opensource.org/licenses/osl-3.0.php        #     http://www.opensource.org/licenses/osl-3.0.php
7  #                                                            #
8  #  #
9  #  #
10    
11  # top-level Scons configuration file for all esys13 modules  # top-level Scons configuration file for all esys13 modules
12  # Begin initialisation Section  # Begin initialisation Section
13  # all of this section just intialises default environments and helper  # all of this section just intialises default environments and helper
14  # scripts. You shouldn't need to modify this section.  # scripts. You shouldn't need to modify this section.
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    import socket
22  # Add our extensions  # Add our extensions
23  if sys.path.count('scons')==0: sys.path.append('scons')  if sys.path.count('scons')==0: sys.path.append('scons')
24  import scons_extensions  import scons_extensions
25    
26    # check if UMFPACK is installed on the system:
27    if os.path.isdir('/opt/UMFPACK/Include') and os.path.isdir('/opt/UMFPACK/Lib'):
28       umf_path_default='/opt/UMFPACK/Include'
29       umf_lib_path_default='/opt/UMFPACK/Lib'
30       umf_libs_default=['umfpack']
31    else:
32       umf_path_default=None
33       umf_lib_path_default=None
34       umf_libs_default=[]
35    
36    if os.path.isdir('/opt/AMD/Include') and os.path.isdir('/opt/AMD/Lib'):
37       amd_path_default='/opt/AMD/Include'
38       amd_lib_path_default='/opt/AMD/Lib'
39       amd_libs_default=['amd']
40    else:
41       amd_path_default=None
42       amd_lib_path_default=None
43       amd_libs_default=[]
44    
45    if os.path.isdir('/opt/UFconfig'):
46       ufc_path_default='/opt/UFconfig'
47    else:
48       ufc_path_default=None
49    
50  # Default options and options help text  # Default options and options help text
51  # 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.
52  # 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 27  import scons_extensions Line 54  import scons_extensions
54  if ARGUMENTS.get('options_file',0):  if ARGUMENTS.get('options_file',0):
55     options_file = ARGUMENTS.get('options_file',0)     options_file = ARGUMENTS.get('options_file',0)
56  else:  else:
    import socket  
57     from string import ascii_letters,digits     from string import ascii_letters,digits
58     hostname=""     hostname=""
59     for s in socket.gethostname().split('.')[0]:     for s in socket.gethostname().split('.')[0]:
# Line 40  else: Line 66  else:
66  opts = Options(options_file, ARGUMENTS)  opts = Options(options_file, ARGUMENTS)
67  opts.AddOptions(  opts.AddOptions(
68  # Where to install esys stuff  # Where to install esys stuff
69    ('incinstall', 'where the esys headers will be installed', Dir('#.').abspath+'/include'),    ('incinstall', 'where the esys headers will be installed', Dir('#.').abspath+'/include'),
70    ('libinstall', 'where the esys libraries will be installed', Dir('#.').abspath+'/lib'),    ('libinstall', 'where the esys libraries will be installed', Dir('#.').abspath+'/lib'),
71    ('pyinstall', 'where the esys python modules will be installed', Dir('#.').abspath),    ('pyinstall', 'where the esys python modules will be installed', Dir('#.').abspath),
72      ('src_zipfile', 'the source zip file will be installed.', Dir('#.').abspath+"/release/escript_src.zip"),
73      ('test_zipfile', 'the test zip file will be installed.', Dir('#.').abspath+"/release/escript_tests.zip"),
74      ('src_tarfile', 'the source tar file will be installed.', Dir('#.').abspath+"/release/escript_src.tar.gz"),
75      ('test_tarfile', 'the test tar file will be installed.', Dir('#.').abspath+"/release/escript_tests.tar.gz"),
76      ('examples_tarfile', 'the examples tar file will be installed.', Dir('#.').abspath+"/release/doc/escript_examples.tar.gz"),
77      ('examples_zipfile', 'the examples zip file will be installed.', Dir('#.').abspath+"/release/doc/escript_examples.zip"),
78      ('guide_pdf', 'name of the user guide in pdf format', Dir('#.').abspath+"/release/doc/user/guide.pdf"),
79      ('api_epydoc', 'name of the epydoc api docs directory',Dir('#.').abspath+"/release/doc/epydoc"),
80      ('guide_html', 'name of the directory for user guide in html format', Dir('#.').abspath+"/release/doc/user/html"),
81  # Compilation options  # Compilation options
82    BoolOption('dodebug', 'Do you want a debug build?', 'yes'),    BoolOption('dodebug', 'Do you want a debug build?', 'no'),
83    ('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),
84    ('cc_defines','C/C++ defines to use', None),    ('cc_defines','C/C++ defines to use', None),
85    ('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'),
86    ('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'),
87    ('cxx_flags', 'C++ compiler flags to use (Release build)', None),    ('cxx_flags', 'C++ compiler flags to use (Release build)', '--no-warn -ansi'),
88    ('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'),
89    ('ar_flags', 'Static library archiver flags to use', None),    ('ar_flags', 'Static library archiver flags to use', None),
90    ('sys_libs', 'System libraries to link with', None),    ('sys_libs', 'System libraries to link with', [ 'pthread' , 'rt' ] ),
91      ('tar_flags','flags for zip files','-c -z'),
92  # MKL  # MKL
93    PathOption('mkl_path', 'Path to MKL includes', None),    PathOption('mkl_path', 'Path to MKL includes', None),
94    PathOption('mkl_lib_path', 'Path to MKL libs', None),    PathOption('mkl_lib_path', 'Path to MKL libs', None),
95    ('mkl_libs', 'MKL libraries to link with', None),    ('mkl_libs', 'MKL libraries to link with', None),
96    # TRILINOS
97      PathOption('trilinos_path', 'Path to TRILINOS includes', None),
98      PathOption('trilinos_lib_path', 'Path to TRILINOS libs', None),
99      ('trilinos_libs', 'TRILINOS libraries to link with', None),
100  # SCSL  # SCSL
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  # UMFPACK  # UMFPACK
105    PathOption('umf_path', 'Path to UMF includes', None),    PathOption('ufc_path', 'Path to UFconfig includes', ufc_path_default),
106    PathOption('umf_lib_path', 'Path to UMF libs', None),    PathOption('umf_path', 'Path to UMFPACK includes', umf_path_default),
107    ('umf_libs', 'UMF libraries to link with', None),    PathOption('umf_lib_path', 'Path to UMFPACK libs', umf_lib_path_default),
108      ('umf_libs', 'UMFPACK libraries to link with', umf_libs_default),
109    # AMD (used by UMFPACK)
110      PathOption('amd_path', 'Path to AMD includes', amd_path_default),
111      PathOption('amd_lib_path', 'Path to AMD libs', amd_lib_path_default),
112      ('amd_libs', 'AMD libraries to link with', amd_libs_default),
113    # BLAS
114      PathOption('blas_path', 'Path to BLAS includes', None),
115      PathOption('blas_lib_path', 'Path to BLAS libs', None),
116      ('blas_libs', 'BLAS libraries to link with', None),
117    # netCDF
118      PathOption('netCDF_path', 'Path to netCDF includes', '/usr/local/include'),
119      PathOption('netCDF_lib_path', 'Path to netCDF libs', '/usr/local/lib'),
120      ('netCDF_libs_cxx', 'netCDF C++ libraries to link with', [ 'netcdf_c++', 'netcdf'] ),
121  # Python  # Python
122    PathOption('python_path', 'Path to Python includes', '/usr/include'),  # locations of include files for python
123    PathOption('python_lib_path', 'Path to Python libs', '/usr/lib'),    PathOption('python_path', 'Path to Python includes', '/usr/include/python%s.%s'%(sys.version_info[0],sys.version_info[1])),
124    ('python_lib', 'Python libraries to link with', ['python2.3',]),    PathOption('python_lib_path', 'Path to Python libs', '/usr/lib'),
125      ('python_libs', 'Python libraries to link with', ["python%s.%s"%(sys.version_info[0],sys.version_info[1]),]),
126  # Boost  # Boost
127    PathOption('boost_path', 'Path to Boost includes', '/usr/include'),    PathOption('boost_path', 'Path to Boost includes', '/usr/include'),
128    PathOption('boost_lib_path', 'Path to Boost libs', '/usr/lib'),    PathOption('boost_lib_path', 'Path to Boost libs', '/usr/lib'),
129    ('boost_lib', 'Boost libraries to link with', ['boost_python',]),    ('boost_libs', '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',]),  
130  # Doc building  # Doc building
131    PathOption('doxygen_path', 'Path to Doxygen executable', None),  #  PathOption('doxygen_path', 'Path to Doxygen executable', None),
132    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),  
133  # PAPI  # PAPI
134    PathOption('papi_path', 'Path to PAPI includes', None),    PathOption('papi_path', 'Path to PAPI includes', None),
135    PathOption('papi_lib_path', 'Path to PAPI libs', None),    PathOption('papi_lib_path', 'Path to PAPI libs', None),
136    ('papi_libs', 'PAPI libraries to link with', None),    ('papi_libs', 'PAPI libraries to link with', None),
137    # MPI
138      BoolOption('useMPI', 'Compile parallel version using MPI', 'no'),
139      ('MPICH_IGNORE_CXX_SEEK', 'name of macro to ignore MPI settings of C++ SEEK macro (for MPICH)' , 'MPICH_IGNORE_CXX_SEEK'),
140      PathOption('mpi_path', 'Path to MPI includes', '/usr/local/include'),
141      PathOption('mpi_lib_path', 'Path to MPI libs (needs to be added to the LD_LIBRARY_PATH)','/usr/local/lib'),
142      ('mpi_libs', 'MPI libraries to link with (needs to be shared!)', [ 'mpich' , 'pthread', 'rt' ]),
143  )  )
144    
145  # Initialise Scons Build Environment  # Initialise Scons Build Environment
# Line 109  except KeyError: Line 164  except KeyError:
164  # environment which isn't the "scons way"  # environment which isn't the "scons way"
165  # This doesn't impact linux and windows which will use the default compiler (g++ or msvc, or the intel compiler if it is installed on both platforms)  # This doesn't impact linux and windows which will use the default compiler (g++ or msvc, or the intel compiler if it is installed on both platforms)
166  # 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
167    
168  if os.name != "nt" and os.uname()[4]=='ia64':  if os.name != "nt" and os.uname()[4]=='ia64':
169     env = Environment(tools = ['default', 'intelc'], options = opts)     env = Environment(ENV = {'PATH':path}, tools = ['default', 'intelc'], options = opts)
170     env['ENV']['PATH'] = path     env['ENV']['PATH'] = path
171     env['ENV']['LD_LIBRARY_PATH'] = ld_library_path     env['ENV']['LD_LIBRARY_PATH'] = ld_library_path
172     env['ENV']['PYTHONPATH'] = python_path     env['ENV']['PYTHONPATH'] = python_path
173     if env['CXX'] == 'icpc':     if env['CXX'] == 'icpc':
174        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
175  elif os.name == "nt":  elif os.name == "nt":
    # FIXME: Need to implement equivalent of ld library path for windoze  
176     env = Environment(tools = ['default', 'intelc'], options = opts)     env = Environment(tools = ['default', 'intelc'], options = opts)
177     env['ENV']['PYTHONPATH'] = python_path     env['ENV']['PYTHONPATH'] = python_path
178  else:  else:
# Line 148  try: Line 202  try:
202     incinstall = env['incinstall']     incinstall = env['incinstall']
203     env.Append(CPPPATH = [incinstall,])     env.Append(CPPPATH = [incinstall,])
204  except KeyError:  except KeyError:
205     incinstall = None       incinstall = None
206  try:  try:
207     libinstall = env['libinstall']     libinstall = env['libinstall']
208     env.Append(LIBPATH = [libinstall,])     env.Append(LIBPATH = [libinstall,])
209     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)
210       if env['PLATFORM'] == "win32":
211          env.PrependENVPath('PATH', libinstall)
212          env.PrependENVPath('PATH', env['boost_lib_path'])
213  except KeyError:  except KeyError:
214     libinstall = None       libinstall = None
215  try:  try:
216     pyinstall = env['pyinstall']+'/esys' # all targets will install into pyinstall/esys but PYTHONPATH points at straight pyinstall so you go import esys.escript etc     pyinstall = env['pyinstall']+'/esys' # all targets will install into pyinstall/esys but PYTHONPATH points at straight pyinstall so you go import esys.escript etc
217     env.PrependENVPath('PYTHONPATH', env['pyinstall'])     env.PrependENVPath('PYTHONPATH', env['pyinstall'])
218  except KeyError:  except KeyError:
219     pyinstall = None       pyinstall = None
220  try:  try:
221     dodebug = env['dodebug']     dodebug = env['dodebug']
222  except KeyError:  except KeyError:
223     dodebug = None       dodebug = None
224    try:
225       useMPI = env['useMPI']
226    except KeyError:
227       useMPI = None
228  try:  try:
229     cc_defines = env['cc_defines']     cc_defines = env['cc_defines']
230     env.Append(CPPDEFINES = [cc_defines,])     env.Append(CPPDEFINES = cc_defines)
231  except KeyError:  except KeyError:
232     pass     pass
233    
234    # mpi?
235    if useMPI:
236       env.Append(CPPDEFINES=['PASO_MPI',])
237       env.Append(CDEFINES=['PASO_MPI',])
238    
239  if dodebug:  if dodebug:
240     try:      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     try:     try:
# Line 181  else: Line 248  else:
248        env.Append(CCFLAGS = flags)        env.Append(CCFLAGS = flags)
249     except KeyError:     except KeyError:
250        pass        pass
   
251  if dodebug:  if dodebug:
252     try:       try:
253        flags = env['cxx_flags_debug']          flags = env['cxx_flags_debug']
254        env.Append(CXXFLAGS = flags)          env.Append(CXXFLAGS = flags)
255     except KeyError:       except KeyError:
256        pass          pass
257  else:  else:
258     try:       try:
259        flags = env['cxx_flags']          flags = env['cxx_flags']
260        env.Append(CXXFLAGS = flags)          env.Append(CXXFLAGS = flags)
261     except KeyError:       except KeyError:
262        pass          pass
   
263  try:  try:
264     flags = env['ar_flags']     flags = env['ar_flags']
265     env.Append(ARFLAGS = flags)     env.Append(ARFLAGS = flags)
266  except KeyError:  except KeyError:
267     ar_flags = None       ar_flags = None
268  try:  try:
269     sys_libs = env['sys_libs']     sys_libs = env['sys_libs']
270  except KeyError:  except KeyError:
271     sys_libs = ''     sys_libs = []
272    
273  try:  try:
274     includes = env['mkl_path']     tar_flags = env['tar_flags']
275     env.Append(CPPPATH = [includes,])     env.Replace(TARFLAGS = tar_flags)
 except KeyError:  
    pass  
 try:  
    lib_path = env['mkl_lib_path']  
    env.Append(LIBPATH = [lib_path,])  
276  except KeyError:  except KeyError:
277     pass     pass
278    
279    
280    # ============= set mkl (but only of no MPI) =====================================
281    if not useMPI:
282       try:
283          includes = env['mkl_path']
284          env.Append(CPPPATH = [includes,])
285       except KeyError:
286          pass
287    
288       try:
289          lib_path = env['mkl_lib_path']
290          env.Append(LIBPATH = [lib_path,])
291       except KeyError:
292          pass
293    
294       try:
295          mkl_libs = env['mkl_libs']
296       except KeyError:
297          mkl_libs = []
298    else:
299         mkl_libs = []
300    
301    # ============= set scsl (but only of no MPI) =====================================
302    if not useMPI:
303       try:
304          includes = env['scsl_path']
305          env.Append(CPPPATH = [includes,])
306       except KeyError:
307          pass
308    
309       try:
310          lib_path = env['scsl_lib_path']
311          env.Append(LIBPATH = [lib_path,])
312       except KeyError:
313          pass
314      
315       try:
316          scsl_libs = env['scsl_libs']
317       except KeyError:
318          scsl_libs = [ ]
319    
320    else:
321        scsl_libs =  []
322    
323    # ============= set TRILINOS (but only with MPI) =====================================
324    if useMPI:
325       try:
326          includes = env['trilinos_path']
327          env.Append(CPPPATH = [includes,])
328       except KeyError:
329          pass
330    
331       try:
332          lib_path = env['trilinos_lib_path']
333          env.Append(LIBPATH = [lib_path,])
334       except KeyError:
335          pass
336    
337       try:
338          trilinos_libs = env['trilinos_libs']
339       except KeyError:
340          trilinos_libs = []
341    else:
342         trilinos_libs = []
343    
344    
345    # ============= set umfpack (but only without MPI) =====================================
346    umfpack_libs=[ ]
347    if not useMPI:
348       try:
349          includes = env['umf_path']
350          env.Append(CPPPATH = [includes,])
351       except KeyError:
352          pass
353    
354       try:
355          lib_path = env['umf_lib_path']
356          env.Append(LIBPATH = [lib_path,])
357       except KeyError:
358          pass
359    
360       try:
361          umf_libs = env['umf_libs']
362          umfpack_libs+=umf_libs
363       except KeyError:
364          pass
365    
366       try:
367          includes = env['ufc_path']
368          env.Append(CPPPATH = [includes,])
369       except KeyError:
370          pass
371    
372       try:
373          includes = env['amd_path']
374          env.Append(CPPPATH = [includes,])
375       except KeyError:
376          pass
377    
378       try:
379          lib_path = env['amd_lib_path']
380          env.Append(LIBPATH = [lib_path,])
381       except KeyError:
382          pass
383    
384       try:
385          amd_libs = env['amd_libs']
386          umfpack_libs+=amd_libs
387       except KeyError:
388          pass
389    
390    # ============= set blas =====================================
391  try:  try:
392     mkl_libs = env['mkl_libs']     includes = env['blas_path']
 except KeyError:  
    mkl_libs = ''  
 try:  
    includes = env['scsl_path']  
393     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
394  except KeyError:  except KeyError:
395     pass     pass
396    
397  try:  try:
398     lib_path = env['scsl_lib_path']     lib_path = env['blas_lib_path']
399     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
400  except KeyError:  except KeyError:
401     pass     pass
402    
403  try:  try:
404     scsl_libs = env['scsl_libs']     blas_libs = env['blas_libs']
405  except KeyError:  except KeyError:
406     scsl_libs = ''     blas_libs = [ ]
407    
408    # ============= set netcdf =====================================
409  try:  try:
410     includes = env['umf_path']     includes = env['netCDF_path']
411     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
412  except KeyError:  except KeyError:
413     pass     pass
414    
415  try:  try:
416     lib_path = env['umf_lib_path']     lib_path = env['netCDF_lib_path']
417     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
418  except KeyError:  except KeyError:
419     pass     pass
420    
421  try:  try:
422     umf_libs = env['umf_libs']     netCDF_libs_cxx = env['netCDF_libs_cxx']
423  except KeyError:  except KeyError:
424     umf_libs = ''     netCDF_lib_cxx = [ ]
425    
426    # ============= set boost =====================================
427  try:  try:
428     includes = env['boost_path']     includes = env['boost_path']
429     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
# Line 258  try: Line 435  try:
435  except KeyError:  except KeyError:
436     pass     pass
437  try:  try:
438     boost_lib = env['boost_lib']     boost_libs = env['boost_libs']
439  except KeyError:  except KeyError:
440     boost_lib = None       boost_libs = [ ]
441    # ============= set python =====================================
442  try:  try:
443     includes = env['cppunit_path']     includes = env['python_path']
444     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
445  except KeyError:  except KeyError:
446     pass     pass
447  try:  try:
448     lib_path = env['cppunit_lib_path']     lib_path = env['python_lib_path']
449     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
450  except KeyError:  except KeyError:
451     pass     pass
452  try:  try:
453     cppunit_lib = env['cppunit_lib']     python_libs = env['python_libs']
454  except KeyError:  except KeyError:
455     boost_lib = None       python_libs = []
456    
457    # ============= set mpi =====================================
458    if useMPI:
459       try:
460          includes = env['mpi_path']
461          env.Append(CPPPATH = [includes,])
462       except KeyError:
463          pass
464       try:
465          lib_path = env['mpi_lib_path']
466          env.Append(LIBPATH = [lib_path,])
467       except KeyError:
468          pass
469       try:
470          mpi_libs = env['mpi_libs']
471       except KeyError:
472          mpi_libs = []
473       try:
474           mpich_ignore_cxx_seek=env['MPICH_IGNORE_CXX_SEEK']
475           env.Append(CPPDEFINES = [ mpich_ignore_cxx_seek ] )
476       except KeyError:
477          pass
478      
479    else:
480      
481      mpi_libs=[]
482    # ============= set papi =====================================
483  try:  try:
484     includes = env['python_path']     includes = env['papi_path']
485     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
486  except KeyError:  except KeyError:
487     pass     pass
488  try:  try:
489     lib_path = env['python_lib_path']     lib_path = env['papi_lib_path']
490     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
491  except KeyError:  except KeyError:
492     pass     pass
493  try:  try:
494     python_lib = env['python_lib']     papi_libs = env['papi_libs']
495  except KeyError:  except KeyError:
496     python_lib = None       papi_libs = None
497    
498    
499    # ============= and some helpers =====================================
500  try:  try:
501     doxygen_path = env['doxygen_path']     doxygen_path = env['doxygen_path']
502  except KeyError:  except KeyError:
503     doxygen_path = None       doxygen_path = None
504  try:  try:
505     epydoc_path = env['epydoc_path']     epydoc_path = env['epydoc_path']
506  except KeyError:  except KeyError:
507     epydoc_path = None       epydoc_path = None
508  try:  try:
509     epydoc_pythonpath = env['epydoc_pythonpath']     src_zipfile = env.File(env['src_zipfile'])
510  except KeyError:  except KeyError:
511     epydoc_pythonpath = None       src_zipfile = None
512  try:  try:
513     includes = env['papi_path']     test_zipfile = env.File(env['test_zipfile'])
    env.Append(CPPPATH = [includes,])  
514  except KeyError:  except KeyError:
515     pass     test_zipfile = None
516  try:  try:
517     lib_path = env['papi_lib_path']     examples_zipfile = env.File(env['examples_zipfile'])
    env.Append(LIBPATH = [lib_path,])  
518  except KeyError:  except KeyError:
519     pass     examples_zipfile = None
520    
521  try:  try:
522     papi_libs = env['papi_libs']     src_tarfile = env.File(env['src_tarfile'])
523    except KeyError:
524       src_tarfile = None
525    try:
526       test_tarfile = env.File(env['test_tarfile'])
527    except KeyError:
528       test_tarfile = None
529    try:
530       examples_tarfile = env.File(env['examples_tarfile'])
531    except KeyError:
532       examples_tarfile = None
533    
534    try:
535       guide_pdf = env.File(env['guide_pdf'])
536    except KeyError:
537       guide_pdf = None
538    
539    try:
540       guide_html_index = env.File('index.htm',env['guide_html'])
541    except KeyError:
542       guide_html_index = None
543    
544    try:
545       api_epydoc = env.Dir(env['api_epydoc'])
546  except KeyError:  except KeyError:
547     papi_libs = None       api_epydoc = None
548    
549      
550    
551    # Zipgets
552    
 # Targets  
553  env.Default(libinstall)  env.Default(libinstall)
554  env.Default(incinstall)  env.Default(incinstall)
555  env.Default(pyinstall)  env.Default(pyinstall)
556  env.Alias('build_tests')  env.Alias('release_src',[ src_zipfile, src_tarfile ])
557  env.Alias('run_tests')  env.Alias('release_tests',[ test_zipfile, test_tarfile])
558  env.Alias('py_tests')  env.Alias('release_examples',[ examples_zipfile, examples_tarfile])
559  env.Alias('all_tests', ['run_tests', 'py_tests'])  env.Alias('api_epydoc',api_epydoc)
560    env.Alias('guide_pdf', guide_pdf)
561    env.Alias('docs',[ 'release_examples', 'guide_pdf', guide_html_index, api_epydoc])
562    env.Alias('release', ['release_src', 'release_tests', 'docs'])
563    env.Alias('build_tests')    # target to build all C++ tests
564    env.Alias('build_py_tests') # target to build all python tests
565    env.Alias('build_all_tests', [ 'build_tests', 'build_py_tests' ] ) # target to build all python tests
566    env.Alias('run_tests', 'build_tests')   # target to run all C++ test
567    env.Alias('py_tests', 'build_py_tests') # taget to run all released python tests
568    env.Alias('all_tests', ['run_tests', 'py_tests']) # target to run all C++ and released python tests
569    
570  # Python install - esys __init__.py  # Python install - esys __init__.py
571  # 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'))
572  # create the file if it doesn't exist  env.Alias(init_target)
 env.Command('esys/__init__.py', None, 'touch $TARGET')  
573    
574  # Allow sconscripts to see the env  # Allow sconscripts to see the env
575  Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs",  Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umfpack_libs",
576      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "epydoc_pythonpath", "papi_libs", "cppunit_lib", "sys_libs" ])          "blas_libs", "netCDF_libs_cxx", "trilinos_libs", "mpi_libs",
577        "boost_libs", "python_libs", "doxygen_path", "epydoc_path", "papi_libs",
578            "sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "examples_tarfile", "examples_zipfile",
579            "guide_pdf", "guide_html_index", "api_epydoc", "useMPI"])
580    
581  # End initialisation section  # End initialisation section
582  # Begin configuration section  # Begin configuration section
583    # adds this file and the scons option directore to the source tar
584    release_srcfiles=[env.File('SConstruct'),]+[ env.File(x) for x in glob.glob('scons/*.py') ]
585    release_testfiles=[env.File('README_TESTS'),]
586    env.Zip(src_zipfile, release_srcfiles)
587    env.Zip(test_zipfile, release_testfiles)
588    env.Tar(src_tarfile, release_srcfiles)
589    env.Tar(test_tarfile, release_testfiles)
590    
591  # Insert new components to be build here  # Insert new components to be build here
592  # 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
593  # 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 343  Export(["env", "incinstall", "libinstall Line 595  Export(["env", "incinstall", "libinstall
595  env.SConscript(dirs = ['tools/CppUnitTest/src'], build_dir='build/$PLATFORM/tools/CppUnitTest', duplicate=0)  env.SConscript(dirs = ['tools/CppUnitTest/src'], build_dir='build/$PLATFORM/tools/CppUnitTest', duplicate=0)
596  # C/C++ Libraries  # C/C++ Libraries
597  env.SConscript(dirs = ['paso/src'], build_dir='build/$PLATFORM/paso', duplicate=0)  env.SConscript(dirs = ['paso/src'], build_dir='build/$PLATFORM/paso', duplicate=0)
598  env.SConscript(dirs = ['bruce/src'], build_dir='build/$PLATFORM/bruce', duplicate=0)  # bruce is removed for now as it doesn't really do anything
599    # env.SConscript(dirs = ['bruce/src'], build_dir='build/$PLATFORM/bruce', duplicate=0)
600  env.SConscript(dirs = ['escript/src'], build_dir='build/$PLATFORM/escript', duplicate=0)  env.SConscript(dirs = ['escript/src'], build_dir='build/$PLATFORM/escript', duplicate=0)
601  env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)  env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)
602  env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)  env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)
603  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)
604    env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0)
605  # FIXME:need to be incorporated into build system  env.SConscript(dirs = ['pyvisi/py_src'], build_dir='build/$PLATFORM/pyvisi', duplicate=0)
606  # FIXME: 'pyvisi/SConstruct']  env.SConscript(dirs = ['pycad/py_src'], build_dir='build/$PLATFORM/pycad', duplicate=0)
607  # FIXME: 'doc/SConstruct']  
608  # FIXME: 'doc/SConstruct']  # added by Ben Cumming
609    env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)
610    #env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0)

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

  ViewVC Help
Powered by ViewVC 1.1.26