/[escript]/branches/arrayview_from_1695_trunk/SConstruct
ViewVC logotype

Diff of /branches/arrayview_from_1695_trunk/SConstruct

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

revision 1185 by gross, Thu May 31 04:33:31 2007 UTC revision 1628 by phornby, Fri Jul 11 13:12:46 2008 UTC
# Line 15  EnsurePythonVersion(2,3) Line 15  EnsurePythonVersion(2,3)
15  #===============================================================  #===============================================================
16  #   import tools:  #   import tools:
17  import glob  import glob
18  import sys, os  import sys, os, re
 import socket  
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  #===============================================================  #===============================================================
 #   check on windows or linux platform  
 #  
 IS_WINDOWS_PLATFORM = (os.name== "nt")  
27    
28  if IS_WINDOWS_PLATFORM:  tools_prefix="/usr"
    tools_prefix="C:\\Program Files\\"  
 else:  
    tools_prefix="/usr"  
29    
30  #==============================================================================================      #==============================================================================================    
31  #      #    
32  #    get the iinstallation prefix  #    get the installation prefix
33  #  #
34  prefix = ARGUMENTS.get('prefix', Dir('#.').abspath)  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  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.
# Line 47  print "Install prefix is: ", prefix Line 71  print "Install prefix is: ", prefix
71  #      #    
72  #    get the options file if present:  #    get the options file if present:
73  #  #
74  if ARGUMENTS.get('options_file',0):  options_file = ARGUMENTS.get('options_file','')
75     options_file = ARGUMENTS.get('options_file',0)  
76  else:  if not os.path.isfile(options_file) :
77     from string import ascii_letters,digits      options_file = False
78     hostname=""  
79     for s in socket.gethostname().split('.')[0]:  if not options_file :
80        if s in ascii_letters+digits:     import socket
81           hostname+=s     hostname = re.sub("[^0-9a-zA-Z]", "_", socket.gethostname().split('.')[0])
82        else:     tmp = os.path.join("scons",hostname+"_options.py")
83           hostname+="_"  
84     options_file = os.path.join("scons",hostname+"_options.py")     if os.path.isfile(tmp) :
85            options_file = tmp
86  if os.path.isfile(options_file):  
87     print "option file is ",options_file,"."  IS_WINDOWS_PLATFORM = (os.name== "nt")
88  else:  
89     print "option file is ",options_file, "(not present)."  # 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  # and load it
98  opts = Options(options_file, ARGUMENTS)  opts = Options(options_file, ARGUMENTS)
99  #================================================================  #================================================================
# Line 96  else: Line 127  else:
127  #  #
128  #    python installation:  #    python installation:
129  #  #
130  if IS_WINDOWS_PLATFORM:  python_path_default=os.path.join(tools_prefix,'include','python%s.%s'%(sys.version_info[0],sys.version_info[1]))
131     python_path_default=os.path.join(tools_prefix,'python%s%s'%(sys.version_info[0],sys.version_info[1]),"include")  python_lib_path_default=os.path.join(tools_prefix,'lib')
132     python_lib_path_default=os.path.join(tools_prefix,'python%s%s'%(sys.version_info[0],sys.version_info[1]),"libs")  python_lib_default="python%s.%s"%(sys.version_info[0],sys.version_info[1])
    python_libs_default=["python%s%s"%(sys.version_info[0],sys.version_info[1])]  
 else:  
    python_path_default=os.path.join(tools_prefix,'include','python%s.%s'%(sys.version_info[0],sys.version_info[1]))  
    python_lib_path_default=os.path.join(tools_prefix,'lib')  
    python_libs_default=["python%s.%s"%(sys.version_info[0],sys.version_info[1])]  
133    
134  #==========================================================================  #==========================================================================
135  #  #
136  #    boost installation:  #    boost installation:
137  #  #
138  if IS_WINDOWS_PLATFORM:  boost_path_default=os.path.join(tools_prefix,'include')
139     boost_libs_path_default=os.path.join(tools_prefix,'boost','lib')  boost_lib_path_default=os.path.join(tools_prefix,'lib')
140     boost_libs_default=None  boost_lib_default=['boost_python']
141     for i in os.listdir(boost_libs_path_default):  
       name=os.path.splitext(i)  
       if name[1] == ".dll" and name[0].startswith("boost_python"):  
           if boost_libs_default == None:  
          boost_libs_default= [ name[0] ]  
       else:  
          if not name[0].find("-gd-"): boost_libs_default=[ name[0] ]  
    boost_path_default=os.path.join(tools_prefix,'boost','include','boost-%s'%(boost_libs_default[0].split("-")[-1],))  
 else:  
    boost_path_default=os.path.join(tools_prefix,'include')  
    boost_libs_path_default=os.path.join(tools_prefix,'lib')  
    boost_libs_default=['boost_python']  
142  #==========================================================================  #==========================================================================
143  #  #
144  #    check if netCDF is installed on the system:  #    check if netCDF is installed on the system:
145  #  #
146  if IS_WINDOWS_PLATFORM:  netCDF_path_default=os.path.join(tools_prefix,'include','netcdf-3')
147      netcdf_dir=os.path.join(tools_prefix,'netcdf')  netCDF_lib_path_default=os.path.join(tools_prefix,'lib')
     netCDF_path_default=os.path.join(netcdf_dir,'include')  
     netCDF_lib_path_default=os.path.join(netcdf_dir,'lib')  
 else:  
     netCDF_path_default=os.path.join(tools_prefix,'include','netcdf-3')  
     netCDF_lib_path_default=os.path.join(tools_prefix,'lib','netcdf-3')  
148    
149  if os.path.isdir(netCDF_path_default) and os.path.isdir(netCDF_lib_path_default):  if os.path.isdir(netCDF_path_default) and os.path.isdir(netCDF_lib_path_default):
150       useNetCDF_default='yes'       useNetCDF_default='yes'
# Line 145  else: Line 155  else:
155       netCDF_lib_path_default=None       netCDF_lib_path_default=None
156       netCDF_libs_default=None       netCDF_libs_default=None
157    
158    #==========================================================================
159    #
160    #  MPI:
161    #
162  if IS_WINDOWS_PLATFORM:  if IS_WINDOWS_PLATFORM:
163          useNetCDF_default='no' # be default netcdf is not supported on windows.     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:  #    compile:
179  #  #
180  if IS_WINDOWS_PLATFORM:  cc_flags_default='-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas -ansi'
181      # cc_flags_default  = '/GR /EHsc /MD /Qc99 /Qopenmp /Qopenmp-report1 /O3 /G7 /Qprec /Qpar-report1 /QxP /QaxP'  cc_flags_debug_default='-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas -ansi'
182      # cc_flags_debug_default  = '/Od /MDd /RTC1 /GR /EHsc /Qc99 /Qopenmp /Qopenmp-report1 /Qprec'  cxx_flags_default='--no-warn -ansi'
183      cc_flags_default  = '/nologo /EHsc /GR  /wd4068 /O2 /Op /MT /W3 /Ob0 /Z7'  cxx_flags_debug_default='--no-warn -ansi -DDOASSERT'
184      cc_flags_debug_default  ='/nologo /EHsc /GR  /wd4068 /Od /RTC1 /MTd /ZI /Ob0 /Z7'  
       
     cc_flags_default  = '/nologo /EHsc /GR  /O2 /MT /W3 /Ob0 /Z7 /wd4068'  
     cc_flags_debug_default  ='/nologo /EHsc /GR /Od /RTC1 /MTd /W3 /Ob0 /Z7/wd4068'  
     cxx_flags_default = ''  
     cxx_flags_debug_default = ''  
     cc_common_flags = '/FD /EHsc /GR /wd4068 '  
 else:  
    cc_flags_default='-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas -ansi -pedantic-errors'  
    cc_flags_debug_default='-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas -ansi -pedantic-errors'  
    cxx_flags_default='--no-warn -ansi'  
    cxx_flags_debug_default='--no-warn -ansi -DDOASSERT'  
185  #==============================================================================================      #==============================================================================================    
186  # Default options and options help text  # Default options and options help text
187  # 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.
# Line 174  else: Line 189  else:
189  # DO NOT CHANGE THEM HERE  # 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', prefix+'/include'),    ('incinstall', 'where the esys headers will be installed',             Dir('#.').abspath+'/include'),
193    ('libinstall', 'where the esys libraries will be installed', prefix+'/lib'),    ('libinstall', 'where the esys libraries will be installed',           dir_libraries),
194    ('pyinstall', 'where the esys python modules will be installed', prefix),    ('pyinstall', 'where the esys python modules will be installed',       dir_packages),
195    ('src_zipfile', 'the source zip file will be installed.', prefix+"/release/escript_src.zip"),    ('exinstall', 'where the esys examples will be installed',             dir_examples),
196    ('test_zipfile', 'the test zip file will be installed.', prefix+"/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.', prefix+"/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.', prefix+"/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.', prefix+"/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.', prefix+"/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', prefix+"/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',prefix+"/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', prefix+"/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      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),    ('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)', cc_flags_default),    ('cc_flags','C compiler flags to use (Release build)', cc_flags_default),
215    ('cc_flags_debug', 'C compiler flags to use (Debug build)', cc_flags_debug_default),    ('cc_flags_debug', 'C compiler flags to use (Debug build)', cc_flags_debug_default),
216    ('cxx_flags', 'C++ compiler flags to use (Release build)', cxx_flags_default),    ('cxx_flags', 'C++ compiler flags to use (Release build)', cxx_flags_default),
217    ('cxx_flags_debug', 'C++ compiler flags to use (Debug build)', cxx_flags_debug_default),    ('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'),
# Line 215  opts.AddOptions( Line 241  opts.AddOptions(
241    PathOption('amd_path', 'Path to AMD includes', amd_path_default),    PathOption('amd_path', 'Path to AMD includes', amd_path_default),
242    PathOption('amd_lib_path', 'Path to AMD libs', amd_lib_path_default),    PathOption('amd_lib_path', 'Path to AMD libs', amd_lib_path_default),
243    ('amd_libs', 'AMD libraries to link with', amd_libs_default),    ('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  # BLAS
253    PathOption('blas_path', 'Path to BLAS includes', None),    PathOption('blas_path', 'Path to BLAS includes', None),
254    PathOption('blas_lib_path', 'Path to BLAS libs', None),    PathOption('blas_lib_path', 'Path to BLAS libs', None),
# Line 226  opts.AddOptions( Line 260  opts.AddOptions(
260    ('netCDF_libs', 'netCDF C++ libraries to link with', netCDF_libs_default),    ('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    # FIXME: python_path should be python_inc_path and the same for boost etc.
264    PathOption('python_path', 'Path to Python includes', python_path_default),    PathOption('python_path', 'Path to Python includes', python_path_default),
265    PathOption('python_lib_path', 'Path to Python libs', python_lib_path_default),    PathOption('python_lib_path', 'Path to Python libs', python_lib_path_default),
266    ('python_libs', 'Python libraries to link with', python_libs_default),    ('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', boost_path_default),    PathOption('boost_path', 'Path to Boost includes', boost_path_default),
270    PathOption('boost_libs_path', 'Path to Boost libs', boost_libs_path_default),    PathOption('boost_lib_path', 'Path to Boost libs', boost_lib_path_default),
271    ('boost_libs', 'Boost libraries to link with', boost_libs_default),    ('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),
# Line 240  opts.AddOptions( Line 276  opts.AddOptions(
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  # MPI
281    BoolOption('useMPI', 'Compile parallel version using MPI', 'no'),    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  #  #
# Line 253  opts.AddOptions( Line 295  opts.AddOptions(
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)  #   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  #   FIXME: Perhaps a modification to intelc.py will allow better support for ia64 on altix
297  #  #
298    
299  if IS_WINDOWS_PLATFORM:  if IS_WINDOWS_PLATFORM:
300        env = Environment(tools = ['default', 'msvc'], options = opts)        env = Environment(tools = ['default', 'msvc'], options = opts)
301          #env = Environment(tools = ['default', 'intelc'], options = opts)
302  else:  else:
303     if os.uname()[4]=='ia64':     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)        env = Environment(tools = ['default', 'intelc'], options = opts)
307        if env['CXX'] == 'icpc':        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           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:     else:
310        env = Environment(tools = ['default'], options = opts)        env = Environment(tools = ['default'], options = opts)
311  Help(opts.GenerateHelpText(env))  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  #     Initialise Scons Build Environment
323  #     check for user environment variables we are interested in  #     check for user environment variables we are interested in
324  try:  try:
325     python_path = os.environ['PYTHONPATH']     tmp = os.environ['PYTHONPATH']
326     env['ENV']['PYTHONPATH'] = python_path     env['ENV']['PYTHONPATH'] = tmp
327  except KeyError:  except KeyError:
328     python_path = ''     pass
329    
330    env.PrependENVPath('PYTHONPATH', source_root)
331    
332  try:  try:
333     omp_num_threads = os.environ['OMP_NUM_THREADS']     omp_num_threads = os.environ['OMP_NUM_THREADS']
# Line 280  except KeyError: Line 336  except KeyError:
336  env['ENV']['OMP_NUM_THREADS'] = omp_num_threads  env['ENV']['OMP_NUM_THREADS'] = omp_num_threads
337    
338  try:  try:
339       path = os.environ['PATH']
340       env['ENV']['PATH'] = path
341    except KeyError:
342       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:
349     env['ENV']['DISPLAY'] = os.environ['DISPLAY']     env['ENV']['DISPLAY'] = os.environ['DISPLAY']
350     env['ENV']['XAUTHORITY'] = os.environ['XAUTHORITY']     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     pass     pass
355    
356  try:  try:
357     path = os.environ['PATH']     tmp = os.environ['PATH']
358     env['ENV']['PATH'] = path     env['ENV']['PATH'] = tmp
359  except KeyError:  except KeyError:
360     path = ''     pass
361    
362  try:  try:
363     ld_library_path = os.environ['LD_LIBRARY_PATH']     tmp = os.environ['LD_LIBRARY_PATH']
364     env['ENV']['LD_LIBRARY_PATH'] = ld_library_path     env['ENV']['LD_LIBRARY_PATH'] = tmp
365  except KeyError:  except KeyError:
366     ld_library_path = ''     pass
367  #==========================================================================  #==========================================================================
368  #  #
369  #    Add some customer builders  #    Add some customer builders
# Line 302  except KeyError: Line 371  except KeyError:
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 IS_WINDOWS_PLATFORM:  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 319  except KeyError: Line 387  except KeyError:
387     incinstall = None     incinstall = None
388  try:  try:
389     libinstall = env['libinstall']     libinstall = env['libinstall']
390     env.Append(LIBPATH = [libinstall,]) # ksteube adds -L for building of libescript.so libfinley.so escriptcpp.so finleycpp.so     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 env['PLATFORM'] == "win32":     if IS_WINDOWS_PLATFORM :
393        env.PrependENVPath('PATH', libinstall)        env.PrependENVPath('PATH', libinstall)
394        env.PrependENVPath('PATH', env['boost_libs_path'])        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'])  
399  except KeyError:  except KeyError:
400     pyinstall = None     pyinstall = None
401    
402    try:
403       cc_defines = env['cc_defines']
404       env.Append(CPPDEFINES = cc_defines)
405    except KeyError:
406       pass
407    try:
408       flags = env['ar_flags']
409       env.Append(ARFLAGS = flags)
410    except KeyError:
411       ar_flags = None
412    try:
413       sys_libs = env['sys_libs']
414    except KeyError:
415       sys_libs = []
416    
417    try:
418       tar_flags = env['tar_flags']
419       env.Replace(TARFLAGS = tar_flags)
420    except KeyError:
421       pass
422    
423    try:
424       exinstall = env['exinstall']
425    except KeyError:
426       exinstall = None
427    try:
428       sys_libinstall = env['sys_libinstall']
429    except KeyError:
430       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     dodebug = env['dodebug']     dodebug = env['dodebug']
443  except KeyError:  except KeyError:
444     dodebug = None     dodebug = None
445    
446    # === switch on omp ===================================================
447  try:  try:
448     useMPI = env['useMPI']    omp_flags = env['omp_flags']
449  except KeyError:  except KeyError:
450     useMPI = None    omp_flags = ''
451    
452  try:  try:
453     cc_defines = env['cc_defines']    omp_flags_debug = env['omp_flags_debug']
    env.Append(CPPDEFINES = cc_defines)  
454  except KeyError:  except KeyError:
455     pass    omp_flags_debug = ''
456    
457    # ========= use mpi? =====================================================
458    try:
459       useMPI = env['useMPI']
460    except KeyError:
461       useMPI = None
462    # ========= set compiler flags ===========================================
463    
464  if dodebug:  if dodebug:
   if useMPI:  
     try:  
       flags = env['cc_flags_debug_MPI']  
       env.Append(CCFLAGS = flags)  
     except KeyError:  
       pass  
   else:  
465      try:      try:
466        flags = env['cc_flags_debug']        flags = env['cc_flags_debug'] + ' ' + omp_flags_debug
467        env.Append(CCFLAGS = flags)        env.Append(CCFLAGS = flags)
468      except KeyError:      except KeyError:
469        pass        pass
470  else:  else:
   if useMPI:  
471     try:     try:
472       flags = env['cc_flags_MPI']        flags = env['cc_flags'] + ' ' + omp_flags
      env.Append(CCFLAGS = flags)  
    except KeyError:  
       pass  
   else:  
    try:  
       flags = env['cc_flags']  
473        env.Append(CCFLAGS = flags)        env.Append(CCFLAGS = flags)
474     except KeyError:     except KeyError:
475        pass        pass
476  if dodebug:  if dodebug:
    if useMPI:  
477       try:       try:
478          flags = env['cxx_flags_debug_MPI']          flags = env['cxx_flags_debug']
479          env.Append(CXXFLAGS = flags)          env.Append(CXXFLAGS = flags)
480       except KeyError:       except KeyError:
481          pass          pass
482     else:  else:
483       try:       try:
484          flags = env['cxx_flags_debug']          flags = env['cxx_flags']
485          env.Append(CXXFLAGS = flags)          env.Append(CXXFLAGS = flags)
486       except KeyError:       except KeyError:
487          pass          pass
488  else:  try:
489     if useMPI:       if env['CC'] == 'gcc': env.Append(CCFLAGS = "-pedantic-errors -Wno-long-long")
490    except:
491         pass
492    if dodebug:
493       try:       try:
494          flags = env['cxx_flags_MPI']          flags = env['link_flags_debug']
495          env.Append(CXXFLAGS = flags)          env.Append(LINKFLAGS = flags)
496       except KeyError:       except KeyError:
497          pass          pass
498     else:  else:
499       try:       try:
500          flags = env['cxx_flags']          flags = env['link_flags']
501          env.Append(CXXFLAGS = flags)          env.Append(LINKFLAGS = flags)
502       except KeyError:       except KeyError:
503          pass          pass
 try:  
    flags = env['ar_flags']  
    env.Append(ARFLAGS = flags)  
 except KeyError:  
    ar_flags = None  
 try:  
    sys_libs = env['sys_libs']  
 except KeyError:  
    sys_libs = []  
504    
505  try:  # ============= Remember what options were used in the compile =====================================
506     tar_flags = env['tar_flags']  if not IS_WINDOWS_PLATFORM:
507     env.Replace(TARFLAGS = tar_flags)    env.Execute("/bin/rm -f " + libinstall + "/Compiled.with.*")
508  except KeyError:    if dodebug:       env.Execute("touch " + libinstall + "/Compiled.with.debug")
509     pass    if useMPI:        env.Execute("touch " + libinstall + "/Compiled.with.mpi")
510      if omp_flags != '':   env.Execute("touch " + libinstall + "/Compiled.with.OpenMP")
511      if bounds_check:  env.Execute("touch " + libinstall + "/Compiled.with.bounds_check")
512    
513  try:  # ============= set mkl (but only of no MPI) =====================================
514     includes = env['mkl_path']  if not useMPI:
515     env.Append(CPPPATH = [includes,])     try:
516  except KeyError:        includes = env['mkl_path']
517     pass        env.Append(CPPPATH = [includes,])
518       except KeyError:
519          pass
520    
521  try:     try:
522     lib_path = env['mkl_lib_path']        lib_path = env['mkl_lib_path']
523     env.Append(LIBPATH = [lib_path,])        env.Append(LIBPATH = [lib_path,])
524  except KeyError:        env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
525     pass     except KeyError:
526          pass
527    
 if useMPI:  
    mkl_libs = []  
 else:  
528     try:     try:
529        mkl_libs = env['mkl_libs']        mkl_libs = env['mkl_libs']
530     except KeyError:     except KeyError:
531        mkl_libs = []        mkl_libs = []
532    else:
533         mkl_libs = []
534    
535  try:  # ============= set scsl (but only of no MPI) =====================================
536     includes = env['scsl_path']  if not useMPI:
537     env.Append(CPPPATH = [includes,])     try:
538  except KeyError:        includes = env['scsl_path']
539     pass        env.Append(CPPPATH = [includes,])
540       except KeyError:
541          pass
542    
543  try:     try:
544     lib_path = env['scsl_lib_path']        lib_path = env['scsl_lib_path']
545     env.Append(LIBPATH = [lib_path,])        env.Append(LIBPATH = [lib_path,])
546  except KeyError:        env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
547     pass     except KeyError:
548          pass
549      
550       try:
551          scsl_libs = env['scsl_libs']
552       except KeyError:
553          scsl_libs = [ ]
554    
555  if useMPI:  else:
556    try:      scsl_libs =  []
     scsl_libs = env['scsl_libs_MPI']  
   except KeyError:  
     scsl_libs = []  
 else:  
   try:  
     scsl_libs = env['scsl_libs']  
   except KeyError:  
     scsl_libs = []  
557    
558  try:  # ============= set TRILINOS (but only with MPI) =====================================
559     includes = env['umf_path']  if useMPI:
560     env.Append(CPPPATH = [includes,])     try:
561  except KeyError:        includes = env['trilinos_path']
562     pass        env.Append(CPPPATH = [includes,])
563       except KeyError:
564          pass
565    
566  try:     try:
567     lib_path = env['umf_lib_path']        lib_path = env['trilinos_lib_path']
568     env.Append(LIBPATH = [lib_path,])        env.Append(LIBPATH = [lib_path,])
569  except KeyError:     except KeyError:
570     pass        pass
571    
572  if useMPI:     try:
573      umf_libs = []        trilinos_libs = env['trilinos_libs']
574       except KeyError:
575          trilinos_libs = []
576  else:  else:
577         trilinos_libs = []
578    
579    
580    # ============= set umfpack (but only without MPI) =====================================
581    umf_libs=[ ]
582    if not useMPI:
583       try:
584          includes = env['umf_path']
585          env.Append(CPPPATH = [includes,])
586       except KeyError:
587          pass
588    
589       try:
590          lib_path = env['umf_lib_path']
591          env.Append(LIBPATH = [lib_path,])
592       except KeyError:
593          pass
594    
595     try:     try:
596        umf_libs = env['umf_libs']        umf_libs = env['umf_libs']
597          umf_libs+=umf_libs
598     except KeyError:     except KeyError:
599        umf_libs = []        pass
600    
601  try:     try:
602     includes = env['ufc_path']        includes = env['ufc_path']
603     env.Append(CPPPATH = [includes,])        env.Append(CPPPATH = [includes,])
604  except KeyError:     except KeyError:
605     pass        pass
606    
607  try:     try:
608     includes = env['amd_path']        includes = env['amd_path']
609     env.Append(CPPPATH = [includes,])        env.Append(CPPPATH = [includes,])
610  except KeyError:     except KeyError:
611     pass        pass
612    
613  try:     try:
614     lib_path = env['amd_lib_path']        lib_path = env['amd_lib_path']
615     env.Append(LIBPATH = [lib_path,])        env.Append(LIBPATH = [lib_path,])
616  except KeyError:     except KeyError:
617     pass        pass
618    
 if useMPI:  
     amd_libs = []  
 else:  
619     try:     try:
620        amd_libs = env['amd_libs']        amd_libs = env['amd_libs']
621          umf_libs+=amd_libs
622       except KeyError:
623          pass
624    
625    # ============= set TRILINOS (but only with MPI) =====================================
626    if useMPI:
627       try:
628          includes = env['trilinos_path']
629          env.Append(CPPPATH = [includes,])
630       except KeyError:
631          pass
632    
633       try:
634          lib_path = env['trilinos_lib_path']
635          env.Append(LIBPATH = [lib_path,])
636       except KeyError:
637          pass
638    
639       try:
640          trilinos_libs = env['trilinos_libs']
641     except KeyError:     except KeyError:
642        amd_libs = []        trilinos_libs = []
643    else:
644         trilinos_libs = []
645    
646    # ============= set blas =====================================
647  try:  try:
648     includes = env['blas_path']     includes = env['blas_path']
649     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
# Line 517  except KeyError: Line 659  except KeyError:
659  try:  try:
660     blas_libs = env['blas_libs']     blas_libs = env['blas_libs']
661  except KeyError:  except KeyError:
662     blas_libs = []     blas_libs = [ ]
663    
664    # ========== netcdf ====================================
665  try:  try:
666     useNetCDF = env['useNetCDF']     useNetCDF = env['useNetCDF']
667  except KeyError:  except KeyError:
668     useNetCDF = 'yes'     useNetCDF = 'yes'
669     pass     pass
670        
 if not useNetCDF == 'yes':  
    print "Warning: Installation is not configured with netCDF. Some I/O function may not be available."  
     
671  if useNetCDF == 'yes':  if useNetCDF == 'yes':
672     try:     try:
673          netCDF_libs = env['netCDF_libs']
674       except KeyError:
675          pass
676    
677       env.Append(LIBS = netCDF_libs)
678       env.Append(CPPDEFINES = [ 'USE_NETCDF' ])
679       try:
680        includes = env['netCDF_path']        includes = env['netCDF_path']
681        env.Append(CPPPATH = [includes,])        env.Append(CPPPATH = [includes,])
682     except KeyError:     except KeyError:
# Line 537  if useNetCDF == 'yes': Line 684  if useNetCDF == 'yes':
684    
685     try:     try:
686        lib_path = env['netCDF_lib_path']        lib_path = env['netCDF_lib_path']
       if IS_WINDOWS_PLATFORM: env['ENV']['PATH']+=";"+lib_path  
687        env.Append(LIBPATH = [ lib_path, ])        env.Append(LIBPATH = [ lib_path, ])
688          env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
689          if IS_WINDOWS_PLATFORM :
690             env.PrependENVPath('PATH', lib_path)
691     except KeyError:     except KeyError:
692        pass        pass
   
    try:  
       netCDF_libs = env['netCDF_libs']  
    except KeyError:  
       netCDF_libs = [ ]  
693  else:  else:
694       print "Warning: Installation is not configured with netCDF. Some I/O function may not be available."
695     netCDF_libs=[ ]     netCDF_libs=[ ]
696    
697    # ====================== boost ======================================
698  try:  try:
699     includes = env['boost_path']     includes = env['boost_path']
700     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
701  except KeyError:  except KeyError:
702     pass     pass
703  try:  try:
704     lib_path = env['boost_libs_path']     lib_path = env['boost_lib_path']
705     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
706       env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
707       if IS_WINDOWS_PLATFORM :
708          env.PrependENVPath('PATH', lib_path)
709  except KeyError:  except KeyError:
710     pass     pass
711  try:  try:
712     boost_libs = env['boost_libs']     boost_lib = env['boost_lib']
713  except KeyError:  except KeyError:
714     boost_libs = None     boost_lib = None
715    # ====================== python ======================================
716  try:  try:
717     includes = env['python_path']     includes = env['python_path']
718     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
# Line 570  except KeyError: Line 720  except KeyError:
720     pass     pass
721  try:  try:
722     lib_path = env['python_lib_path']     lib_path = env['python_lib_path']
723       env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
724     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
725  except KeyError:  except KeyError:
726     pass     pass
727  try:  try:
728     python_libs = env['python_libs']     python_lib = env['python_lib']
729  except KeyError:  except KeyError:
730     python_libs = None     python_lib = None
731    # =============== documentation =======================================
732  try:  try:
733     doxygen_path = env['doxygen_path']     doxygen_path = env['doxygen_path']
734  except KeyError:  except KeyError:
# Line 585  try: Line 737  try:
737     epydoc_path = env['epydoc_path']     epydoc_path = env['epydoc_path']
738  except KeyError:  except KeyError:
739     epydoc_path = None     epydoc_path = None
740    # =============== ParMETIS =======================================
741    try:
742       parmetis_path = env['parmetis_path']
743       parmetis_lib_path = env['parmetis_lib_path']
744       parmetis_lib = env['parmetis_lib']
745    except KeyError:
746       parmetis_path = ''
747       parmetis_lib_path = ''
748       parmetis_lib = ''
749    
750    if useMPI and os.path.isdir(parmetis_lib_path):
751       env.Append(CPPDEFINES = [ 'PARMETIS' ])
752       env.Append(CXXDEFINES = [ 'PARMETIS' ])
753       env.Append(CPPPATH = [parmetis_path])
754       env.Append(LIBPATH = [parmetis_lib_path])
755       env.Append(LIBS = parmetis_lib)
756    # =============== PAPI =======================================
757  try:  try:
758     includes = env['papi_path']     includes = env['papi_path']
759     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
# Line 599  try: Line 768  try:
768     papi_libs = env['papi_libs']     papi_libs = env['papi_libs']
769  except KeyError:  except KeyError:
770     papi_libs = None     papi_libs = None
771    # ============= set mpi =====================================
772    if useMPI:
773       env.Append(CPPDEFINES=['PASO_MPI', 'MPI_NO_CPPBIND'])
774       try:
775          includes = env['mpi_path']
776          env.Append(CPPPATH = [includes,])
777       except KeyError:
778          pass
779       try:
780          lib_path = env['mpi_lib_path']
781          env.Append(LIBPATH = [lib_path,])
782          env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path
783       except KeyError:
784          pass
785       try:
786          mpi_libs = env['mpi_libs']
787       except KeyError:
788          mpi_libs = []
789    
790       try:
791          mpi_run = env['mpi_run']
792       except KeyError:
793          mpi_run = ''
794    
795       try:
796           mpich_ignore_cxx_seek=env['MPICH_IGNORE_CXX_SEEK']
797           env.Append(CPPDEFINES = [ mpich_ignore_cxx_seek ] )
798       except KeyError:
799          pass
800    else:
801      mpi_libs=[]
802      mpi_run = mpi_run_default
803    # =========== zip files ===========================================
804    try:
805       includes = env['papi_path']
806       env.Append(CPPPATH = [includes,])
807    except KeyError:
808       pass
809    try:
810       lib_path = env['papi_lib_path']
811       env.Append(LIBPATH = [lib_path,])
812    except KeyError:
813       pass
814    try:
815       papi_libs = env['papi_libs']
816    except KeyError:
817       papi_libs = None
818    try:
819       papi_instrument_solver = env['papi_instrument_solver']
820    except KeyError:
821       papi_instrument_solver = None
822    
823    
824    # ============= and some helpers =====================================
825    try:
826       doxygen_path = env['doxygen_path']
827    except KeyError:
828       doxygen_path = None
829    try:
830       epydoc_path = env['epydoc_path']
831    except KeyError:
832       epydoc_path = None
833  try:  try:
834     src_zipfile = env.File(env['src_zipfile'])     src_zipfile = env.File(env['src_zipfile'])
835  except KeyError:  except KeyError:
# Line 642  try: Line 871  try:
871  except KeyError:  except KeyError:
872     api_epydoc = None     api_epydoc = None
873    
874    try:
875       api_doxygen = env.Dir(env['api_doxygen'])
876    except KeyError:
877       api_doxygen = None
878    
879    try:
880       svn_pipe = os.popen("svnversion -n .")
881       global_revision = svn_pipe.readlines()
882       svn_pipe.close()
883       global_revision = re.sub(":.*", "", global_revision[0])
884       global_revision = re.sub("[^0-9]", "", global_revision)
885    except:
886       global_revision="-1"
887       print "Warning: unable to recover global revsion number."
888    if global_revision == "": global_revision="0"
889    print "Revision number is %s."%global_revision
890    env.Append(CPPDEFINES = "SVN_VERSION="+global_revision)
891    
892    # Python install - esys __init__.py
893    init_target = env.Command(pyinstall+'/__init__.py', None, Touch('$TARGET'))
894    
895    # FIXME: exinstall and friends related to examples are not working.
896    build_target = env.Alias('build',[libinstall,incinstall,pyinstall,init_target])
897    
898    env.Default(build_target)
899    
900  # Zipgets  # Zipgets
 env.Default(libinstall)  
 env.Default(incinstall)  
 env.Default(pyinstall)  
901  env.Alias('release_src',[ src_zipfile, src_tarfile ])  env.Alias('release_src',[ src_zipfile, src_tarfile ])
902  env.Alias('release_tests',[ test_zipfile, test_tarfile])  env.Alias('release_tests',[ test_zipfile, test_tarfile])
903  env.Alias('release_examples',[ examples_zipfile, examples_tarfile])  env.Alias('release_examples',[ examples_zipfile, examples_tarfile])
904    env.Alias('examples_zipfile',examples_zipfile)
905    env.Alias('examples_tarfile',examples_tarfile)
906  env.Alias('api_epydoc',api_epydoc)  env.Alias('api_epydoc',api_epydoc)
907    env.Alias('api_doxygen',api_doxygen)
908    env.Alias('guide_html_index',guide_html_index)
909  env.Alias('guide_pdf', guide_pdf)  env.Alias('guide_pdf', guide_pdf)
910  env.Alias('docs',[ 'release_examples', 'guide_pdf', guide_html_index, api_epydoc])  env.Alias('docs',[ 'release_examples', 'guide_pdf', api_epydoc, api_doxygen, guide_html_index])
911  env.Alias('release', ['release_src', 'release_tests', 'docs'])  env.Alias('release', ['release_src', 'release_tests', 'docs'])
912  env.Alias('build_tests')    # target to build all C++ tests  
913  env.Alias('build_py_tests') # target to build all python tests  env.Alias('build_tests',build_target)    # target to build all C++ tests
914    env.Alias('build_py_tests',build_target) # target to build all python tests
915  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
916  env.Alias('run_tests', 'build_tests')   # target to run all C++ test  env.Alias('run_tests', 'build_tests')   # target to run all C++ test
917  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
918  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
919    
 # Python install - esys __init__.py  
 init_target = env.Command(pyinstall+'/__init__.py', None, Touch('$TARGET'))  
 env.Alias(init_target)  
920    
921  # Allow sconscripts to see the env  # Allow sconscripts to see the env
922  Export(["IS_WINDOWS_PLATFORM", "env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs", "netCDF_libs", "useNetCDF",  Export(["IS_WINDOWS_PLATFORM", "env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "blas_libs", "netCDF_libs", "useNetCDF", "mpi_run",
923      "boost_libs", "python_libs", "doxygen_path", "epydoc_path", "papi_libs",      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs",
924          "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",
925          "guide_pdf", "guide_html_index", "api_epydoc", "useMPI" ])          "guide_pdf", "guide_html_index", "api_epydoc", "api_doxygen", "useMPI" ])
926    
927  # End initialisation section  # End initialisation section
928  # Begin configuration section  # Begin configuration section
929  # adds this file and the scons option directore to the source tar  # adds this file and the scons option directore to the source tar
930  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') ]
931  release_testfiles=[env.File('README_TESTS'),]  release_testfiles=[env.File('README_TESTS'),]
932  env.Zip(src_zipfile, release_srcfiles)  env.Zip(src_zipfile, release_srcfiles)
933  env.Zip(test_zipfile, release_testfiles)  env.Zip(test_zipfile, release_testfiles)
# Line 688  except AttributeError: Line 942  except AttributeError:
942  # Third Party libraries  # Third Party libraries
943  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)
944  # C/C++ Libraries  # C/C++ Libraries
945    env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)
946    env.SConscript(dirs = ['escript/src'], build_dir='build/$PLATFORM/escript', duplicate=0)
947  env.SConscript(dirs = ['paso/src'], build_dir='build/$PLATFORM/paso', duplicate=0)  env.SConscript(dirs = ['paso/src'], build_dir='build/$PLATFORM/paso', duplicate=0)
948  # bruce is removed for now as it doesn't really do anything  # bruce is removed for now as it doesn't really do anything
949  # env.SConscript(dirs = ['bruce/src'], build_dir='build/$PLATFORM/bruce', 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)  
 env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)  
950  env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)  env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)
951  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)
952  env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0)  env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0)
953  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)
954  env.SConscript(dirs = ['pycad/py_src'], build_dir='build/$PLATFORM/pycad', duplicate=0)  env.SConscript(dirs = ['pycad/py_src'], build_dir='build/$PLATFORM/pycad', duplicate=0)
   
 # added by Ben Cumming  
955  env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)  env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)
956  #env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0)  #env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0)
957    
958    
959    syslib_install_target = env.installDirectory(sys_libinstall,libinstall)
960    syspy_install_target = env.installDirectory(sys_pyinstall,pyinstall,recursive=True)
961    
962    install_target = env.Alias("install", env.Flatten([syslib_install_target, syspy_install_target]) )

Legend:
Removed from v.1185  
changed lines
  Added in v.1628

  ViewVC Help
Powered by ViewVC 1.1.26