/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 751 by bcumming, Mon Jun 26 01:46:34 2006 UTC revision 1663 by artak, Tue Jul 22 02:56:21 2008 UTC
# Line 1  Line 1 
1  #          Copyright 2006 by ACcESS MNRF                    #         Copyright 2006 by ACcESS MNRF
 #                                                            
 #              http://www.access.edu.au                      
 #       Primary Business: Queensland, Australia              
 #  Licensed under the Open Software License version 3.0      
 #     http://www.opensource.org/licenses/osl-3.0.php        
 #                                                            
 #  
2  #  #
3    #              http://www.access.edu.au
4    #       Primary Business: Queensland, Australia
5    #  Licensed under the Open Software License version 3.0
6    #     http://www.opensource.org/licenses/osl-3.0.php
7    
8  # top-level Scons configuration file for all esys13 modules  # top-level Scons configuration file for all esys13 modules
9  # Begin initialisation Section  # Begin initialisation Section
10  # all of this section just intialises default environments and helper  # all of this section just intialises default environments and helper
11  # scripts. You shouldn't need to modify this section.  # scripts. You shouldn't need to modify this section.
12  EnsureSConsVersion(0,96,91)  EnsureSConsVersion(0,96,91)
13  EnsurePythonVersion(2,3)  EnsurePythonVersion(2,3)
14    
15  # import tools:  #===============================================================
16    #   import tools:
17  import glob  import glob
18  import sys, os  import sys, os, re
19  # Add our extensions  # Add our extensions
20  if sys.path.count('scons')==0: sys.path.append('scons')  if sys.path.count('scons')==0: sys.path.append('scons')
21  import scons_extensions  import scons_extensions
22    
23    # We may also need to know where python's site-packages subdirectory lives
24    python_version = 'python%s.%s'%(sys.version_info[0],sys.version_info[1])
25    
26    #===============================================================
27    
28    tools_prefix="/usr"
29    
30    #==============================================================================================    
31    #    
32    #    get the installation prefix
33    #
34    prefix = ARGUMENTS.get('prefix', sys.prefix )
35    
36    # We may also need to know where python's site-packages subdirectory lives
37    python_version = 'python%s.%s'%(sys.version_info[0],sys.version_info[1])
38    # Install as a standard python package in /usr/lib64 if available, else in /usr/lib
39    if os.path.isdir(  prefix+"/lib64/"+python_version+"/site-packages"):
40       sys_dir_packages =  prefix+"/lib64/"+python_version+"/site-packages/esys"
41       sys_dir_libraries = prefix+"/lib64"
42    else:
43       sys_dir_packages =  prefix+"/lib/"+python_version+"/site-packages/esys"
44       sys_dir_libraries = prefix+"/lib"
45    
46    sys_dir_examples = prefix+"/share/doc/esys"
47    
48    source_root = Dir('#.').abspath
49    
50    dir_packages = os.path.join(source_root,"esys")
51    dir_examples = os.path.join(source_root,"examples")
52    dir_libraries = os.path.join(source_root,"lib")
53    
54    print "Source root is : ",source_root
55    print " Default packages local installation:    ", dir_packages
56    print " Default library local installation  ", dir_libraries
57    print " Default example local  installation:    ", dir_examples
58    print "Install prefix is: ", prefix
59    print " Default packages system installation:   ", sys_dir_packages
60    print " Default library system installation     ", sys_dir_libraries
61    print " Default example system installation:    ", sys_dir_examples
62    
63    #==============================================================================================    
64    
65  # Default options and options help text  # Default options and options help text
66  # 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.
67  # 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
68  # DO NOT CHANGE THEM HERE  # DO NOT CHANGE THEM HERE
69  if ARGUMENTS.get('options_file',0):  # Where to install?
70     options_file = ARGUMENTS.get('options_file',0)  #==============================================================================================    
71  else:  #    
72    #    get the options file if present:
73    #
74    options_file = ARGUMENTS.get('options_file','')
75    
76    if not os.path.isfile(options_file) :
77        options_file = False
78    
79    if not options_file :
80     import socket     import socket
81     from string import ascii_letters,digits     hostname = re.sub("[^0-9a-zA-Z]", "_", socket.gethostname().split('.')[0])
82     hostname=""     tmp = os.path.join("scons",hostname+"_options.py")
83     for s in socket.gethostname().split('.')[0]:  
84        if s in ascii_letters+digits:     if os.path.isfile(tmp) :
85           hostname+=s        options_file = tmp
86        else:  
87           hostname+="_"  IS_WINDOWS_PLATFORM = (os.name== "nt")
88     options_file = "scons/"+hostname+"_options.py"  
89    # If you're not going to tell me then......
90    # FIXME: add one for the altix too.
91    if not options_file :
92       if IS_WINDOWS_PLATFORM :
93          options_file = "scons/windows_mscv71_options.py"
94       else:
95          options_file = "scons/linux_gcc_eg_options.py"
96    
97    # and load it
98  opts = Options(options_file, ARGUMENTS)  opts = Options(options_file, ARGUMENTS)
99    #================================================================
100    #
101    #   check if UMFPACK is installed on the system:
102    #
103    uf_root=None
104    for i in [ 'UMFPACK', 'umfpack', 'ufsparse', 'UFSPARSE']:
105       if os.path.isdir(os.path.join(tools_prefix,'include',i)):
106           uf_root=i
107           print i," is used form ",tools_prefix
108           break
109    if not uf_root==None:
110       umf_path_default=os.path.join(tools_prefix,'include',uf_root)
111       umf_lib_path_default=os.path.join(tools_prefix,'lib')
112       umf_libs_default=['umfpack']
113       amd_path_default=os.path.join(tools_prefix,'include',uf_root)
114       amd_lib_path_default=os.path.join(tools_prefix,'lib')
115       amd_libs_default=['amd']
116       ufc_path_default=os.path.join(tools_prefix,'include',uf_root)
117    else:
118       umf_path_default=None
119       umf_lib_path_default=None
120       umf_libs_default=None
121       amd_path_default=None
122       amd_lib_path_default=None
123       amd_libs_default=None
124       ufc_path_default=None
125    #
126    #==========================================================================
127    #
128    #    python installation:
129    #
130    python_path_default=os.path.join(tools_prefix,'include','python%s.%s'%(sys.version_info[0],sys.version_info[1]))
131    python_lib_path_default=os.path.join(tools_prefix,'lib')
132    python_lib_default="python%s.%s"%(sys.version_info[0],sys.version_info[1])
133    
134    #==========================================================================
135    #
136    #    boost installation:
137    #
138    boost_path_default=os.path.join(tools_prefix,'include')
139    boost_lib_path_default=os.path.join(tools_prefix,'lib')
140    boost_lib_default=['boost_python']
141    
142    #==========================================================================
143    #
144    #    check if netCDF is installed on the system:
145    #
146    netCDF_path_default=os.path.join(tools_prefix,'include','netcdf-3')
147    netCDF_lib_path_default=os.path.join(tools_prefix,'lib')
148    
149    if os.path.isdir(netCDF_path_default) and os.path.isdir(netCDF_lib_path_default):
150         useNetCDF_default='yes'
151         netCDF_libs_default=[ 'netcdf_c++', 'netcdf' ]
152    else:
153         useNetCDF_default='no'
154         netCDF_path_default=None
155         netCDF_lib_path_default=None
156         netCDF_libs_default=None
157    
158    #==========================================================================
159    #
160    #  MPI:
161    #
162    if IS_WINDOWS_PLATFORM:
163       useMPI_default='no'
164       mpi_path_default=None
165       mpi_lib_path_default=None
166       mpi_libs_default=[]
167       mpi_run_default=None
168    else:
169       useMPI_default='no'
170       mpi_root='/usr/local'
171       mpi_path_default=os.path.join(mpi_root,'include')
172       mpi_lib_path_default=os.path.join(mpi_root,'lib')
173       mpi_libs_default=[ 'mpich' , 'pthread', 'rt' ]
174       mpi_run_default='mpiexec -np 1'
175    #
176    #==========================================================================
177    #
178    #    compile:
179    #
180    cc_flags_default='-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas -ansi'
181    cc_flags_debug_default='-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas -ansi'
182    cxx_flags_default='--no-warn -ansi'
183    cxx_flags_debug_default='--no-warn -ansi -DDOASSERT'
184    
185    #==============================================================================================    
186    # Default options and options help text
187    # These are defaults and can be overridden using command line arguments or an options file.
188    # if the options_file or ARGUMENTS do not exist then the ones listed as default here are used
189    # DO NOT CHANGE THEM HERE
190  opts.AddOptions(  opts.AddOptions(
191  # Where to install esys stuff  # Where to install esys stuff
192    ('incinstall', 'where the esys headers will be installed', Dir('#.').abspath+'/include'),    ('incinstall', 'where the esys headers will be installed',             Dir('#.').abspath+'/include'),
193    ('libinstall', 'where the esys libraries will be installed', Dir('#.').abspath+'/lib'),    ('libinstall', 'where the esys libraries will be installed',           dir_libraries),
194    ('pyinstall', 'where the esys python modules will be installed', Dir('#.').abspath),    ('pyinstall', 'where the esys python modules will be installed',       dir_packages),
195    ('src_zipfile', 'the source zip file will be installed.', Dir('#.').abspath+"/release/escript_src.zip"),    ('exinstall', 'where the esys examples will be installed',             dir_examples),
196    ('test_zipfile', 'the test zip file will be installed.', Dir('#.').abspath+"/release/escript_tests.zip"),    ('sys_libinstall', 'where the system esys libraries will be installed',       sys_dir_libraries),
197    ('src_tarfile', 'the source tar file will be installed.', Dir('#.').abspath+"/release/escript_src.tar.gz"),    ('sys_pyinstall', 'where the system esys python modules will be installed',   sys_dir_packages),
198    ('test_tarfile', 'the test tar file will be installed.', Dir('#.').abspath+"/release/escript_tests.tar.gz"),    ('sys_exinstall', 'where the system esys examples will be installed',         sys_dir_examples),
199    ('examples_tarfile', 'the examples tar file will be installed.', Dir('#.').abspath+"/release/doc/escript_examples.tar.gz"),    ('src_zipfile', 'the source zip file will be installed.',              Dir('#.').abspath+"/release/escript_src.zip"),
200    ('examples_zipfile', 'the examples zip file will be installed.', Dir('#.').abspath+"/release/doc/escript_examples.zip"),    ('test_zipfile', 'the test zip file will be installed.',               Dir('#.').abspath+"/release/escript_tests.zip"),
201    ('guide_pdf', 'name of the user guide in pdf format', Dir('#.').abspath+"/release/doc/user/guide.pdf"),    ('src_tarfile', 'the source tar file will be installed.',              Dir('#.').abspath+"/release/escript_src.tar.gz"),
202    ('api_epydoc', 'name of the epydoc api docs directory',Dir('#.').abspath+"/release/doc/epydoc"),    ('test_tarfile', 'the test tar file will be installed.',               Dir('#.').abspath+"/release/escript_tests.tar.gz"),
203    ('guide_html', 'name of the directory for user guide in html format', Dir('#.').abspath+"/release/doc/user/html"),    ('examples_tarfile', 'the examples tar file will be installed.',       Dir('#.').abspath+"/release/doc/escript_examples.tar.gz"),
204      ('examples_zipfile', 'the examples zip file will be installed.',       Dir('#.').abspath+"/release/doc/escript_examples.zip"),
205      ('guide_pdf', 'name of the user guide in pdf format',                  Dir('#.').abspath+"/release/doc/user/guide.pdf"),
206      ('api_epydoc', 'name of the epydoc api docs directory',                Dir('#.').abspath+"/release/doc/epydoc"),
207      ('guide_html', 'name of the directory for user guide in html format',  Dir('#.').abspath+"/release/doc/user/html"),
208      ('api_doxygen', 'name of the doxygen api docs directory',prefix+"/release/doc/doxygen"),
209  # Compilation options  # Compilation options
210    BoolOption('dodebug', 'Do you want a debug build?', 'no'),    BoolOption('dodebug', 'Do you want a debug build?', 'no'),
211    ('options_file', "Optional file containing preferred options. Ignored if it doesn't exist (default: scons/hostname_options.py)", options_file),    BoolOption('bounds_check', 'Do you want extra array bounds checking?', 'no'),
212      ('options_file', "Optional file containing preferred options. Ignored if it doesn't exist (default: scons/<hostname>_options.py)", options_file),
213    ('cc_defines','C/C++ defines to use', None),    ('cc_defines','C/C++ defines to use', None),
214    ('cc_flags','C compiler flags to use (Release build)', '-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas'),    ('cc_flags','C compiler flags to use (Release build)', cc_flags_default),
215    ('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)', cc_flags_debug_default),
216    ('cxx_flags', 'C++ compiler flags to use (Release build)', '--no-warn -ansi'),    ('cxx_flags', 'C++ compiler flags to use (Release build)', cxx_flags_default),
217    ('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)', cxx_flags_debug_default),
218      ('link_flags', 'Linker flags to use (Release build)', None),
219      ('link_flags_debug', 'Linker flags to use (Debug build)', None),
220    
221      ('omp_flags', 'OpenMP compiler flags to use (Release build)', ''),
222      ('omp_flags_debug', 'OpenMP compiler flags to use (Debug build)', ''),
223    ('ar_flags', 'Static library archiver flags to use', None),    ('ar_flags', 'Static library archiver flags to use', None),
224    ('sys_libs', 'System libraries to link with', None),    ('sys_libs', 'System libraries to link with', None),
225    ('tar_flags','flags for zip files','-c -z'),    ('tar_flags','flags for zip files','-c -z'),
226  # MKL  # MKL
227    PathOption('mkl_path', 'Path to MKL includes', None),    PathOption('mkl_path', 'Path to MKL includes', None),
228    PathOption('mkl_lib_path', 'Path to MKL libs', None),    PathOption('mkl_lib_path', 'Path to MKL libs', None),
229    ('mkl_libs', 'MKL libraries to link with', None),    ('mkl_libs', 'MKL libraries to link with', None),
230  # SCSL  # SCSL
231    PathOption('scsl_path', 'Path to SCSL includes', None),    PathOption('scsl_path', 'Path to SCSL includes', None),
232    PathOption('scsl_lib_path', 'Path to SCSL libs', None),    PathOption('scsl_lib_path', 'Path to SCSL libs', None),
233    ('scsl_libs', 'SCSL libraries to link with', None),    ('scsl_libs', 'SCSL libraries to link with', None),
234  # UMFPACK    ('scsl_libs_MPI', 'SCSL libraries to link with for MPI build', None),
235    PathOption('umf_path', 'Path to UMF includes', None),  # UMFPACK
236    PathOption('umf_lib_path', 'Path to UMF libs', None),    PathOption('ufc_path', 'Path to UFconfig includes', ufc_path_default),
237    ('umf_libs', 'UMF libraries to link with', None),    PathOption('umf_path', 'Path to UMFPACK includes', umf_path_default),
238      PathOption('umf_lib_path', 'Path to UMFPACK libs', umf_lib_path_default),
239      ('umf_libs', 'UMFPACK libraries to link with', umf_libs_default),
240    # AMD (used by UMFPACK)
241      PathOption('amd_path', 'Path to AMD includes', amd_path_default),
242      PathOption('amd_lib_path', 'Path to AMD libs', amd_lib_path_default),
243      ('amd_libs', 'AMD libraries to link with', amd_libs_default),
244    # ParMETIS
245      ('parmetis_path', 'Path to ParMETIS includes', ''),
246      ('parmetis_lib_path', 'Path to ParMETIS library', ''),
247      ('parmetis_lib', 'ParMETIS library to link with', []),
248    # TRILINOS
249      PathOption('trilinos_path', 'Path to TRILINOS includes', None),
250      PathOption('trilinos_lib_path', 'Path to TRILINOS libs', None),
251      ('trilinos_libs', 'TRILINOS libraries to link with', None),
252    # BLAS
253      PathOption('blas_path', 'Path to BLAS includes', None),
254      PathOption('blas_lib_path', 'Path to BLAS libs', None),
255      ('blas_libs', 'BLAS libraries to link with', None),
256    # netCDF
257      ('useNetCDF', 'switch on/off the usage of netCDF', useNetCDF_default),
258      PathOption('netCDF_path', 'Path to netCDF includes', netCDF_path_default),
259      PathOption('netCDF_lib_path', 'Path to netCDF libs', netCDF_lib_path_default),
260      ('netCDF_libs', 'netCDF C++ libraries to link with', netCDF_libs_default),
261  # Python  # Python
262  # locations of include files for python  # locations of include files for python
263    PathOption('python_path', 'Path to Python includes', '/usr/include/python%s.%s'%(sys.version_info[0],sys.version_info[1])),  # FIXME: python_path should be python_inc_path and the same for boost etc.
264    PathOption('python_lib_path', 'Path to Python libs', '/usr/lib'),    PathOption('python_path', 'Path to Python includes', python_path_default),
265    ('python_lib', 'Python libraries to link with', ["python%s.%s"%(sys.version_info[0],sys.version_info[1]),]),    PathOption('python_lib_path', 'Path to Python libs', python_lib_path_default),
266      ('python_lib', 'Python libraries to link with', python_lib_default),
267      ('python_cmd', 'Python command', 'python'),
268  # Boost  # Boost
269    PathOption('boost_path', 'Path to Boost includes', '/usr/include'),    PathOption('boost_path', 'Path to Boost includes', boost_path_default),
270    PathOption('boost_lib_path', 'Path to Boost libs', '/usr/lib'),    PathOption('boost_lib_path', 'Path to Boost libs', boost_lib_path_default),
271    ('boost_lib', 'Boost libraries to link with', ['boost_python',]),    ('boost_lib', 'Boost libraries to link with', boost_lib_default),
272  # Doc building  # Doc building
273  #  PathOption('doxygen_path', 'Path to Doxygen executable', None),  #  PathOption('doxygen_path', 'Path to Doxygen executable', None),
274  #  PathOption('epydoc_path', 'Path to Epydoc executable', None),  #  PathOption('epydoc_path', 'Path to Epydoc executable', None),
275  # PAPI  # PAPI
276    PathOption('papi_path', 'Path to PAPI includes', None),    PathOption('papi_path', 'Path to PAPI includes', None),
277    PathOption('papi_lib_path', 'Path to PAPI libs', None),    PathOption('papi_lib_path', 'Path to PAPI libs', None),
278    ('papi_libs', 'PAPI libraries to link with', None),    ('papi_libs', 'PAPI libraries to link with', None),
279      ('papi_instrument_solver', 'use PAPI in Solver.c to instrument each iteration of the solver', None),
280    # MPI
281      BoolOption('useMPI', 'Compile parallel version using MPI', useMPI_default),
282      ('MPICH_IGNORE_CXX_SEEK', 'name of macro to ignore MPI settings of C++ SEEK macro (for MPICH)' , 'MPICH_IGNORE_CXX_SEEK'),
283      PathOption('mpi_path', 'Path to MPI includes', mpi_path_default),
284      ('mpi_run', 'mpirun name' , mpi_run_default),
285      PathOption('mpi_lib_path', 'Path to MPI libs (needs to be added to the LD_LIBRARY_PATH)',mpi_lib_path_default),
286      ('mpi_libs', 'MPI libraries to link with (needs to be shared!)', mpi_libs_default)
287  )  )
288    #=================================================================================================
289    #
290    #   Note: On the Altix the intel compilers are not automatically
291    #   detected by scons intelc.py script. The Altix has a different directory
292    #   path and in some locations the "modules" facility is used to support
293    #   multiple compiler versions. This forces the need to import the users PATH
294    #   environment which isn't the "scons way"
295    #   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)
296    #   FIXME: Perhaps a modification to intelc.py will allow better support for ia64 on altix
297    #
298    
299    if IS_WINDOWS_PLATFORM:
300          env = Environment(tools = ['default', 'msvc'], options = opts)
301          #env = Environment(tools = ['default', 'intelc'], options = opts)
302    else:
303       if socket.gethostname().split('.')[0] == 'service0':
304          env = Environment(tools = ['default', 'intelc'], options = opts)
305       elif os.uname()[4]=='ia64':
306          env = Environment(tools = ['default', 'intelc'], options = opts)
307          if env['CXX'] == 'icpc':
308             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
309       else:
310          env = Environment(tools = ['default'], options = opts)
311    Help(opts.GenerateHelpText(env))
312    
313    if env['bounds_check']:
314       env.Append(CPPDEFINES = [ 'BOUNDS_CHECK' ])
315       env.Append(CXXDEFINES = [ 'BOUNDS_CHECK' ])
316       bounds_check = env['bounds_check']
317    else:
318       bounds_check = 0
319    
320    #=================================================================================================
321    #
322    #     Initialise Scons Build Environment
323    #     check for user environment variables we are interested in
324    try:
325       tmp = os.environ['PYTHONPATH']
326       env['ENV']['PYTHONPATH'] = tmp
327    except KeyError:
328       pass
329    
330    env.PrependENVPath('PYTHONPATH', source_root)
331    
 # Initialise Scons Build Environment  
 # check for user environment variables we are interested in  
332  try:  try:
333     python_path = os.environ['PYTHONPATH']     omp_num_threads = os.environ['OMP_NUM_THREADS']
334  except KeyError:  except KeyError:
335     python_path = ''     omp_num_threads = 1
336    env['ENV']['OMP_NUM_THREADS'] = omp_num_threads
337    
338  try:  try:
339     path = os.environ['PATH']     path = os.environ['PATH']
340       env['ENV']['PATH'] = path
341  except KeyError:  except KeyError:
342     path = ''     omp_num_threads = 1
343    
344    env['ENV']['OMP_NUM_THREADS'] = omp_num_threads
345    
346    
347    # Copy some variables from the system environment to the build environment
348  try:  try:
349     ld_library_path = os.environ['LD_LIBRARY_PATH']     env['ENV']['DISPLAY'] = os.environ['DISPLAY']
350       env['ENV']['XAUTHORITY'] = os.environ['XAUTHORITY']
351       home_temp = os.environ['HOME']   # MPICH2's mpd needs $HOME to find $HOME/.mpd.conf
352       env['ENV']['HOME'] = home_temp
353  except KeyError:  except KeyError:
354     ld_library_path = ''     pass
   
 # Note: On the Altix the intel compilers are not automatically  
 # detected by scons intelc.py script. The Altix has a different directory  
 # path and in some locations the "modules" facility is used to support  
 # multiple compiler versions. This forces the need to import the users PATH  
 # environment which isn't the "scons way"  
 # 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)  
 # FIXME: Perhaps a modification to intelc.py will allow better support for ia64 on altix  
   
 if os.name != "nt" and os.uname()[4]=='ia64':  
    env = Environment(ENV = {'PATH':path}, tools = ['default', 'intelc'], options = opts)  
    env['ENV']['PATH'] = path  
    env['ENV']['LD_LIBRARY_PATH'] = ld_library_path  
    env['ENV']['PYTHONPATH'] = python_path  
    if env['CXX'] == 'icpc':  
       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  
 elif os.name == "nt":  
    # FIXME: Need to implement equivalent of ld library path for windoze  
    env = Environment(tools = ['default', 'intelc'], options = opts)  
    env['ENV']['PYTHONPATH'] = python_path  
 else:  
    env = Environment(tools = ['default'], options = opts)  
    env['ENV']['PATH'] = path  
    env['ENV']['LD_LIBRARY_PATH'] = ld_library_path  
    env['ENV']['PYTHONPATH'] = python_path  
355    
356  # Setup help for options  try:
357  Help(opts.GenerateHelpText(env))     tmp = os.environ['PATH']
358       env['ENV']['PATH'] = tmp
359    except KeyError:
360       pass
361    
362  # Add some customer builders  try:
363       tmp = os.environ['LD_LIBRARY_PATH']
364       env['ENV']['LD_LIBRARY_PATH'] = tmp
365    except KeyError:
366       pass
367    #==========================================================================
368    #
369    #    Add some customer builders
370    #
371  py_builder = Builder(action = scons_extensions.build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)  py_builder = Builder(action = scons_extensions.build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)
372  env.Append(BUILDERS = {'PyCompile' : py_builder});  env.Append(BUILDERS = {'PyCompile' : py_builder});
373    
374  if env['PLATFORM'] == "win32":  runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed',
375     runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', src_suffix='.exe', single_source=True)                                src_suffix=env['PROGSUFFIX'], single_source=True)
376  else:  
    runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', single_source=True)  
377  env.Append(BUILDERS = {'RunUnitTest' : runUnitTest_builder});  env.Append(BUILDERS = {'RunUnitTest' : runUnitTest_builder});
378    
379  runPyUnitTest_builder = Builder(action = scons_extensions.runPyUnitTest, suffix = '.passed', src_suffic='.py', single_source=True)  runPyUnitTest_builder = Builder(action = scons_extensions.runPyUnitTest, suffix = '.passed', src_suffic='.py', single_source=True)
# Line 156  try: Line 384  try:
384     incinstall = env['incinstall']     incinstall = env['incinstall']
385     env.Append(CPPPATH = [incinstall,])     env.Append(CPPPATH = [incinstall,])
386  except KeyError:  except KeyError:
387     incinstall = None       incinstall = None
388  try:  try:
389     libinstall = env['libinstall']     libinstall = env['libinstall']
390     env.Append(LIBPATH = [libinstall,])     env.Append(LIBPATH = [libinstall,]) # Adds -L for building of libescript.so libfinley.so escriptcpp.so finleycpp.so
391     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)     env.PrependENVPath('LD_LIBRARY_PATH', libinstall)
392       if IS_WINDOWS_PLATFORM :
393          env.PrependENVPath('PATH', libinstall)
394          env.PrependENVPath('PATH', env['boost_lib_path'])
395  except KeyError:  except KeyError:
396     libinstall = None       libinstall = None
397  try:  try:
398     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'] # all targets will install into pyinstall/esys but PYTHONPATH points at straight pyinstall so you go import esys.escript etc
    env.PrependENVPath('PYTHONPATH', env['pyinstall'])  
 except KeyError:  
    pyinstall = None    
 try:  
    dodebug = env['dodebug']  
399  except KeyError:  except KeyError:
400     dodebug = None       pyinstall = None
401    
402  try:  try:
403     cc_defines = env['cc_defines']     cc_defines = env['cc_defines']
404     env.Append(CPPDEFINES = [cc_defines,])     env.Append(CPPDEFINES = cc_defines)
405  except KeyError:  except KeyError:
406     pass     pass
 if dodebug:  
    try:  
       flags = env['cc_flags_debug']  
       env.Append(CCFLAGS = flags)  
    except KeyError:  
       pass  
 else:  
    try:  
       flags = env['cc_flags']  
       env.Append(CCFLAGS = flags)  
    except KeyError:  
       pass  
   
 if dodebug:  
    try:  
       flags = env['cxx_flags_debug']  
       env.Append(CXXFLAGS = flags)  
    except KeyError:  
       pass  
 else:  
    try:  
       flags = env['cxx_flags']  
       env.Append(CXXFLAGS = flags)  
    except KeyError:  
       pass  
   
407  try:  try:
408     flags = env['ar_flags']     flags = env['ar_flags']
409     env.Append(ARFLAGS = flags)     env.Append(ARFLAGS = flags)
410  except KeyError:  except KeyError:
411     ar_flags = None       ar_flags = None
412  try:  try:
413     sys_libs = env['sys_libs']     sys_libs = env['sys_libs']
414  except KeyError:  except KeyError:
415     sys_libs = ''     sys_libs = []
416    
417  try:  try:
418     tar_flags = env['tar_flags']     tar_flags = env['tar_flags']
# Line 220  except KeyError: Line 421  except KeyError:
421     pass     pass
422    
423  try:  try:
424     includes = env['mkl_path']     exinstall = env['exinstall']
    env.Append(CPPPATH = [includes,])  
425  except KeyError:  except KeyError:
426     pass     exinstall = None
   
427  try:  try:
428     lib_path = env['mkl_lib_path']     sys_libinstall = env['sys_libinstall']
    env.Append(LIBPATH = [lib_path,])  
429  except KeyError:  except KeyError:
430     pass     sys_libinstall = None
431    try:
432       sys_pyinstall = env['sys_pyinstall']
433    except KeyError:
434       sys_pyinstall = None
435    try:
436       sys_exinstall = env['sys_exinstall']
437    except KeyError:
438       sys_exinstall = None
439    
440    # ====================== debugging ===================================
441  try:  try:
442     mkl_libs = env['mkl_libs']     dodebug = env['dodebug']
443  except KeyError:  except KeyError:
444     mkl_libs = ''     dodebug = None
445    
446    # === switch on omp ===================================================
447  try:  try:
448     includes = env['scsl_path']    omp_flags = env['omp_flags']
    env.Append(CPPPATH = [includes,])  
449  except KeyError:  except KeyError:
450     pass    omp_flags = ''
451    
452  try:  try:
453     lib_path = env['scsl_lib_path']    omp_flags_debug = env['omp_flags_debug']
    env.Append(LIBPATH = [lib_path,])  
454  except KeyError:  except KeyError:
455     pass    omp_flags_debug = ''
456    
457    # ========= use mpi? =====================================================
458  try:  try:
459     scsl_libs = env['scsl_libs']     useMPI = env['useMPI']
460  except KeyError:  except KeyError:
461     scsl_libs = ''     useMPI = None
462    # ========= set compiler flags ===========================================
463    
464    if dodebug:
465        try:
466          flags = env['cc_flags_debug'] + ' ' + omp_flags_debug
467          env.Append(CCFLAGS = flags)
468        except KeyError:
469          pass
470    else:
471       try:
472          flags = env['cc_flags'] + ' ' + omp_flags
473          env.Append(CCFLAGS = flags)
474       except KeyError:
475          pass
476    if dodebug:
477         try:
478            flags = env['cxx_flags_debug']
479            env.Append(CXXFLAGS = flags)
480         except KeyError:
481            pass
482    else:
483         try:
484            flags = env['cxx_flags']
485            env.Append(CXXFLAGS = flags)
486         except KeyError:
487            pass
488    
489    # Impassioned plea - please do this sort of thing in the options files.
490    try:
491         #if env['CC'] == 'gcc': env.Append(CCFLAGS = "-pedantic-errors -Wno-long-long")
492         pass
493    except:
494         pass
495    
496    if dodebug:
497         try:
498            flags = env['link_flags_debug']
499            env.Append(LINKFLAGS = flags)
500         except KeyError:
501            pass
502    else:
503         try:
504            flags = env['link_flags']
505            env.Append(LINKFLAGS = flags)
506         except KeyError:
507            pass
508    
509    # ============= Remember what options were used in the compile =====================================
510    if not IS_WINDOWS_PLATFORM:
511      env.Execute("/bin/rm -f " + libinstall + "/Compiled.with.*")
512      if dodebug:       env.Execute("touch " + libinstall + "/Compiled.with.debug")
513      if useMPI:        env.Execute("touch " + libinstall + "/Compiled.with.mpi")
514      if omp_flags != '':   env.Execute("touch " + libinstall + "/Compiled.with.OpenMP")
515      if bounds_check:  env.Execute("touch " + libinstall + "/Compiled.with.bounds_check")
516    
517    # ============= set mkl (but only of no MPI) =====================================
518    if not useMPI:
519       try:
520          includes = env['mkl_path']
521          env.Append(CPPPATH = [includes,])
522       except KeyError:
523          pass
524    
525       try:
526          lib_path = env['mkl_lib_path']
527          env.Append(LIBPATH = [lib_path,])
528          env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
529       except KeyError:
530          pass
531    
532       try:
533          mkl_libs = env['mkl_libs']
534       except KeyError:
535          mkl_libs = []
536    else:
537         mkl_libs = []
538    
539    # ============= set scsl (but only of no MPI) =====================================
540    if not useMPI:
541       try:
542          includes = env['scsl_path']
543          env.Append(CPPPATH = [includes,])
544       except KeyError:
545          pass
546    
547       try:
548          lib_path = env['scsl_lib_path']
549          env.Append(LIBPATH = [lib_path,])
550          env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
551       except KeyError:
552          pass
553      
554       try:
555          scsl_libs = env['scsl_libs']
556       except KeyError:
557          scsl_libs = [ ]
558    
559    else:
560        scsl_libs =  []
561    
562    # ============= set TRILINOS (but only with MPI) =====================================
563    if useMPI:
564       try:
565          includes = env['trilinos_path']
566          env.Append(CPPPATH = [includes,])
567       except KeyError:
568          pass
569    
570       try:
571          lib_path = env['trilinos_lib_path']
572          env.Append(LIBPATH = [lib_path,])
573       except KeyError:
574          pass
575    
576       try:
577          trilinos_libs = env['trilinos_libs']
578       except KeyError:
579          trilinos_libs = []
580    else:
581         trilinos_libs = []
582    
583    
584    # ============= set umfpack (but only without MPI) =====================================
585    umf_libs=[ ]
586    if not useMPI:
587       try:
588          includes = env['umf_path']
589          env.Append(CPPPATH = [includes,])
590       except KeyError:
591          pass
592    
593       try:
594          lib_path = env['umf_lib_path']
595          env.Append(LIBPATH = [lib_path,])
596       except KeyError:
597          pass
598    
599       try:
600          umf_libs = env['umf_libs']
601          umf_libs+=umf_libs
602       except KeyError:
603          pass
604    
605       try:
606          includes = env['ufc_path']
607          env.Append(CPPPATH = [includes,])
608       except KeyError:
609          pass
610    
611       try:
612          includes = env['amd_path']
613          env.Append(CPPPATH = [includes,])
614       except KeyError:
615          pass
616    
617       try:
618          lib_path = env['amd_lib_path']
619          env.Append(LIBPATH = [lib_path,])
620       except KeyError:
621          pass
622    
623       try:
624          amd_libs = env['amd_libs']
625          umf_libs+=amd_libs
626       except KeyError:
627          pass
628    
629    # ============= set TRILINOS (but only with MPI) =====================================
630    if useMPI:
631       try:
632          includes = env['trilinos_path']
633          env.Append(CPPPATH = [includes,])
634       except KeyError:
635          pass
636    
637       try:
638          lib_path = env['trilinos_lib_path']
639          env.Append(LIBPATH = [lib_path,])
640       except KeyError:
641          pass
642    
643       try:
644          trilinos_libs = env['trilinos_libs']
645       except KeyError:
646          trilinos_libs = []
647    else:
648         trilinos_libs = []
649    
650    # ============= set blas =====================================
651  try:  try:
652     includes = env['umf_path']     includes = env['blas_path']
653     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
654  except KeyError:  except KeyError:
655     pass     pass
656    
657  try:  try:
658     lib_path = env['umf_lib_path']     lib_path = env['blas_lib_path']
659     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
660  except KeyError:  except KeyError:
661     pass     pass
662    
663    try:
664       blas_libs = env['blas_libs']
665    except KeyError:
666       blas_libs = [ ]
667    
668    # ========== netcdf ====================================
669  try:  try:
670     umf_libs = env['umf_libs']     useNetCDF = env['useNetCDF']
671  except KeyError:  except KeyError:
672     umf_libs = ''     useNetCDF = 'yes'
673       pass
674        
675    if useNetCDF == 'yes':
676       try:
677          netCDF_libs = env['netCDF_libs']
678       except KeyError:
679          pass
680    
681       env.Append(LIBS = netCDF_libs)
682       env.Append(CPPDEFINES = [ 'USE_NETCDF' ])
683       try:
684          includes = env['netCDF_path']
685          env.Append(CPPPATH = [includes,])
686       except KeyError:
687          pass
688    
689       try:
690          lib_path = env['netCDF_lib_path']
691          env.Append(LIBPATH = [ lib_path, ])
692          env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
693          if IS_WINDOWS_PLATFORM :
694             env.PrependENVPath('PATH', lib_path)
695       except KeyError:
696          pass
697    else:
698       print "Warning: Installation is not configured with netCDF. Some I/O function may not be available."
699       netCDF_libs=[ ]
700    
701    # ====================== boost ======================================
702  try:  try:
703     includes = env['boost_path']     includes = env['boost_path']
704     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
# Line 271  except KeyError: Line 707  except KeyError:
707  try:  try:
708     lib_path = env['boost_lib_path']     lib_path = env['boost_lib_path']
709     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
710       env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
711       if IS_WINDOWS_PLATFORM :
712          env.PrependENVPath('PATH', lib_path)
713  except KeyError:  except KeyError:
714     pass     pass
715  try:  try:
716     boost_lib = env['boost_lib']     boost_lib = env['boost_lib']
717  except KeyError:  except KeyError:
718     boost_lib = None       boost_lib = None
719    # ====================== python ======================================
720  try:  try:
721     includes = env['python_path']     includes = env['python_path']
722     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
# Line 284  except KeyError: Line 724  except KeyError:
724     pass     pass
725  try:  try:
726     lib_path = env['python_lib_path']     lib_path = env['python_lib_path']
727       env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
728     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
729  except KeyError:  except KeyError:
730     pass     pass
731  try:  try:
732     python_lib = env['python_lib']     python_lib = env['python_lib']
733  except KeyError:  except KeyError:
734     python_lib = None       python_lib = None
735    # =============== documentation =======================================
736  try:  try:
737     doxygen_path = env['doxygen_path']     doxygen_path = env['doxygen_path']
738  except KeyError:  except KeyError:
739     doxygen_path = None       doxygen_path = None
740  try:  try:
741     epydoc_path = env['epydoc_path']     epydoc_path = env['epydoc_path']
742  except KeyError:  except KeyError:
743     epydoc_path = None       epydoc_path = None
744    # =============== ParMETIS =======================================
745    try:
746       parmetis_path = env['parmetis_path']
747       parmetis_lib_path = env['parmetis_lib_path']
748       parmetis_lib = env['parmetis_lib']
749    except KeyError:
750       parmetis_path = ''
751       parmetis_lib_path = ''
752       parmetis_lib = ''
753    
754    if useMPI and os.path.isdir(parmetis_lib_path):
755       env.Append(CPPDEFINES = [ 'PARMETIS' ])
756       env.Append(CXXDEFINES = [ 'PARMETIS' ])
757       env.Append(CPPPATH = [parmetis_path])
758       env.Append(LIBPATH = [parmetis_lib_path])
759       env.Append(LIBS = parmetis_lib)
760    # =============== PAPI =======================================
761  try:  try:
762     includes = env['papi_path']     includes = env['papi_path']
763     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
# Line 312  except KeyError: Line 771  except KeyError:
771  try:  try:
772     papi_libs = env['papi_libs']     papi_libs = env['papi_libs']
773  except KeyError:  except KeyError:
774     papi_libs = None       papi_libs = None
775    # ============= set mpi =====================================
776    if useMPI:
777       env.Append(CPPDEFINES=['PASO_MPI', 'MPI_NO_CPPBIND'])
778       try:
779          includes = env['mpi_path']
780          env.Append(CPPPATH = [includes,])
781       except KeyError:
782          pass
783       try:
784          lib_path = env['mpi_lib_path']
785          env.Append(LIBPATH = [lib_path,])
786          env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
787       except KeyError:
788          pass
789       try:
790          mpi_libs = env['mpi_libs']
791       except KeyError:
792          mpi_libs = []
793    
794       try:
795          mpi_run = env['mpi_run']
796       except KeyError:
797          mpi_run = ''
798    
799       try:
800           mpich_ignore_cxx_seek=env['MPICH_IGNORE_CXX_SEEK']
801           env.Append(CPPDEFINES = [ mpich_ignore_cxx_seek ] )
802       except KeyError:
803          pass
804    else:
805      mpi_libs=[]
806      mpi_run = mpi_run_default
807    # =========== zip files ===========================================
808    try:
809       includes = env['papi_path']
810       env.Append(CPPPATH = [includes,])
811    except KeyError:
812       pass
813    try:
814       lib_path = env['papi_lib_path']
815       env.Append(LIBPATH = [lib_path,])
816    except KeyError:
817       pass
818    try:
819       papi_libs = env['papi_libs']
820    except KeyError:
821       papi_libs = None
822    try:
823       papi_instrument_solver = env['papi_instrument_solver']
824    except KeyError:
825       papi_instrument_solver = None
826    
827    
828    # ============= and some helpers =====================================
829    try:
830       doxygen_path = env['doxygen_path']
831    except KeyError:
832       doxygen_path = None
833    try:
834       epydoc_path = env['epydoc_path']
835    except KeyError:
836       epydoc_path = None
837  try:  try:
838     src_zipfile = env.File(env['src_zipfile'])     src_zipfile = env.File(env['src_zipfile'])
839  except KeyError:  except KeyError:
840     src_zipfile = None       src_zipfile = None
841  try:  try:
842     test_zipfile = env.File(env['test_zipfile'])     test_zipfile = env.File(env['test_zipfile'])
843  except KeyError:  except KeyError:
844     test_zipfile = None       test_zipfile = None
845  try:  try:
846     examples_zipfile = env.File(env['examples_zipfile'])     examples_zipfile = env.File(env['examples_zipfile'])
847  except KeyError:  except KeyError:
848     examples_zipfile = None       examples_zipfile = None
849    
850  try:  try:
851     src_tarfile = env.File(env['src_tarfile'])     src_tarfile = env.File(env['src_tarfile'])
852  except KeyError:  except KeyError:
853     src_tarfile = None       src_tarfile = None
854  try:  try:
855     test_tarfile = env.File(env['test_tarfile'])     test_tarfile = env.File(env['test_tarfile'])
856  except KeyError:  except KeyError:
857     test_tarfile = None       test_tarfile = None
858  try:  try:
859     examples_tarfile = env.File(env['examples_tarfile'])     examples_tarfile = env.File(env['examples_tarfile'])
860  except KeyError:  except KeyError:
861     examples_tarfile = None       examples_tarfile = None
862    
863  try:  try:
864     guide_pdf = env.File(env['guide_pdf'])     guide_pdf = env.File(env['guide_pdf'])
865  except KeyError:  except KeyError:
866     guide_pdf = None       guide_pdf = None
867    
868  try:  try:
869     guide_html_index = env.File('index.htm',env['guide_html'])     guide_html_index = env.File('index.htm',env['guide_html'])
870  except KeyError:  except KeyError:
871     guide_html_index = None       guide_html_index = None
872    
873  try:  try:
874     api_epydoc = env.Dir(env['api_epydoc'])     api_epydoc = env.Dir(env['api_epydoc'])
875  except KeyError:  except KeyError:
876     api_epydoc = None       api_epydoc = None
877    
878    try:
879       api_doxygen = env.Dir(env['api_doxygen'])
880    except KeyError:
881       api_doxygen = None
882    
883    try:
884       svn_pipe = os.popen("svnversion -n .")
885       global_revision = svn_pipe.readlines()
886       svn_pipe.close()
887       global_revision = re.sub(":.*", "", global_revision[0])
888       global_revision = re.sub("[^0-9]", "", global_revision)
889    except:
890       global_revision="-1"
891       print "Warning: unable to recover global revsion number."
892    if global_revision == "": global_revision="0"
893    print "Revision number is %s."%global_revision
894    env.Append(CPPDEFINES = "SVN_VERSION="+global_revision)
895    
896    # Python install - esys __init__.py
897    init_target = env.Command(pyinstall+'/__init__.py', None, Touch('$TARGET'))
898    
899    # FIXME: exinstall and friends related to examples are not working.
900    build_target = env.Alias('build',[libinstall,incinstall,pyinstall,init_target])
901    
902    env.Default(build_target)
903    
904  # Zipgets  # Zipgets
905      env.Alias('release_src',[ src_zipfile, src_tarfile ])
 env.Default(libinstall)  
 env.Default(incinstall)  
 env.Default(pyinstall)  
 env.Alias('release_src',[ src_zipfile, src_tarfile ])    
906  env.Alias('release_tests',[ test_zipfile, test_tarfile])  env.Alias('release_tests',[ test_zipfile, test_tarfile])
907  env.Alias('release_examples',[ examples_zipfile, examples_tarfile])  env.Alias('release_examples',[ examples_zipfile, examples_tarfile])
908    env.Alias('examples_zipfile',examples_zipfile)
909    env.Alias('examples_tarfile',examples_tarfile)
910  env.Alias('api_epydoc',api_epydoc)  env.Alias('api_epydoc',api_epydoc)
911  env.Alias('docs',[ 'release_examples', guide_pdf, guide_html_index, api_epydoc])  env.Alias('api_doxygen',api_doxygen)
912    env.Alias('guide_html_index',guide_html_index)
913    env.Alias('guide_pdf', guide_pdf)
914    env.Alias('docs',[ 'release_examples', 'guide_pdf', api_epydoc, api_doxygen, guide_html_index])
915  env.Alias('release', ['release_src', 'release_tests', 'docs'])  env.Alias('release', ['release_src', 'release_tests', 'docs'])
916  env.Alias('build_tests')    # target to build all C++ tests  
917  env.Alias('build_py_tests') # target to build all python tests  env.Alias('build_tests',build_target)    # target to build all C++ tests
918    env.Alias('build_py_tests',build_target) # target to build all python tests
919  env.Alias('build_all_tests', [ 'build_tests', 'build_py_tests' ] ) # target to build all python tests  env.Alias('build_all_tests', [ 'build_tests', 'build_py_tests' ] ) # target to build all python tests
920  env.Alias('run_tests', 'build_tests')   # target to run all C++ test  env.Alias('run_tests', 'build_tests')   # target to run all C++ test
921  env.Alias('py_tests', 'build_py_tests') # taget to run all released python tests  env.Alias('py_tests', 'build_py_tests') # taget to run all released python tests
922  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
923    
 # Python install - esys __init__.py  
 # 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  
 # create the file if it doesn't exist  
 env.Command(pyinstall+'/__init__.py', None, 'touch $TARGET')  
924    
925  # Allow sconscripts to see the env  # Allow sconscripts to see the env
926  Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs",  Export(["IS_WINDOWS_PLATFORM", "env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "blas_libs", "netCDF_libs", "useNetCDF", "mpi_run",
927      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs",      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs",
928          "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", "trilinos_libs", "mpi_libs", "papi_instrument_solver",
929          "guide_pdf", "guide_html_index", "api_epydoc"])          "guide_pdf", "guide_html_index", "api_epydoc", "api_doxygen", "useMPI" ])
930    
931  # End initialisation section  # End initialisation section
932  # Begin configuration section  # Begin configuration section
933  # adds this file and the scons option directore to the source tar  # adds this file and the scons option directore to the source tar
934  release_srcfiles=[env.File('SConstruct'),]+[ env.File(x) for x in glob.glob('scons/*.py') ]  release_srcfiles=[env.File('SConstruct'),env.Dir('lib'),env.Dir('include'),]+[ env.File(x) for x in glob.glob('scons/*.py') ]
935  release_testfiles=[env.File('README_TESTS'),]  release_testfiles=[env.File('README_TESTS'),]
936  env.Zip(src_zipfile, release_srcfiles)  env.Zip(src_zipfile, release_srcfiles)
937  env.Zip(test_zipfile, release_testfiles)  env.Zip(test_zipfile, release_testfiles)
938  env.Tar(src_tarfile, release_srcfiles)  try:
939  env.Tar(test_tarfile, release_testfiles)     env.Tar(src_tarfile, release_srcfiles)
940       env.Tar(test_tarfile, release_testfiles)
941    except AttributeError:
942       pass
943  # Insert new components to be build here  # Insert new components to be build here
944  # 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
945  # 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
946  # Third Party libraries  # Third Party libraries
947  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)
948  # C/C++ Libraries  # C/C++ Libraries
 env.SConscript(dirs = ['paso/src'], build_dir='build/$PLATFORM/paso', duplicate=0)  
 env.SConscript(dirs = ['bruce/src'], build_dir='build/$PLATFORM/bruce', duplicate=0)  
 env.SConscript(dirs = ['escript/src'], build_dir='build/$PLATFORM/escript', duplicate=0)  
949  env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)  env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)
950    env.SConscript(dirs = ['escript/src'], build_dir='build/$PLATFORM/escript', duplicate=0)
951    env.SConscript(dirs = ['paso/src'], build_dir='build/$PLATFORM/paso', duplicate=0)
952    # bruce is removed for now as it doesn't really do anything
953    # env.SConscript(dirs = ['bruce/src'], build_dir='build/$PLATFORM/bruce', duplicate=0)
954  env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)  env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)
955  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)
956  env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0)  env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0)
957  env.SConscript(dirs = ['pyvisi/py_src'], build_dir='build/$PLATFORM/pyvisi', duplicate=0)  env.SConscript(dirs = ['pyvisi/py_src'], build_dir='build/$PLATFORM/pyvisi', duplicate=0)
958    env.SConscript(dirs = ['pycad/py_src'], build_dir='build/$PLATFORM/pycad', duplicate=0)
959    env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)
960    #env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0)
961    
962    
963    syslib_install_target = env.installDirectory(sys_libinstall,libinstall)
964    syspy_install_target = env.installDirectory(sys_pyinstall,pyinstall,recursive=True)
965    
966  # added by Ben Cumming  install_target = env.Alias("install", env.Flatten([syslib_install_target, syspy_install_target]) )
 env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)  

Legend:
Removed from v.751  
changed lines
  Added in v.1663

  ViewVC Help
Powered by ViewVC 1.1.26