/[escript]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

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

revision 805 by gross, Thu Aug 10 06:09:02 2006 UTC revision 1028 by gross, Wed Mar 14 00:15:24 2007 UTC
# Line 1  Line 1 
1  #          Copyright 2006 by ACcESS MNRF                    #         Copyright 2006 by ACcESS MNRF
2  #                                                            #
3  #              http://www.access.edu.au                      #              http://www.access.edu.au
4  #       Primary Business: Queensland, Australia              #       Primary Business: Queensland, Australia
5  #  Licensed under the Open Software License version 3.0      #  Licensed under the Open Software License version 3.0
6  #     http://www.opensource.org/licenses/osl-3.0.php        #     http://www.opensource.org/licenses/osl-3.0.php
7  #                                                            #
8  #  #
9  #  #
10    
11  # top-level Scons configuration file for all esys13 modules  # top-level Scons configuration file for all esys13 modules
12  # Begin initialisation Section  # Begin initialisation Section
13  # all of this section just intialises default environments and helper  # all of this section just intialises default environments and helper
14  # scripts. You shouldn't need to modify this section.  # scripts. You shouldn't need to modify this section.
15  EnsureSConsVersion(0,96,91)  EnsureSConsVersion(0,96,91)
16  EnsurePythonVersion(2,3)  EnsurePythonVersion(2,3)
# Line 18  EnsurePythonVersion(2,3) Line 18  EnsurePythonVersion(2,3)
18  # import tools:  # import tools:
19  import glob  import glob
20  import sys, os  import sys, os
21    import socket
22  # Add our extensions  # Add our extensions
23  if sys.path.count('scons')==0: sys.path.append('scons')  if sys.path.count('scons')==0: sys.path.append('scons')
24  import scons_extensions  import scons_extensions
25    
26  # check if UMFPACK is installed on the system:  # check if UMFPACK is installed on the system:
27  if os.path.isdir('/opt/UMFPACK/Include') and os.path.isdir('/opt/UMFPACK/Lib') and os.path.isdir('/opt/AMD/Lib'):  if os.path.isdir('/opt/UMFPACK/Include') and os.path.isdir('/opt/UMFPACK/Lib'):
28     umf_path_default='/opt/UMFPACK/Include'     umf_path_default='/opt/UMFPACK/Include'
29     umf_lib_path_default='/opt/UMFPACK/Lib'     umf_lib_path_default='/opt/UMFPACK/Lib'
30     amd_lib_path_default='/opt/AMD/Lib'     umf_libs_default=['umfpack']
    umf_libs_default=['amd', 'umfpack']  
31  else:  else:
32     umf_path_default=None     umf_path_default=None
33     umf_lib_path_default=None     umf_lib_path_default=None
    amd_lib_path_default=None  
34     umf_libs_default=None     umf_libs_default=None
35  if os.path.isdir('/opt/GotoBLAS'):  
36     blas_path_default='/opt/GotoBLAS'  if os.path.isdir('/opt/AMD/Include') and os.path.isdir('/opt/AMD/Lib'):
37     blas_lib_path_default='/opt/GotoBLAS'     amd_path_default='/opt/AMD/Include'
38     blas_libs_default=['goto',]     amd_lib_path_default='/opt/AMD/Lib'
39  else:     amd_libs_default=['amd']
40     blas_path_default=None  else:
41     blas_lib_path_default=None     amd_path_default=None
42     blas_libs_default=None     amd_lib_path_default=None
43       amd_libs_default=None
44    
45    if os.path.isdir('/opt/UFconfig'):
46       ufc_path_default='/opt/UFconfig'
47    else:
48       ufc_path_default=None
49    
50    if os.path.isdir('/usr/local/include') and os.path.isdir('/usr/local/lib'):
51      netCDF_path_default='/usr/local/include'
52      netCDF_lib_path_default='/usr/local/lib'
53      netCDF_libs_cxx_default=[ 'netcdf_c++', 'netcdf']
54    else:
55      netCDF_path_default=None
56      netCDF_lib_path_default=None
57      netCDF_libs_cxx_default=None
58  # Default options and options help text  # Default options and options help text
59  # 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.
60  # if the options_file or ARGUMENTS do not exist then the ones listed as default here are used  # if the options_file or ARGUMENTS do not exist then the ones listed as default here are used
# Line 48  else: Line 62  else:
62  if ARGUMENTS.get('options_file',0):  if ARGUMENTS.get('options_file',0):
63     options_file = ARGUMENTS.get('options_file',0)     options_file = ARGUMENTS.get('options_file',0)
64  else:  else:
    import socket  
65     from string import ascii_letters,digits     from string import ascii_letters,digits
66     hostname=""     hostname=""
67     for s in socket.gethostname().split('.')[0]:     for s in socket.gethostname().split('.')[0]:
# Line 57  else: Line 70  else:
70        else:        else:
71           hostname+="_"           hostname+="_"
72     options_file = "scons/"+hostname+"_options.py"     options_file = "scons/"+hostname+"_options.py"
73    if os.path.isfile(options_file):
74       print "option file is ",options_file,"."
75    else:
76       print "option file is ",options_file, "(not present)."
77    
78  opts = Options(options_file, ARGUMENTS)  opts = Options(options_file, ARGUMENTS)
79  opts.AddOptions(  opts.AddOptions(
80  # Where to install esys stuff  # Where to install esys stuff
81    ('incinstall', 'where the esys headers will be installed', Dir('#.').abspath+'/include'),    ('incinstall', 'where the esys headers will be installed', Dir('#.').abspath+'/include'),
82    ('libinstall', 'where the esys libraries will be installed', Dir('#.').abspath+'/lib'),    ('libinstall', 'where the esys libraries will be installed', Dir('#.').abspath+'/lib'),
83    ('pyinstall', 'where the esys python modules will be installed', Dir('#.').abspath),    ('pyinstall', 'where the esys python modules will be installed', Dir('#.').abspath),
84    ('src_zipfile', 'the source zip file will be installed.', Dir('#.').abspath+"/release/escript_src.zip"),    ('src_zipfile', 'the source zip file will be installed.', Dir('#.').abspath+"/release/escript_src.zip"),
85    ('test_zipfile', 'the test zip file will be installed.', Dir('#.').abspath+"/release/escript_tests.zip"),    ('test_zipfile', 'the test zip file will be installed.', Dir('#.').abspath+"/release/escript_tests.zip"),
86    ('src_tarfile', 'the source tar file will be installed.', Dir('#.').abspath+"/release/escript_src.tar.gz"),    ('src_tarfile', 'the source tar file will be installed.', Dir('#.').abspath+"/release/escript_src.tar.gz"),
87    ('test_tarfile', 'the test tar file will be installed.', Dir('#.').abspath+"/release/escript_tests.tar.gz"),    ('test_tarfile', 'the test tar file will be installed.', Dir('#.').abspath+"/release/escript_tests.tar.gz"),
88    ('examples_tarfile', 'the examples tar file will be installed.', Dir('#.').abspath+"/release/doc/escript_examples.tar.gz"),    ('examples_tarfile', 'the examples tar file will be installed.', Dir('#.').abspath+"/release/doc/escript_examples.tar.gz"),
89    ('examples_zipfile', 'the examples zip file will be installed.', Dir('#.').abspath+"/release/doc/escript_examples.zip"),    ('examples_zipfile', 'the examples zip file will be installed.', Dir('#.').abspath+"/release/doc/escript_examples.zip"),
90    ('guide_pdf', 'name of the user guide in pdf format', Dir('#.').abspath+"/release/doc/user/guide.pdf"),    ('guide_pdf', 'name of the user guide in pdf format', Dir('#.').abspath+"/release/doc/user/guide.pdf"),
91    ('api_epydoc', 'name of the epydoc api docs directory',Dir('#.').abspath+"/release/doc/epydoc"),    ('api_epydoc', 'name of the epydoc api docs directory',Dir('#.').abspath+"/release/doc/epydoc"),
92    ('guide_html', 'name of the directory for user guide in html format', Dir('#.').abspath+"/release/doc/user/html"),    ('guide_html', 'name of the directory for user guide in html format', Dir('#.').abspath+"/release/doc/user/html"),
93  # Compilation options  # Compilation options
94    BoolOption('dodebug', 'Do you want a debug build?', 'no'),    BoolOption('dodebug', 'Do you want a debug build?', 'no'),
95    ('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),
96    ('cc_defines','C/C++ defines to use', None),    ('cc_defines','C/C++ defines to use', None),
97    ('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)', '-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas -ansi -pedantic-errors'),
98    ('cc_flags_debug', 'C compiler flags to use (Debug build)', '-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas'),    ('cc_flags_debug', 'C compiler flags to use (Debug build)', '-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas -ansi -pedantic-errors'),
99    ('cxx_flags', 'C++ compiler flags to use (Release build)', '--no-warn -ansi'),    ('cxx_flags', 'C++ compiler flags to use (Release build)', '--no-warn -ansi'),
100    ('cxx_flags_debug', 'C++ compiler flags to use (Debug build)', '--no-warn -ansi -DDOASSERT -DDOPROF'),    ('cxx_flags_debug', 'C++ compiler flags to use (Debug build)', '--no-warn -ansi -DDOASSERT -DDOPROF'),
101    ('cc_flags_MPI','C compiler flags to use (Release MPI build)', '-O3 -ftz -IPF_ftlacc- -IPF_fma -fno-alias -fno-alias -c99 -w1 -fpic -wd161'),    ('cc_flags_MPI','C compiler flags to use (Release MPI build)', '-O3 -ftz -IPF_ftlacc- -IPF_fma -fno-alias -fno-alias -c99 -w1 -fpic -wd161'),
# Line 89  opts.AddOptions( Line 106  opts.AddOptions(
106    ('sys_libs', 'System libraries to link with', None),    ('sys_libs', 'System libraries to link with', None),
107    ('tar_flags','flags for zip files','-c -z'),    ('tar_flags','flags for zip files','-c -z'),
108  # MKL  # MKL
109    PathOption('mkl_path', 'Path to MKL includes', None),    PathOption('mkl_path', 'Path to MKL includes', None),
110    PathOption('mkl_lib_path', 'Path to MKL libs', None),    PathOption('mkl_lib_path', 'Path to MKL libs', None),
111    ('mkl_libs', 'MKL libraries to link with', None),    ('mkl_libs', 'MKL libraries to link with', None),
112  # SCSL  # SCSL
113    PathOption('scsl_path', 'Path to SCSL includes', None),    PathOption('scsl_path', 'Path to SCSL includes', None),
114    PathOption('scsl_lib_path', 'Path to SCSL libs', None),    PathOption('scsl_lib_path', 'Path to SCSL libs', None),
115    ('scsl_libs', 'SCSL libraries to link with', None),    ('scsl_libs', 'SCSL libraries to link with', None),
116    ('scsl_libs_MPI', 'SCSL libraries to link with for MPI build', None),    ('scsl_libs_MPI', 'SCSL libraries to link with for MPI build', None),
117  # UMFPACK  # UMFPACK
118    PathOption('umf_path', 'Path to UMF includes', umf_path_default),    PathOption('ufc_path', 'Path to UFconfig includes', ufc_path_default),
119    PathOption('umf_lib_path', 'Path to UMF libs', umf_lib_path_default),    PathOption('umf_path', 'Path to UMFPACK includes', umf_path_default),
120    PathOption('amd_lib_path', 'Path to UMF libs', amd_lib_path_default),    PathOption('umf_lib_path', 'Path to UMFPACK libs', umf_lib_path_default),
121    ('umf_libs', 'UMF libraries to link with', umf_libs_default),    ('umf_libs', 'UMFPACK libraries to link with', umf_libs_default),
122    # AMD (used by UMFPACK)
123      PathOption('amd_path', 'Path to AMD includes', amd_path_default),
124      PathOption('amd_lib_path', 'Path to AMD libs', amd_lib_path_default),
125      ('amd_libs', 'AMD libraries to link with', amd_libs_default),
126  # BLAS  # BLAS
127    PathOption('blas_path', 'Path to BLAS includes', blas_path_default),    PathOption('blas_path', 'Path to BLAS includes', None),
128    PathOption('blas_lib_path', 'Path to BLAS libs', blas_lib_path_default ),    PathOption('blas_lib_path', 'Path to BLAS libs', None),
129    ('blas_libs', 'BLAS libraries to link with', blas_libs_default ),    ('blas_libs', 'BLAS libraries to link with', None),
130    # netCDF
131      ('useNetCDF', 'switch on/off the usage of netCDF', 'yes'),
132      PathOption('netCDF_path', 'Path to netCDF includes', netCDF_path_default),
133      PathOption('netCDF_lib_path', 'Path to netCDF libs', netCDF_lib_path_default),
134      ('netCDF_libs_cxx', 'netCDF C++ libraries to link with', netCDF_libs_cxx_default),
135  # Python  # Python
136  # locations of include files for python  # locations of include files for python
137    PathOption('python_path', 'Path to Python includes', '/usr/include/python%s.%s'%(sys.version_info[0],sys.version_info[1])),    PathOption('python_path', 'Path to Python includes', '/usr/include/python%s.%s'%(sys.version_info[0],sys.version_info[1])),
138    PathOption('python_lib_path', 'Path to Python libs', '/usr/lib'),    PathOption('python_lib_path', 'Path to Python libs', '/usr/lib'),
139    ('python_lib', 'Python libraries to link with', ["python%s.%s"%(sys.version_info[0],sys.version_info[1]),]),    ('python_lib', 'Python libraries to link with', ["python%s.%s"%(sys.version_info[0],sys.version_info[1]),]),
140  # Boost  # Boost
141    PathOption('boost_path', 'Path to Boost includes', '/usr/include'),    PathOption('boost_path', 'Path to Boost includes', '/usr/include'),
142    PathOption('boost_lib_path', 'Path to Boost libs', '/usr/lib'),    PathOption('boost_lib_path', 'Path to Boost libs', '/usr/lib'),
143    ('boost_lib', 'Boost libraries to link with', ['boost_python',]),    ('boost_lib', 'Boost libraries to link with', ['boost_python',]),
144  # Doc building  # Doc building
145  #  PathOption('doxygen_path', 'Path to Doxygen executable', None),  #  PathOption('doxygen_path', 'Path to Doxygen executable', None),
146  #  PathOption('epydoc_path', 'Path to Epydoc executable', None),  #  PathOption('epydoc_path', 'Path to Epydoc executable', None),
147  # PAPI  # PAPI
148    PathOption('papi_path', 'Path to PAPI includes', None),    PathOption('papi_path', 'Path to PAPI includes', None),
149    PathOption('papi_lib_path', 'Path to PAPI libs', None),    PathOption('papi_lib_path', 'Path to PAPI libs', None),
150    ('papi_libs', 'PAPI libraries to link with', None),    ('papi_libs', 'PAPI libraries to link with', None),
151  # MPI  # MPI
152    BoolOption('useMPI', 'Compile parallel version using MPI', 'no'),    BoolOption('useMPI', 'Compile parallel version using MPI', 'no'),
153  )  )
154    # Note: On the Altix the intel compilers are not automatically
155    # detected by scons intelc.py script. The Altix has a different directory
156    # path and in some locations the "modules" facility is used to support
157    # multiple compiler versions. This forces the need to import the users PATH
158    # environment which isn't the "scons way"
159    # 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)
160    # FIXME: Perhaps a modification to intelc.py will allow better support for ia64 on altix
161    
162    if os.name != "nt" and os.uname()[4]=='ia64':
163       env = Environment(tools = ['default', 'intelc'], options = opts)
164       if env['CXX'] == 'icpc':
165          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
166    elif os.name == "nt":
167       env = Environment(tools = ['default', 'msvc'], options = opts)
168    else:
169       env = Environment(tools = ['default'], options = opts)
170  # Initialise Scons Build Environment  # Initialise Scons Build Environment
171  # check for user environment variables we are interested in  # check for user environment variables we are interested in
172  try:  try:
173     python_path = os.environ['PYTHONPATH']     python_path = os.environ['PYTHONPATH']
174       env['ENV']['PYTHONPATH'] = python_path
175  except KeyError:  except KeyError:
176     python_path = ''     python_path = ''
177    
178  try:  try:
179     path = os.environ['PATH']     path = os.environ['PATH']
180       env['ENV']['PATH'] = path
181  except KeyError:  except KeyError:
182     path = ''     path = ''
183  try:  try:
184     ld_library_path = os.environ['LD_LIBRARY_PATH']     ld_library_path = os.environ['LD_LIBRARY_PATH']
185       env['ENV']['LD_LIBRARY_PATH'] = ld_library_path
186  except KeyError:  except KeyError:
187     ld_library_path = ''     ld_library_path = ''
188    
 # 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":  
    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  
189    
190  # Setup help for options  # Setup help for options
191  Help(opts.GenerateHelpText(env))  Help(opts.GenerateHelpText(env))
# Line 186  try: Line 208  try:
208     incinstall = env['incinstall']     incinstall = env['incinstall']
209     env.Append(CPPPATH = [incinstall,])     env.Append(CPPPATH = [incinstall,])
210  except KeyError:  except KeyError:
211     incinstall = None       incinstall = None
212  try:  try:
213     libinstall = env['libinstall']     libinstall = env['libinstall']
214     env.Append(LIBPATH = [libinstall,])     env.Append(LIBPATH = [libinstall,])
# Line 195  try: Line 217  try:
217        env.PrependENVPath('PATH', libinstall)        env.PrependENVPath('PATH', libinstall)
218        env.PrependENVPath('PATH', env['boost_lib_path'])        env.PrependENVPath('PATH', env['boost_lib_path'])
219  except KeyError:  except KeyError:
220     libinstall = None       libinstall = None
221  try:  try:
222     pyinstall = env['pyinstall']+'/esys' # all targets will install into pyinstall/esys but PYTHONPATH points at straight pyinstall so you go import esys.escript etc     pyinstall = env['pyinstall']+'/esys' # all targets will install into pyinstall/esys but PYTHONPATH points at straight pyinstall so you go import esys.escript etc
223     env.PrependENVPath('PYTHONPATH', env['pyinstall'])     env.PrependENVPath('PYTHONPATH', env['pyinstall'])
224  except KeyError:  except KeyError:
225     pyinstall = None       pyinstall = None
226  try:  try:
227     dodebug = env['dodebug']     dodebug = env['dodebug']
228  except KeyError:  except KeyError:
229     dodebug = None       dodebug = None
230  try:  try:
231     useMPI = env['useMPI']     useMPI = env['useMPI']
232  except KeyError:  except KeyError:
233     useMPI = None       useMPI = None
234  try:  try:
235     cc_defines = env['cc_defines']     cc_defines = env['cc_defines']
236     env.Append(CPPDEFINES = cc_defines)     env.Append(CPPDEFINES = cc_defines)
237  except KeyError:  except KeyError:
238     pass     pass
239    
240    if 'shake71' == socket.gethostname().split('.')[0]:
241      if useMPI:
242        env['CC'] = 'mpicc'
243        env['CXX'] = 'mpiCC'
244    
245  if dodebug:  if dodebug:
246    if useMPI:    if useMPI:
247      try:      try:
# Line 221  if dodebug: Line 249  if dodebug:
249        env.Append(CCFLAGS = flags)        env.Append(CCFLAGS = flags)
250      except KeyError:      except KeyError:
251        pass        pass
252    else:                          else:
253      try:      try:
254        flags = env['cc_flags_debug']        flags = env['cc_flags_debug']
255        env.Append(CCFLAGS = flags)        env.Append(CCFLAGS = flags)
# Line 270  try: Line 298  try:
298     flags = env['ar_flags']     flags = env['ar_flags']
299     env.Append(ARFLAGS = flags)     env.Append(ARFLAGS = flags)
300  except KeyError:  except KeyError:
301     ar_flags = None       ar_flags = None
302  try:  try:
303     sys_libs = env['sys_libs']     sys_libs = env['sys_libs']
304  except KeyError:  except KeyError:
305     sys_libs = ''     sys_libs = ''
306    
307  try:  try:
308     tar_flags = env['tar_flags']     tar_flags = env['tar_flags']
# Line 294  try: Line 322  try:
322  except KeyError:  except KeyError:
323     pass     pass
324    
325  try:  if useMPI:
    mkl_libs = env['mkl_libs']  
 except KeyError:  
326     mkl_libs = ''     mkl_libs = ''
327    else:
328       try:
329          mkl_libs = env['mkl_libs']
330       except KeyError:
331          mkl_libs = ''
332    
333  try:  try:
334     includes = env['scsl_path']     includes = env['scsl_path']
335     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
336  except KeyError:  except KeyError:
337     pass     pass
338    
339  try:  try:
340     lib_path = env['scsl_lib_path']     lib_path = env['scsl_lib_path']
341     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
342  except KeyError:  except KeyError:
343     pass     pass
344  if useMPI:    
345    if useMPI:
346    try:    try:
347      scsl_libs = env['scsl_libs_MPI']      scsl_libs = env['scsl_libs_MPI']
348    except KeyError:    except KeyError:
349      scsl_libs = ''      scsl_libs = ''
350  else:          else:
351    try:    try:
352      scsl_libs = env['scsl_libs']      scsl_libs = env['scsl_libs']
353    except KeyError:    except KeyError:
# Line 331  try: Line 365  try:
365  except KeyError:  except KeyError:
366     pass     pass
367    
368    if useMPI:
369        umf_libs = ''
370    else:
371       try:
372          umf_libs = env['umf_libs']
373       except KeyError:
374          umf_libs = ''
375    
376    try:
377       includes = env['ufc_path']
378       env.Append(CPPPATH = [includes,])
379    except KeyError:
380       pass
381    
382  try:  try:
383     lib_path = env['amd_lib_path']     includes = env['amd_path']
384     env.Append(LIBPATH = [lib_path,])     env.Append(CPPPATH = [includes,])
385  except KeyError:  except KeyError:
386     pass     pass
387    
388  try:  try:
389     umf_libs = env['umf_libs']     lib_path = env['amd_lib_path']
390       env.Append(LIBPATH = [lib_path,])
391  except KeyError:  except KeyError:
392     umf_libs = ''     pass
393    
394    if useMPI:
395        amd_libs = ''
396    else:
397       try:
398          amd_libs = env['amd_libs']
399       except KeyError:
400          amd_libs = ''
401    
402  try:  try:
403     includes = env['blas_path']     includes = env['blas_path']
404     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
405  except KeyError:  except KeyError:
406     pass     pass
407    
408  try:  try:
409     lib_path = env['blas_lib_path']     lib_path = env['blas_lib_path']
410     env.Append(LIBPATH = [lib_path,])     env.Append(LIBPATH = [lib_path,])
411  except KeyError:  except KeyError:
412     pass     pass
413    
414  try:  try:
415     blas_libs = env['blas_libs']     blas_libs = env['blas_libs']
416  except KeyError:  except KeyError:
417     blas_libs = ''     blas_libs = ''
418    
419  try:  try:
420       useNetCDF = env['useNetCDF']
421    except KeyError:
422       useNetCDF = 'yes'
423       pass
424    
425    if not useNetCDF == 'yes':
426       print "Warning: Installation is not configured with netCDF. Some I/O function may not be available."
427      
428    if useNetCDF == 'yes':
429       try:
430          includes = env['netCDF_path']
431          env.Append(CPPPATH = [includes,])
432       except KeyError:
433          pass
434    
435       try:
436          lib_path = env['netCDF_lib_path']
437          env.Append(LIBPATH = [lib_path,])
438       except KeyError:
439          pass
440    
441       try:
442          netCDF_libs_cxx = env['netCDF_libs_cxx']
443       except KeyError:
444          netCDF_libs_cxx = [ ]
445    else:
446       netCDF_libs_cxx=[ ]
447    
448    try:
449     includes = env['boost_path']     includes = env['boost_path']
450     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
451  except KeyError:  except KeyError:
# Line 370  except KeyError: Line 458  except KeyError:
458  try:  try:
459     boost_lib = env['boost_lib']     boost_lib = env['boost_lib']
460  except KeyError:  except KeyError:
461     boost_lib = None       boost_lib = None
462  try:  try:
463     includes = env['python_path']     includes = env['python_path']
464     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
# Line 384  except KeyError: Line 472  except KeyError:
472  try:  try:
473     python_lib = env['python_lib']     python_lib = env['python_lib']
474  except KeyError:  except KeyError:
475     python_lib = None       python_lib = None
476  try:  try:
477     doxygen_path = env['doxygen_path']     doxygen_path = env['doxygen_path']
478  except KeyError:  except KeyError:
479     doxygen_path = None       doxygen_path = None
480  try:  try:
481     epydoc_path = env['epydoc_path']     epydoc_path = env['epydoc_path']
482  except KeyError:  except KeyError:
483     epydoc_path = None       epydoc_path = None
484  try:  try:
485     includes = env['papi_path']     includes = env['papi_path']
486     env.Append(CPPPATH = [includes,])     env.Append(CPPPATH = [includes,])
# Line 406  except KeyError: Line 494  except KeyError:
494  try:  try:
495     papi_libs = env['papi_libs']     papi_libs = env['papi_libs']
496  except KeyError:  except KeyError:
497     papi_libs = None       papi_libs = None
498    
499    
500  try:  try:
501     src_zipfile = env.File(env['src_zipfile'])     src_zipfile = env.File(env['src_zipfile'])
502  except KeyError:  except KeyError:
503     src_zipfile = None       src_zipfile = None
504  try:  try:
505     test_zipfile = env.File(env['test_zipfile'])     test_zipfile = env.File(env['test_zipfile'])
506  except KeyError:  except KeyError:
507     test_zipfile = None       test_zipfile = None
508  try:  try:
509     examples_zipfile = env.File(env['examples_zipfile'])     examples_zipfile = env.File(env['examples_zipfile'])
510  except KeyError:  except KeyError:
511     examples_zipfile = None       examples_zipfile = None
512    
513  try:  try:
514     src_tarfile = env.File(env['src_tarfile'])     src_tarfile = env.File(env['src_tarfile'])
515  except KeyError:  except KeyError:
516     src_tarfile = None       src_tarfile = None
517  try:  try:
518     test_tarfile = env.File(env['test_tarfile'])     test_tarfile = env.File(env['test_tarfile'])
519  except KeyError:  except KeyError:
520     test_tarfile = None       test_tarfile = None
521  try:  try:
522     examples_tarfile = env.File(env['examples_tarfile'])     examples_tarfile = env.File(env['examples_tarfile'])
523  except KeyError:  except KeyError:
524     examples_tarfile = None       examples_tarfile = None
525    
526  try:  try:
527     guide_pdf = env.File(env['guide_pdf'])     guide_pdf = env.File(env['guide_pdf'])
528  except KeyError:  except KeyError:
529     guide_pdf = None       guide_pdf = None
530    
531  try:  try:
532     guide_html_index = env.File('index.htm',env['guide_html'])     guide_html_index = env.File('index.htm',env['guide_html'])
533  except KeyError:  except KeyError:
534     guide_html_index = None       guide_html_index = None
535    
536  try:  try:
537     api_epydoc = env.Dir(env['api_epydoc'])     api_epydoc = env.Dir(env['api_epydoc'])
538  except KeyError:  except KeyError:
539     api_epydoc = None       api_epydoc = None
540    
541  # Zipgets  # Zipgets
542      
543  env.Default(libinstall)  env.Default(libinstall)
544  env.Default(incinstall)  env.Default(incinstall)
545  env.Default(pyinstall)  env.Default(pyinstall)
546  env.Alias('release_src',[ src_zipfile, src_tarfile ])    env.Alias('release_src',[ src_zipfile, src_tarfile ])
547  env.Alias('release_tests',[ test_zipfile, test_tarfile])  env.Alias('release_tests',[ test_zipfile, test_tarfile])
548  env.Alias('release_examples',[ examples_zipfile, examples_tarfile])  env.Alias('release_examples',[ examples_zipfile, examples_tarfile])
549  env.Alias('api_epydoc',api_epydoc)  env.Alias('api_epydoc',api_epydoc)
550  env.Alias('docs',[ 'release_examples', guide_pdf, guide_html_index, api_epydoc])  env.Alias('guide_pdf', guide_pdf)
551    env.Alias('docs',[ 'release_examples', 'guide_pdf', guide_html_index, api_epydoc])
552  env.Alias('release', ['release_src', 'release_tests', 'docs'])  env.Alias('release', ['release_src', 'release_tests', 'docs'])
553  env.Alias('build_tests')    # target to build all C++ tests  env.Alias('build_tests')    # target to build all C++ tests
554  env.Alias('build_py_tests') # target to build all python tests  env.Alias('build_py_tests') # target to build all python tests
# Line 473  init_target = env.Command(pyinstall+'/__ Line 562  init_target = env.Command(pyinstall+'/__
562  env.Alias(init_target)  env.Alias(init_target)
563    
564  # Allow sconscripts to see the env  # Allow sconscripts to see the env
565  Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs",  Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs", "netCDF_libs_cxx", "useNetCDF",
566      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs",      "boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs",
567          "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",
568          "guide_pdf", "guide_html_index", "api_epydoc", "useMPI"])          "guide_pdf", "guide_html_index", "api_epydoc", "useMPI"])
569    
# Line 495  env.Tar(test_tarfile, release_testfiles) Line 584  env.Tar(test_tarfile, release_testfiles)
584  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)
585  # C/C++ Libraries  # C/C++ Libraries
586  env.SConscript(dirs = ['paso/src'], build_dir='build/$PLATFORM/paso', duplicate=0)  env.SConscript(dirs = ['paso/src'], build_dir='build/$PLATFORM/paso', duplicate=0)
587  env.SConscript(dirs = ['bruce/src'], build_dir='build/$PLATFORM/bruce', duplicate=0)  # bruce is removed for now as it doesn't really do anything
588    # env.SConscript(dirs = ['bruce/src'], build_dir='build/$PLATFORM/bruce', duplicate=0)
589  env.SConscript(dirs = ['escript/src'], build_dir='build/$PLATFORM/escript', duplicate=0)  env.SConscript(dirs = ['escript/src'], build_dir='build/$PLATFORM/escript', duplicate=0)
590  env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)  env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)
591  env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)  env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)
592  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)
593  env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0)  env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0)
594  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)
595    env.SConscript(dirs = ['pycad/py_src'], build_dir='build/$PLATFORM/pycad', duplicate=0)
596    
597  # added by Ben Cumming  # added by Ben Cumming
598  env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)  env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)
599  #env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0)  #env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0)

Legend:
Removed from v.805  
changed lines
  Added in v.1028

  ViewVC Help
Powered by ViewVC 1.1.26