/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 214 by jgs, Thu Nov 24 05:15:26 2005 UTC revision 1163 by gross, Wed May 23 23:56:39 2007 UTC
# Line 1  Line 1 
1    #         Copyright 2006 by ACcESS MNRF
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
10    # all of this section just intialises default environments and helper
11    # scripts. You shouldn't need to modify this section.
12    EnsureSConsVersion(0,96,91)
13    EnsurePythonVersion(2,3)
14    
15  import os  #===============================================================
16    #   import tools:
17    import glob
18    import sys, os
19    import socket
20    # Add our extensions
21    if sys.path.count('scons')==0: sys.path.append('scons')
22    import scons_extensions
23    
24    #===============================================================
25    #   check on windows or linux platform
26  #  #
27  # ensure correct versions of python and scons  IS_WINDOWS_PLATFORM = (os.name== "nt")
28    
29  EnsurePythonVersion(2,3)  if IS_WINDOWS_PLATFORM:
30  EnsureSConsVersion(0,96)     tools_prefix="C:\\Program Files\\"
31    else:
32       tools_prefix="/usr"
33    
34    #==============================================================================================    
35    #    
36    #    get the iinstallation prefix
37  #  #
38  # retreive command-line arguments if any  prefix = ARGUMENTS.get('prefix', Dir('#.').abspath)
39  # these are passed through to SConscripts  print "Install prefix is: ", prefix
40    
41  if ARGUMENTS.get('libinstall',0):  # Default options and options help text
42    libinstall = ARGUMENTS.get('libinstall',0)  # These are defaults and can be overridden using command line arguments or an options file.
43    # if the options_file or ARGUMENTS do not exist then the ones listed as default here are used
44    # DO NOT CHANGE THEM HERE
45    # Where to install?
46    #==============================================================================================    
47    #    
48    #    get the options file if present:
49    #
50    if ARGUMENTS.get('options_file',0):
51       options_file = ARGUMENTS.get('options_file',0)
52  else:  else:
53    libinstall = Dir('#lib')     from string import ascii_letters,digits
54  Export(["libinstall"])     hostname=""
55       for s in socket.gethostname().split('.')[0]:
56  if ARGUMENTS.get('debug',0):        if s in ascii_letters+digits:
57    dodebug = 1           hostname+=s
58          else:
59             hostname+="_"
60       options_file = os.path.join("scons",hostname+"_options.py")
61      
62    if os.path.isfile(options_file):
63       print "option file is ",options_file,"."
64    else:
65       print "option file is ",options_file, "(not present)."
66    # and load it
67    opts = Options(options_file, ARGUMENTS)
68    #================================================================
69    #
70    #   check if UMFPACK is installed on the system:
71    #
72    uf_root=None
73    for i in [ 'UMFPACK', 'umfpack', 'ufsparse', 'UFSPARSE']:
74       if os.path.isdir(os.path.join(tools_prefix,'include',i)):
75           uf_root=i
76           print i," is used form ",tools_prefix
77           break
78    if not uf_root==None:
79       umf_path_default=os.path.join(tools_prefix,'include',uf_root)
80       umf_lib_path_default=os.path.join(tools_prefix,'lib')
81       umf_libs_default=['umfpack']
82       amd_path_default=os.path.join(tools_prefix,'include',uf_root)
83       amd_lib_path_default=os.path.join(tools_prefix,'lib')
84       amd_libs_default=['amd']
85       ufc_path_default=os.path.join(tools_prefix,'include',uf_root)
86  else:  else:
87    dodebug = 0     umf_path_default=None
88  Export(["dodebug"])     umf_lib_path_default=None
89       umf_libs_default=None
90       amd_path_default=None
91       amd_lib_path_default=None
92       amd_libs_default=None
93       ufc_path_default=None
94    #
95    #==========================================================================
96    #
97    #    python installation:
98    #
99    if IS_WINDOWS_PLATFORM:
100       python_path_default=os.path.join(tools_prefix,'python%s%s'%(sys.version_info[0],sys.version_info[1]),"include")
101       python_lib_path_default=os.path.join(tools_prefix,'python%s%s'%(sys.version_info[0],sys.version_info[1])+"libs")
102       python_libs_default=["python%s%s"%(sys.version_info[0],sys.version_info[1])]
103    else:
104       python_path_default=os.path.join(tools_prefix,'include','python%s.%s'%(sys.version_info[0],sys.version_info[1]))
105       python_lib_path_default=os.path.join(tools_prefix,'lib')
106       python_libs_default=["python%s.%s"%(sys.version_info[0],sys.version_info[1])]
107    
108  if ARGUMENTS.get('usegcc',0):  #==========================================================================
109    usegcc = 1  #
110    #    boost installation:
111    #
112    if IS_WINDOWS_PLATFORM:
113       boost_libs_path_default=os.path.join(tools_prefix,'boost','lib')
114       boost_libs_default=None
115       for i in os.listdir(boost_libs_path_default):
116          name=os.path.splitext(i)
117          if name[1] == ".dll" and name[0].startswith("boost_python"):
118              if boost_libs_default == None:
119             boost_libs_default= [ name[0] ]
120          else:
121             if not name[0].find("-gd-"): boost_libs_default=[ name[0] ]
122       boost_path_default=os.path.join(tools_prefix,'boost','include','boost-%s'%(boost_libs_default[0].split("-")[-1],))
123  else:  else:
124    usegcc = 0     boost_path_default=os.path.join(tools_prefix,'include')
125  Export(["usegcc"])     boost_libs_path_default=os.path.join(tools_prefix,'lib')
126       boost_libs_default=['boost_python']
127    #==========================================================================
128    #
129    #    check if netCDF is installed on the system:
130    #
131    if IS_WINDOWS_PLATFORM:
132        netcdf_dir=os.path.join(tools_prefix,'netcdf')
133        netCDF_path_default=os.path.join(netcdf_dir,'include')
134        netCDF_lib_path_default=os.path.join(netcdf_dir,'lib')
135    else:
136        netCDF_path_default=os.path.join(tools_prefix,'include','netcdf-3')
137        netCDF_lib_path_default=os.path.join(tools_prefix,'lib','netcdf-3')
138    
139    if os.path.isdir(netCDF_path_default) and os.path.isdir(netCDF_lib_path_default):
140         useNetCDF_default='yes'
141         netCDF_libs_default=[ 'netcdf_c++', 'netcdf' ]
142    else:
143         useNetCDF_default='no'
144         netCDF_path_default=None
145         netCDF_lib_path_default=None
146         netCDF_libs_default=None
147    
148    if IS_WINDOWS_PLATFORM:
149            useNetCDF_default='no' # be default netcdf is not supported on windows.
150    #==========================================================================
151  #  #
152  # set and export esysroot  #    compile:
153    #
154    if IS_WINDOWS_PLATFORM:
155        # cc_flags_default  = '/GR /EHsc /MD /Qc99 /Qopenmp /Qopenmp-report1 /O3 /G7 /Qprec /Qpar-report1 /QxP /QaxP'
156        # cc_flags_debug_default  = '/Od /MDd /RTC1 /GR /EHsc /Qc99 /Qopenmp /Qopenmp-report1 /Qprec'
157        cc_flags_default  = '/nologo /EHsc /GR  /wd4068 /O2 /Op /MT /W3 /Ob0 /Z7'
158        cc_flags_debug_default  ='/nologo /EHsc /GR  /wd4068 /Od /RTC1 /MTd /ZI /Ob0 /Z7'
159        
160        cc_flags_default  = '/nologo /EHsc /GR  /O2 /MT /W3 /Ob0 /Z7 /wd4068'
161        cc_flags_debug_default  ='/nologo /EHsc /GR /Od /RTC1 /MTd /W3 /Ob0 /Z7/wd4068'
162        cxx_flags_default = ''
163        cxx_flags_debug_default = ''
164        cc_common_flags = '/FD /EHsc /GR /wd4068 '
165    else:
166       cc_flags_default='-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas -ansi -pedantic-errors'
167       cc_flags_debug_default='-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas -ansi -pedantic-errors'
168       cxx_flags_default='--no-warn -ansi'
169       cxx_flags_debug_default='--no-warn -ansi -DDOASSERT'
170    #==============================================================================================    
171    # Default options and options help text
172    # These are defaults and can be overridden using command line arguments or an options file.
173    # if the options_file or ARGUMENTS do not exist then the ones listed as default here are used
174    # DO NOT CHANGE THEM HERE
175    opts.AddOptions(
176    # Where to install esys stuff
177      ('incinstall', 'where the esys headers will be installed', prefix+'/include'),
178      ('libinstall', 'where the esys libraries will be installed', prefix+'/lib'),
179      ('pyinstall', 'where the esys python modules will be installed', prefix),
180      ('src_zipfile', 'the source zip file will be installed.', prefix+"/release/escript_src.zip"),
181      ('test_zipfile', 'the test zip file will be installed.', prefix+"/release/escript_tests.zip"),
182      ('src_tarfile', 'the source tar file will be installed.', prefix+"/release/escript_src.tar.gz"),
183      ('test_tarfile', 'the test tar file will be installed.', prefix+"/release/escript_tests.tar.gz"),
184      ('examples_tarfile', 'the examples tar file will be installed.', prefix+"/release/doc/escript_examples.tar.gz"),
185      ('examples_zipfile', 'the examples zip file will be installed.', prefix+"/release/doc/escript_examples.zip"),
186      ('guide_pdf', 'name of the user guide in pdf format', prefix+"/release/doc/user/guide.pdf"),
187      ('api_epydoc', 'name of the epydoc api docs directory',prefix+"/release/doc/epydoc"),
188      ('guide_html', 'name of the directory for user guide in html format', prefix+"/release/doc/user/html"),
189    # Compilation options
190      BoolOption('dodebug', 'Do you want a debug build?', 'no'),
191      ('options_file', "Optional file containing preferred options. Ignored if it doesn't exist (default: scons/<hostname>_options.py)", options_file),
192      ('cc_defines','C/C++ defines to use', None),
193      ('cc_flags','C compiler flags to use (Release build)', cc_flags_default),
194      ('cc_flags_debug', 'C compiler flags to use (Debug build)', cc_flags_debug_default),
195      ('cxx_flags', 'C++ compiler flags to use (Release build)', cxx_flags_default),
196      ('cxx_flags_debug', 'C++ compiler flags to use (Debug build)', cxx_flags_debug_default),
197      ('ar_flags', 'Static library archiver flags to use', None),
198      ('sys_libs', 'System libraries to link with', None),
199      ('tar_flags','flags for zip files','-c -z'),
200    # MKL
201      PathOption('mkl_path', 'Path to MKL includes', None),
202      PathOption('mkl_lib_path', 'Path to MKL libs', None),
203      ('mkl_libs', 'MKL libraries to link with', None),
204    # SCSL
205      PathOption('scsl_path', 'Path to SCSL includes', None),
206      PathOption('scsl_lib_path', 'Path to SCSL libs', None),
207      ('scsl_libs', 'SCSL libraries to link with', None),
208      ('scsl_libs_MPI', 'SCSL libraries to link with for MPI build', None),
209    # UMFPACK
210      PathOption('ufc_path', 'Path to UFconfig includes', ufc_path_default),
211      PathOption('umf_path', 'Path to UMFPACK includes', umf_path_default),
212      PathOption('umf_lib_path', 'Path to UMFPACK libs', umf_lib_path_default),
213      ('umf_libs', 'UMFPACK libraries to link with', umf_libs_default),
214    # AMD (used by UMFPACK)
215      PathOption('amd_path', 'Path to AMD includes', amd_path_default),
216      PathOption('amd_lib_path', 'Path to AMD libs', amd_lib_path_default),
217      ('amd_libs', 'AMD libraries to link with', amd_libs_default),
218    # BLAS
219      PathOption('blas_path', 'Path to BLAS includes', None),
220      PathOption('blas_lib_path', 'Path to BLAS libs', None),
221      ('blas_libs', 'BLAS libraries to link with', None),
222    # netCDF
223      ('useNetCDF', 'switch on/off the usage of netCDF', useNetCDF_default),
224      PathOption('netCDF_path', 'Path to netCDF includes', netCDF_path_default),
225      PathOption('netCDF_lib_path', 'Path to netCDF libs', netCDF_lib_path_default),
226      ('netCDF_libs', 'netCDF C++ libraries to link with', netCDF_libs_default),
227    # Python
228    # locations of include files for python
229      PathOption('python_path', 'Path to Python includes', python_path_default),
230      PathOption('python_lib_path', 'Path to Python libs', python_lib_path_default),
231      ('python_libs', 'Python libraries to link with', python_libs_default),
232    # Boost
233      PathOption('boost_path', 'Path to Boost includes', boost_path_default),
234      PathOption('boost_libs_path', 'Path to Boost libs', boost_libs_path_default),
235      ('boost_libs', 'Boost libraries to link with', boost_libs_default),
236    # Doc building
237    #  PathOption('doxygen_path', 'Path to Doxygen executable', None),
238    #  PathOption('epydoc_path', 'Path to Epydoc executable', None),
239    # PAPI
240      PathOption('papi_path', 'Path to PAPI includes', None),
241      PathOption('papi_lib_path', 'Path to PAPI libs', None),
242      ('papi_libs', 'PAPI libraries to link with', None),
243    # MPI
244      BoolOption('useMPI', 'Compile parallel version using MPI', 'no'),
245    )
246    #=================================================================================================
247    #
248    #   Note: On the Altix the intel compilers are not automatically
249    #   detected by scons intelc.py script. The Altix has a different directory
250    #   path and in some locations the "modules" facility is used to support
251    #   multiple compiler versions. This forces the need to import the users PATH
252    #   environment which isn't the "scons way"
253    #   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)
254    #   FIXME: Perhaps a modification to intelc.py will allow better support for ia64 on altix
255    #
256    if IS_WINDOWS_PLATFORM:
257          env = Environment(tools = ['default', 'msvc'], options = opts)
258    else:
259       if os.uname()[4]=='ia64':
260          env = Environment(tools = ['default', 'intelc'], options = opts)
261          if env['CXX'] == 'icpc':
262             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
263       else:
264          env = Environment(tools = ['default'], options = opts)
265    Help(opts.GenerateHelpText(env))
266    #=================================================================================================
267    #
268    #     Initialise Scons Build Environment
269    #     check for user environment variables we are interested in
270    try:
271       python_path = os.environ['PYTHONPATH']
272       env['ENV']['PYTHONPATH'] = python_path
273    except KeyError:
274       python_path = ''
275    
276    try:
277       omp_num_threads = os.environ['OMP_NUM_THREADS']
278    except KeyError:
279       omp_num_threads = 1
280    env['ENV']['OMP_NUM_THREADS'] = omp_num_threads
281    
282    try:
283       env['ENV']['DISPLAY'] = os.environ['DISPLAY']
284    except KeyError:
285       pass
286    
287    try:
288       path = os.environ['PATH']
289       env['ENV']['PATH'] = path
290    except KeyError:
291       path = ''
292    try:
293       ld_library_path = os.environ['LD_LIBRARY_PATH']
294       env['ENV']['LD_LIBRARY_PATH'] = ld_library_path
295    except KeyError:
296       ld_library_path = ''
297    #==========================================================================
298    #
299    #    Add some customer builders
300    #
301    py_builder = Builder(action = scons_extensions.build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)
302    env.Append(BUILDERS = {'PyCompile' : py_builder});
303    
304  esysroot = Dir('#.')  if IS_WINDOWS_PLATFORM:
305  Export(["esysroot"])     runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', src_suffix='.exe', single_source=True)
306    else:
307       runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', single_source=True)
308    env.Append(BUILDERS = {'RunUnitTest' : runUnitTest_builder});
309    
310  #  runPyUnitTest_builder = Builder(action = scons_extensions.runPyUnitTest, suffix = '.passed', src_suffic='.py', single_source=True)
311  # call appropriate SConscripts  env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});
312    
313  target_scripts = ['tools/CppUnitTest/SConstruct',  # Convert the options which are held in environment variable into python variables for ease of handling and configure compilation options
314                    'tools/mmio/SConstruct',  try:
315                    'esysUtils/SConstruct',     incinstall = env['incinstall']
316                    'escript/SConstruct',     env.Append(CPPPATH = [incinstall,])
317                    'bruce/SConstruct',  except KeyError:
318                    'paso/SConstruct',     incinstall = None
319                    'finley/SConstruct']  try:
320       libinstall = env['libinstall']
321       env.Append(LIBPATH = [libinstall,]) # ksteube adds -L for building of libescript.so libfinley.so escriptcpp.so finleycpp.so
322       env.PrependENVPath('LD_LIBRARY_PATH', libinstall)
323       if env['PLATFORM'] == "win32":
324          env.PrependENVPath('PATH', libinstall)
325          env.PrependENVPath('PATH', env['boost_libs_path'])
326    except KeyError:
327       libinstall = None
328    try:
329       pyinstall = env['pyinstall']+'/esys' # all targets will install into pyinstall/esys but PYTHONPATH points at straight pyinstall so you go import esys.escript etc
330       env.PrependENVPath('PYTHONPATH', env['pyinstall'])
331    except KeyError:
332       pyinstall = None
333    try:
334       dodebug = env['dodebug']
335    except KeyError:
336       dodebug = None
337    try:
338       useMPI = env['useMPI']
339    except KeyError:
340       useMPI = None
341    try:
342       cc_defines = env['cc_defines']
343       env.Append(CPPDEFINES = cc_defines)
344    except KeyError:
345       pass
346    
347    if dodebug:
348      if useMPI:
349        try:
350          flags = env['cc_flags_debug_MPI']
351          env.Append(CCFLAGS = flags)
352        except KeyError:
353          pass
354      else:
355        try:
356          flags = env['cc_flags_debug']
357          env.Append(CCFLAGS = flags)
358        except KeyError:
359          pass
360    else:
361      if useMPI:
362       try:
363         flags = env['cc_flags_MPI']
364         env.Append(CCFLAGS = flags)
365       except KeyError:
366          pass
367      else:
368       try:
369          flags = env['cc_flags']
370          env.Append(CCFLAGS = flags)
371       except KeyError:
372          pass
373    if dodebug:
374       if useMPI:
375         try:
376            flags = env['cxx_flags_debug_MPI']
377            env.Append(CXXFLAGS = flags)
378         except KeyError:
379            pass
380       else:
381         try:
382            flags = env['cxx_flags_debug']
383            env.Append(CXXFLAGS = flags)
384         except KeyError:
385            pass
386    else:
387       if useMPI:
388         try:
389            flags = env['cxx_flags_MPI']
390            env.Append(CXXFLAGS = flags)
391         except KeyError:
392            pass
393       else:
394         try:
395            flags = env['cxx_flags']
396            env.Append(CXXFLAGS = flags)
397         except KeyError:
398            pass
399    try:
400       flags = env['ar_flags']
401       env.Append(ARFLAGS = flags)
402    except KeyError:
403       ar_flags = None
404    try:
405       sys_libs = env['sys_libs']
406    except KeyError:
407       sys_libs = []
408    
409    try:
410       tar_flags = env['tar_flags']
411       env.Replace(TARFLAGS = tar_flags)
412    except KeyError:
413       pass
414    
415    try:
416       includes = env['mkl_path']
417       env.Append(CPPPATH = [includes,])
418    except KeyError:
419       pass
420    
421    try:
422       lib_path = env['mkl_lib_path']
423       env.Append(LIBPATH = [lib_path,])
424    except KeyError:
425       pass
426    
427    if useMPI:
428       mkl_libs = []
429    else:
430       try:
431          mkl_libs = env['mkl_libs']
432       except KeyError:
433          mkl_libs = []
434    
435    try:
436       includes = env['scsl_path']
437       env.Append(CPPPATH = [includes,])
438    except KeyError:
439       pass
440    
441    try:
442       lib_path = env['scsl_lib_path']
443       env.Append(LIBPATH = [lib_path,])
444    except KeyError:
445       pass
446    
447    if useMPI:
448      try:
449        scsl_libs = env['scsl_libs_MPI']
450      except KeyError:
451        scsl_libs = []
452    else:
453      try:
454        scsl_libs = env['scsl_libs']
455      except KeyError:
456        scsl_libs = []
457    
458    try:
459       includes = env['umf_path']
460       env.Append(CPPPATH = [includes,])
461    except KeyError:
462       pass
463    
464    try:
465       lib_path = env['umf_lib_path']
466       env.Append(LIBPATH = [lib_path,])
467    except KeyError:
468       pass
469    
470    if useMPI:
471        umf_libs = []
472    else:
473       try:
474          umf_libs = env['umf_libs']
475       except KeyError:
476          umf_libs = []
477    
478    try:
479       includes = env['ufc_path']
480       env.Append(CPPPATH = [includes,])
481    except KeyError:
482       pass
483    
484    try:
485       includes = env['amd_path']
486       env.Append(CPPPATH = [includes,])
487    except KeyError:
488       pass
489    
490    try:
491       lib_path = env['amd_lib_path']
492       env.Append(LIBPATH = [lib_path,])
493    except KeyError:
494       pass
495    
496    if useMPI:
497        amd_libs = []
498    else:
499       try:
500          amd_libs = env['amd_libs']
501       except KeyError:
502          amd_libs = []
503    
504    try:
505       includes = env['blas_path']
506       env.Append(CPPPATH = [includes,])
507    except KeyError:
508       pass
509    
510    try:
511       lib_path = env['blas_lib_path']
512       env.Append(LIBPATH = [lib_path,])
513    except KeyError:
514       pass
515    
516    try:
517       blas_libs = env['blas_libs']
518    except KeyError:
519       blas_libs = []
520    
521    try:
522       useNetCDF = env['useNetCDF']
523    except KeyError:
524       useNetCDF = 'yes'
525       pass
526    
527    if not useNetCDF == 'yes':
528       print "Warning: Installation is not configured with netCDF. Some I/O function may not be available."
529      
530    if useNetCDF == 'yes':
531       try:
532          includes = env['netCDF_path']
533          env.Append(CPPPATH = [includes,])
534       except KeyError:
535          pass
536    
537       try:
538          lib_path = env['netCDF_lib_path']
539          if IS_WINDOWS_PLATFORM: env['ENV']['PATH']+=";"+lib_path
540          env.Append(LIBPATH = [ lib_path, ])
541       except KeyError:
542          pass
543    
544       try:
545          netCDF_libs = env['netCDF_libs']
546       except KeyError:
547          netCDF_libs = [ ]
548    else:
549       netCDF_libs=[ ]
550    
551  SConscript(target_scripts, duplicate=0)  try:
552       includes = env['boost_path']
553       env.Append(CPPPATH = [includes,])
554    except KeyError:
555       pass
556    try:
557       lib_path = env['boost_libs_path']
558       env.Append(LIBPATH = [lib_path,])
559    except KeyError:
560       pass
561    try:
562       boost_libs = env['boost_libs']
563    except KeyError:
564       boost_libs = None
565    try:
566       includes = env['python_path']
567       env.Append(CPPPATH = [includes,])
568    except KeyError:
569       pass
570    try:
571       lib_path = env['python_lib_path']
572       env.Append(LIBPATH = [lib_path,])
573    except KeyError:
574       pass
575    try:
576       python_libs = env['python_libs']
577    except KeyError:
578       python_libs = None
579    try:
580       doxygen_path = env['doxygen_path']
581    except KeyError:
582       doxygen_path = None
583    try:
584       epydoc_path = env['epydoc_path']
585    except KeyError:
586       epydoc_path = None
587    try:
588       includes = env['papi_path']
589       env.Append(CPPPATH = [includes,])
590    except KeyError:
591       pass
592    try:
593       lib_path = env['papi_lib_path']
594       env.Append(LIBPATH = [lib_path,])
595    except KeyError:
596       pass
597    try:
598       papi_libs = env['papi_libs']
599    except KeyError:
600       papi_libs = None
601    
602    
603    try:
604       src_zipfile = env.File(env['src_zipfile'])
605    except KeyError:
606       src_zipfile = None
607    try:
608       test_zipfile = env.File(env['test_zipfile'])
609    except KeyError:
610       test_zipfile = None
611    try:
612       examples_zipfile = env.File(env['examples_zipfile'])
613    except KeyError:
614       examples_zipfile = None
615    
616    try:
617       src_tarfile = env.File(env['src_tarfile'])
618    except KeyError:
619       src_tarfile = None
620    try:
621       test_tarfile = env.File(env['test_tarfile'])
622    except KeyError:
623       test_tarfile = None
624    try:
625       examples_tarfile = env.File(env['examples_tarfile'])
626    except KeyError:
627       examples_tarfile = None
628    
629    try:
630       guide_pdf = env.File(env['guide_pdf'])
631    except KeyError:
632       guide_pdf = None
633    
634    try:
635       guide_html_index = env.File('index.htm',env['guide_html'])
636    except KeyError:
637       guide_html_index = None
638    
639    try:
640       api_epydoc = env.Dir(env['api_epydoc'])
641    except KeyError:
642       api_epydoc = None
643    
644    # Zipgets
645    env.Default(libinstall)
646    env.Default(incinstall)
647    env.Default(pyinstall)
648    env.Alias('release_src',[ src_zipfile, src_tarfile ])
649    env.Alias('release_tests',[ test_zipfile, test_tarfile])
650    env.Alias('release_examples',[ examples_zipfile, examples_tarfile])
651    env.Alias('api_epydoc',api_epydoc)
652    env.Alias('guide_pdf', guide_pdf)
653    env.Alias('docs',[ 'release_examples', 'guide_pdf', guide_html_index, api_epydoc])
654    env.Alias('release', ['release_src', 'release_tests', 'docs'])
655    env.Alias('build_tests')    # target to build all C++ tests
656    env.Alias('build_py_tests') # target to build all python tests
657    env.Alias('build_all_tests', [ 'build_tests', 'build_py_tests' ] ) # target to build all python tests
658    env.Alias('run_tests', 'build_tests')   # target to run all C++ test
659    env.Alias('py_tests', 'build_py_tests') # taget to run all released python tests
660    env.Alias('all_tests', ['run_tests', 'py_tests']) # target to run all C++ and released python tests
661    
662    # Python install - esys __init__.py
663    init_target = env.Command(pyinstall+'/__init__.py', None, Touch('$TARGET'))
664    env.Alias(init_target)
665    
666    # Allow sconscripts to see the env
667    Export(["IS_WINDOWS_PLATFORM", "env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs", "netCDF_libs", "useNetCDF",
668        "boost_libs", "python_libs", "doxygen_path", "epydoc_path", "papi_libs",
669            "sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "examples_tarfile", "examples_zipfile",
670            "guide_pdf", "guide_html_index", "api_epydoc", "useMPI" ])
671    
672    # End initialisation section
673    # Begin configuration section
674    # adds this file and the scons option directore to the source tar
675    release_srcfiles=[env.File('SConstruct'),]+[ env.File(x) for x in glob.glob('scons/*.py') ]
676    release_testfiles=[env.File('README_TESTS'),]
677    env.Zip(src_zipfile, release_srcfiles)
678    env.Zip(test_zipfile, release_testfiles)
679    try:
680       env.Tar(src_tarfile, release_srcfiles)
681       env.Tar(test_tarfile, release_testfiles)
682    except AttributeError:
683       pass
684    # Insert new components to be build here
685    # FIXME: might be nice to replace this verbosity with a list of targets and some
686    # FIXME: nifty python to create the lengthy but very similar env.Sconscript lines
687    # Third Party libraries
688    env.SConscript(dirs = ['tools/CppUnitTest/src'], build_dir='build/$PLATFORM/tools/CppUnitTest', duplicate=0)
689    # C/C++ Libraries
690    env.SConscript(dirs = ['paso/src'], build_dir='build/$PLATFORM/paso', duplicate=0)
691    # bruce is removed for now as it doesn't really do anything
692    # env.SConscript(dirs = ['bruce/src'], build_dir='build/$PLATFORM/bruce', duplicate=0)
693    env.SConscript(dirs = ['escript/src'], build_dir='build/$PLATFORM/escript', duplicate=0)
694    env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)
695    env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)
696    env.SConscript(dirs = ['modellib/py_src'], build_dir='build/$PLATFORM/modellib', duplicate=0)
697    env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0)
698    env.SConscript(dirs = ['pyvisi/py_src'], build_dir='build/$PLATFORM/pyvisi', duplicate=0)
699    env.SConscript(dirs = ['pycad/py_src'], build_dir='build/$PLATFORM/pycad', duplicate=0)
700    
701    # added by Ben Cumming
702    env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)
703    #env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0)

Legend:
Removed from v.214  
changed lines
  Added in v.1163

  ViewVC Help
Powered by ViewVC 1.1.26