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

Annotation of /branches/schroedinger_upto1946/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1185 - (hide annotations)
Thu May 31 04:33:31 2007 UTC (11 years, 3 months ago) by gross
Original Path: trunk/SConstruct
File size: 24206 byte(s)
once again: some changes to get the tests passed on windows.
1 jongui 961 # Copyright 2006 by ACcESS MNRF
2 jgs 214 #
3 matt 863 # 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 jgs 455
8 robwdcock 682 # top-level Scons configuration file for all esys13 modules
9     # Begin initialisation Section
10 matt 863 # all of this section just intialises default environments and helper
11 robwdcock 682 # scripts. You shouldn't need to modify this section.
12     EnsureSConsVersion(0,96,91)
13     EnsurePythonVersion(2,3)
14 jgs 214
15 gross 1133 #===============================================================
16     # import tools:
17 gross 700 import glob
18 robwdcock 682 import sys, os
19 matt 863 import socket
20 robwdcock 682 # Add our extensions
21     if sys.path.count('scons')==0: sys.path.append('scons')
22     import scons_extensions
23 jgs 192
24 gross 1133 #===============================================================
25     # check on windows or linux platform
26     #
27     IS_WINDOWS_PLATFORM = (os.name== "nt")
28 gross 806
29 gross 1133 if IS_WINDOWS_PLATFORM:
30     tools_prefix="C:\\Program Files\\"
31 gross 805 else:
32 gross 1149 tools_prefix="/usr"
33 gross 806
34 gross 1133 #==============================================================================================
35     #
36     # get the iinstallation prefix
37     #
38     prefix = ARGUMENTS.get('prefix', Dir('#.').abspath)
39     print "Install prefix is: ", prefix
40 gross 806
41 robwdcock 682 # Default options and options help text
42     # 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 ksteube 1083 # Where to install?
46 gross 1133 #==============================================================================================
47     #
48     # get the options file if present:
49     #
50 robwdcock 682 if ARGUMENTS.get('options_file',0):
51     options_file = ARGUMENTS.get('options_file',0)
52     else:
53     from string import ascii_letters,digits
54     hostname=""
55     for s in socket.gethostname().split('.')[0]:
56     if s in ascii_letters+digits:
57     hostname+=s
58     else:
59     hostname+="_"
60 gross 1141 options_file = os.path.join("scons",hostname+"_options.py")
61 gross 1133
62 gross 1028 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 gross 1133 # and load it
67     opts = Options(options_file, ARGUMENTS)
68     #================================================================
69     #
70     # check if UMFPACK is installed on the system:
71     #
72 gross 1149 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 gross 1133 else:
87 gross 1149 umf_path_default=None
88     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 gross 1133 #==========================================================================
96     #
97     # python installation:
98     #
99     if IS_WINDOWS_PLATFORM:
100 gross 1149 python_path_default=os.path.join(tools_prefix,'python%s%s'%(sys.version_info[0],sys.version_info[1]),"include")
101 gross 1185 python_lib_path_default=os.path.join(tools_prefix,'python%s%s'%(sys.version_info[0],sys.version_info[1]),"libs")
102 gross 1133 python_libs_default=["python%s%s"%(sys.version_info[0],sys.version_info[1])]
103     else:
104 gross 1149 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 gross 1133 python_libs_default=["python%s.%s"%(sys.version_info[0],sys.version_info[1])]
107 gross 1149
108 gross 1133 #==========================================================================
109     #
110     # boost installation:
111     #
112     if IS_WINDOWS_PLATFORM:
113 gross 1149 boost_libs_path_default=os.path.join(tools_prefix,'boost','lib')
114 gross 1133 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 gross 1149 boost_path_default=os.path.join(tools_prefix,'boost','include','boost-%s'%(boost_libs_default[0].split("-")[-1],))
123 gross 1133 else:
124 gross 1149 boost_path_default=os.path.join(tools_prefix,'include')
125     boost_libs_path_default=os.path.join(tools_prefix,'lib')
126 gross 1133 boost_libs_default=['boost_python']
127     #==========================================================================
128     #
129     # check if netCDF is installed on the system:
130     #
131 gross 1149 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 gross 1141 useNetCDF_default='no' # be default netcdf is not supported on windows.
150 gross 1133 #==========================================================================
151     #
152     # 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 gross 1141 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 gross 1133 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 robwdcock 682 opts.AddOptions(
176     # Where to install esys stuff
177 ksteube 1083 ('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 robwdcock 682 # Compilation options
190 gross 700 BoolOption('dodebug', 'Do you want a debug build?', 'no'),
191 gross 1133 ('options_file', "Optional file containing preferred options. Ignored if it doesn't exist (default: scons/<hostname>_options.py)", options_file),
192 robwdcock 682 ('cc_defines','C/C++ defines to use', None),
193 gross 1133 ('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 robwdcock 682 ('ar_flags', 'Static library archiver flags to use', None),
198     ('sys_libs', 'System libraries to link with', None),
199 gross 700 ('tar_flags','flags for zip files','-c -z'),
200 robwdcock 682 # MKL
201 matt 863 PathOption('mkl_path', 'Path to MKL includes', None),
202     PathOption('mkl_lib_path', 'Path to MKL libs', None),
203 robwdcock 682 ('mkl_libs', 'MKL libraries to link with', None),
204     # SCSL
205 matt 863 PathOption('scsl_path', 'Path to SCSL includes', None),
206     PathOption('scsl_lib_path', 'Path to SCSL libs', None),
207 robwdcock 682 ('scsl_libs', 'SCSL libraries to link with', None),
208 bcumming 759 ('scsl_libs_MPI', 'SCSL libraries to link with for MPI build', None),
209 matt 863 # 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 gross 806 ('umf_libs', 'UMFPACK libraries to link with', umf_libs_default),
214     # AMD (used by UMFPACK)
215 matt 863 PathOption('amd_path', 'Path to AMD includes', amd_path_default),
216     PathOption('amd_lib_path', 'Path to AMD libs', amd_lib_path_default),
217 gross 806 ('amd_libs', 'AMD libraries to link with', amd_libs_default),
218 gross 805 # BLAS
219 matt 863 PathOption('blas_path', 'Path to BLAS includes', None),
220     PathOption('blas_lib_path', 'Path to BLAS libs', None),
221 gross 806 ('blas_libs', 'BLAS libraries to link with', None),
222 gross 950 # netCDF
223 gross 1133 ('useNetCDF', 'switch on/off the usage of netCDF', useNetCDF_default),
224 gross 1028 PathOption('netCDF_path', 'Path to netCDF includes', netCDF_path_default),
225     PathOption('netCDF_lib_path', 'Path to netCDF libs', netCDF_lib_path_default),
226 gross 1133 ('netCDF_libs', 'netCDF C++ libraries to link with', netCDF_libs_default),
227 robwdcock 682 # Python
228 gross 685 # locations of include files for python
229 gross 1133 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 robwdcock 682 # Boost
233 gross 1133 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 robwdcock 682 # Doc building
237 matt 863 # PathOption('doxygen_path', 'Path to Doxygen executable', None),
238     # PathOption('epydoc_path', 'Path to Epydoc executable', None),
239 robwdcock 682 # PAPI
240 matt 863 PathOption('papi_path', 'Path to PAPI includes', None),
241     PathOption('papi_lib_path', 'Path to PAPI libs', None),
242 robwdcock 682 ('papi_libs', 'PAPI libraries to link with', None),
243 bcumming 759 # MPI
244     BoolOption('useMPI', 'Compile parallel version using MPI', 'no'),
245 robwdcock 682 )
246 gross 1133 #=================================================================================================
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 robwdcock 682 else:
259 gross 1133 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 gross 1024 try:
271     python_path = os.environ['PYTHONPATH']
272     env['ENV']['PYTHONPATH'] = python_path
273     except KeyError:
274     python_path = ''
275    
276     try:
277 gross 1160 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 gross 1163 env['ENV']['DISPLAY'] = os.environ['DISPLAY']
284 jongui 1164 env['ENV']['XAUTHORITY'] = os.environ['XAUTHORITY']
285 gross 1163 except KeyError:
286     pass
287    
288     try:
289 gross 1024 path = os.environ['PATH']
290 robwdcock 684 env['ENV']['PATH'] = path
291 gross 1024 except KeyError:
292     path = ''
293     try:
294     ld_library_path = os.environ['LD_LIBRARY_PATH']
295 robwdcock 684 env['ENV']['LD_LIBRARY_PATH'] = ld_library_path
296 gross 1024 except KeyError:
297     ld_library_path = ''
298 gross 1133 #==========================================================================
299     #
300     # Add some customer builders
301     #
302 robwdcock 682 py_builder = Builder(action = scons_extensions.build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)
303     env.Append(BUILDERS = {'PyCompile' : py_builder});
304    
305 gross 1133 if IS_WINDOWS_PLATFORM:
306 robwdcock 682 runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', src_suffix='.exe', single_source=True)
307     else:
308     runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', single_source=True)
309     env.Append(BUILDERS = {'RunUnitTest' : runUnitTest_builder});
310    
311     runPyUnitTest_builder = Builder(action = scons_extensions.runPyUnitTest, suffix = '.passed', src_suffic='.py', single_source=True)
312     env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});
313    
314     # Convert the options which are held in environment variable into python variables for ease of handling and configure compilation options
315     try:
316     incinstall = env['incinstall']
317     env.Append(CPPPATH = [incinstall,])
318     except KeyError:
319 matt 863 incinstall = None
320 robwdcock 682 try:
321     libinstall = env['libinstall']
322 ksteube 1083 env.Append(LIBPATH = [libinstall,]) # ksteube adds -L for building of libescript.so libfinley.so escriptcpp.so finleycpp.so
323 robwdcock 682 env.PrependENVPath('LD_LIBRARY_PATH', libinstall)
324 woo409 757 if env['PLATFORM'] == "win32":
325     env.PrependENVPath('PATH', libinstall)
326 gross 1133 env.PrependENVPath('PATH', env['boost_libs_path'])
327 robwdcock 682 except KeyError:
328 matt 863 libinstall = None
329 robwdcock 682 try:
330     pyinstall = env['pyinstall']+'/esys' # all targets will install into pyinstall/esys but PYTHONPATH points at straight pyinstall so you go import esys.escript etc
331     env.PrependENVPath('PYTHONPATH', env['pyinstall'])
332     except KeyError:
333 matt 863 pyinstall = None
334 robwdcock 682 try:
335     dodebug = env['dodebug']
336     except KeyError:
337 matt 863 dodebug = None
338 robwdcock 682 try:
339 bcumming 759 useMPI = env['useMPI']
340     except KeyError:
341 matt 863 useMPI = None
342 bcumming 759 try:
343 robwdcock 682 cc_defines = env['cc_defines']
344 woo409 757 env.Append(CPPDEFINES = cc_defines)
345 robwdcock 682 except KeyError:
346     pass
347 ksteube 817
348 robwdcock 682 if dodebug:
349 bcumming 759 if useMPI:
350     try:
351     flags = env['cc_flags_debug_MPI']
352     env.Append(CCFLAGS = flags)
353     except KeyError:
354     pass
355 matt 863 else:
356 bcumming 759 try:
357 robwdcock 682 flags = env['cc_flags_debug']
358     env.Append(CCFLAGS = flags)
359 bcumming 759 except KeyError:
360 robwdcock 682 pass
361     else:
362 bcumming 759 if useMPI:
363 robwdcock 682 try:
364 bcumming 759 flags = env['cc_flags_MPI']
365     env.Append(CCFLAGS = flags)
366     except KeyError:
367     pass
368     else:
369     try:
370 robwdcock 682 flags = env['cc_flags']
371     env.Append(CCFLAGS = flags)
372     except KeyError:
373     pass
374     if dodebug:
375 bcumming 759 if useMPI:
376     try:
377     flags = env['cxx_flags_debug_MPI']
378     env.Append(CXXFLAGS = flags)
379     except KeyError:
380     pass
381     else:
382     try:
383     flags = env['cxx_flags_debug']
384     env.Append(CXXFLAGS = flags)
385     except KeyError:
386     pass
387 robwdcock 682 else:
388 bcumming 759 if useMPI:
389     try:
390     flags = env['cxx_flags_MPI']
391     env.Append(CXXFLAGS = flags)
392     except KeyError:
393     pass
394     else:
395     try:
396     flags = env['cxx_flags']
397     env.Append(CXXFLAGS = flags)
398     except KeyError:
399     pass
400 robwdcock 682 try:
401     flags = env['ar_flags']
402     env.Append(ARFLAGS = flags)
403     except KeyError:
404 matt 863 ar_flags = None
405 robwdcock 682 try:
406     sys_libs = env['sys_libs']
407     except KeyError:
408 gross 1133 sys_libs = []
409 robwdcock 682
410     try:
411 gross 700 tar_flags = env['tar_flags']
412     env.Replace(TARFLAGS = tar_flags)
413     except KeyError:
414     pass
415    
416     try:
417 robwdcock 682 includes = env['mkl_path']
418     env.Append(CPPPATH = [includes,])
419     except KeyError:
420     pass
421 gross 700
422 robwdcock 682 try:
423     lib_path = env['mkl_lib_path']
424     env.Append(LIBPATH = [lib_path,])
425     except KeyError:
426     pass
427 gross 700
428 gross 806 if useMPI:
429 gross 1133 mkl_libs = []
430 gross 806 else:
431     try:
432     mkl_libs = env['mkl_libs']
433     except KeyError:
434 gross 1133 mkl_libs = []
435 gross 806
436 robwdcock 682 try:
437     includes = env['scsl_path']
438     env.Append(CPPPATH = [includes,])
439     except KeyError:
440     pass
441 gross 806
442 robwdcock 682 try:
443     lib_path = env['scsl_lib_path']
444     env.Append(LIBPATH = [lib_path,])
445     except KeyError:
446     pass
447 gross 806
448 matt 863 if useMPI:
449 bcumming 759 try:
450     scsl_libs = env['scsl_libs_MPI']
451     except KeyError:
452 gross 1133 scsl_libs = []
453 matt 863 else:
454 bcumming 759 try:
455     scsl_libs = env['scsl_libs']
456     except KeyError:
457 gross 1133 scsl_libs = []
458 gross 805
459 robwdcock 682 try:
460     includes = env['umf_path']
461     env.Append(CPPPATH = [includes,])
462     except KeyError:
463     pass
464 gross 805
465 robwdcock 682 try:
466     lib_path = env['umf_lib_path']
467     env.Append(LIBPATH = [lib_path,])
468     except KeyError:
469     pass
470 gross 805
471 matt 863 if useMPI:
472 gross 1133 umf_libs = []
473 gross 806 else:
474     try:
475     umf_libs = env['umf_libs']
476     except KeyError:
477 gross 1133 umf_libs = []
478 gross 806
479 robwdcock 682 try:
480 gross 806 includes = env['ufc_path']
481     env.Append(CPPPATH = [includes,])
482 gross 805 except KeyError:
483     pass
484    
485     try:
486 gross 806 includes = env['amd_path']
487     env.Append(CPPPATH = [includes,])
488 robwdcock 682 except KeyError:
489 gross 806 pass
490 gross 805
491 robwdcock 682 try:
492 gross 806 lib_path = env['amd_lib_path']
493     env.Append(LIBPATH = [lib_path,])
494     except KeyError:
495     pass
496    
497 matt 863 if useMPI:
498 gross 1133 amd_libs = []
499 gross 806 else:
500     try:
501     amd_libs = env['amd_libs']
502     except KeyError:
503 gross 1133 amd_libs = []
504 gross 806
505     try:
506 gross 805 includes = env['blas_path']
507     env.Append(CPPPATH = [includes,])
508     except KeyError:
509     pass
510 gross 806
511 gross 805 try:
512     lib_path = env['blas_lib_path']
513     env.Append(LIBPATH = [lib_path,])
514     except KeyError:
515     pass
516 gross 806
517 gross 805 try:
518     blas_libs = env['blas_libs']
519     except KeyError:
520 gross 1133 blas_libs = []
521 gross 805
522     try:
523 gross 1023 useNetCDF = env['useNetCDF']
524 gross 950 except KeyError:
525 gross 1023 useNetCDF = 'yes'
526 gross 950 pass
527    
528 gross 1023 if not useNetCDF == 'yes':
529     print "Warning: Installation is not configured with netCDF. Some I/O function may not be available."
530    
531     if useNetCDF == 'yes':
532     try:
533     includes = env['netCDF_path']
534     env.Append(CPPPATH = [includes,])
535     except KeyError:
536     pass
537 gross 950
538 gross 1023 try:
539     lib_path = env['netCDF_lib_path']
540 gross 1133 if IS_WINDOWS_PLATFORM: env['ENV']['PATH']+=";"+lib_path
541     env.Append(LIBPATH = [ lib_path, ])
542 gross 1023 except KeyError:
543     pass
544 gross 950
545 gross 1023 try:
546 gross 1133 netCDF_libs = env['netCDF_libs']
547 gross 1023 except KeyError:
548 gross 1133 netCDF_libs = [ ]
549 gross 1023 else:
550 gross 1133 netCDF_libs=[ ]
551 gross 1023
552 gross 950 try:
553 robwdcock 682 includes = env['boost_path']
554     env.Append(CPPPATH = [includes,])
555     except KeyError:
556     pass
557     try:
558 gross 1133 lib_path = env['boost_libs_path']
559 robwdcock 682 env.Append(LIBPATH = [lib_path,])
560     except KeyError:
561     pass
562     try:
563 gross 1133 boost_libs = env['boost_libs']
564 robwdcock 682 except KeyError:
565 gross 1133 boost_libs = None
566 robwdcock 682 try:
567     includes = env['python_path']
568     env.Append(CPPPATH = [includes,])
569     except KeyError:
570     pass
571     try:
572     lib_path = env['python_lib_path']
573     env.Append(LIBPATH = [lib_path,])
574     except KeyError:
575     pass
576     try:
577 gross 1133 python_libs = env['python_libs']
578 robwdcock 682 except KeyError:
579 gross 1133 python_libs = None
580 robwdcock 682 try:
581     doxygen_path = env['doxygen_path']
582     except KeyError:
583 matt 863 doxygen_path = None
584 robwdcock 682 try:
585     epydoc_path = env['epydoc_path']
586     except KeyError:
587 matt 863 epydoc_path = None
588 robwdcock 682 try:
589     includes = env['papi_path']
590     env.Append(CPPPATH = [includes,])
591     except KeyError:
592     pass
593     try:
594     lib_path = env['papi_lib_path']
595     env.Append(LIBPATH = [lib_path,])
596     except KeyError:
597     pass
598     try:
599     papi_libs = env['papi_libs']
600     except KeyError:
601 matt 863 papi_libs = None
602 robwdcock 682
603 gross 707
604 gross 700 try:
605 gross 707 src_zipfile = env.File(env['src_zipfile'])
606 gross 700 except KeyError:
607 matt 863 src_zipfile = None
608 gross 700 try:
609 gross 707 test_zipfile = env.File(env['test_zipfile'])
610 gross 700 except KeyError:
611 matt 863 test_zipfile = None
612 gross 707 try:
613     examples_zipfile = env.File(env['examples_zipfile'])
614     except KeyError:
615 matt 863 examples_zipfile = None
616 gross 700
617     try:
618 gross 707 src_tarfile = env.File(env['src_tarfile'])
619 gross 700 except KeyError:
620 matt 863 src_tarfile = None
621 gross 700 try:
622 gross 707 test_tarfile = env.File(env['test_tarfile'])
623 gross 700 except KeyError:
624 matt 863 test_tarfile = None
625 gross 707 try:
626     examples_tarfile = env.File(env['examples_tarfile'])
627     except KeyError:
628 matt 863 examples_tarfile = None
629 gross 700
630     try:
631 gross 707 guide_pdf = env.File(env['guide_pdf'])
632 gross 700 except KeyError:
633 matt 863 guide_pdf = None
634 gross 700
635 gross 707 try:
636     guide_html_index = env.File('index.htm',env['guide_html'])
637     except KeyError:
638 matt 863 guide_html_index = None
639 gross 707
640 elspeth 712 try:
641     api_epydoc = env.Dir(env['api_epydoc'])
642     except KeyError:
643 matt 863 api_epydoc = None
644 elspeth 712
645 gross 700 # Zipgets
646 robwdcock 682 env.Default(libinstall)
647     env.Default(incinstall)
648     env.Default(pyinstall)
649 matt 863 env.Alias('release_src',[ src_zipfile, src_tarfile ])
650 gross 700 env.Alias('release_tests',[ test_zipfile, test_tarfile])
651 gross 707 env.Alias('release_examples',[ examples_zipfile, examples_tarfile])
652 gross 720 env.Alias('api_epydoc',api_epydoc)
653 gross 807 env.Alias('guide_pdf', guide_pdf)
654     env.Alias('docs',[ 'release_examples', 'guide_pdf', guide_html_index, api_epydoc])
655 gross 707 env.Alias('release', ['release_src', 'release_tests', 'docs'])
656 gross 705 env.Alias('build_tests') # target to build all C++ tests
657     env.Alias('build_py_tests') # target to build all python tests
658 gross 706 env.Alias('build_all_tests', [ 'build_tests', 'build_py_tests' ] ) # target to build all python tests
659     env.Alias('run_tests', 'build_tests') # target to run all C++ test
660     env.Alias('py_tests', 'build_py_tests') # taget to run all released python tests
661 gross 705 env.Alias('all_tests', ['run_tests', 'py_tests']) # target to run all C++ and released python tests
662 robwdcock 682
663     # Python install - esys __init__.py
664 woo409 757 init_target = env.Command(pyinstall+'/__init__.py', None, Touch('$TARGET'))
665     env.Alias(init_target)
666 robwdcock 682
667     # Allow sconscripts to see the env
668 gross 1133 Export(["IS_WINDOWS_PLATFORM", "env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs", "netCDF_libs", "useNetCDF",
669     "boost_libs", "python_libs", "doxygen_path", "epydoc_path", "papi_libs",
670 gross 707 "sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "examples_tarfile", "examples_zipfile",
671 gross 1133 "guide_pdf", "guide_html_index", "api_epydoc", "useMPI" ])
672 robwdcock 682
673     # End initialisation section
674     # Begin configuration section
675 gross 700 # adds this file and the scons option directore to the source tar
676     release_srcfiles=[env.File('SConstruct'),]+[ env.File(x) for x in glob.glob('scons/*.py') ]
677     release_testfiles=[env.File('README_TESTS'),]
678 gross 706 env.Zip(src_zipfile, release_srcfiles)
679 gross 700 env.Zip(test_zipfile, release_testfiles)
680 gross 1133 try:
681     env.Tar(src_tarfile, release_srcfiles)
682     env.Tar(test_tarfile, release_testfiles)
683     except AttributeError:
684     pass
685 robwdcock 682 # Insert new components to be build here
686     # FIXME: might be nice to replace this verbosity with a list of targets and some
687     # FIXME: nifty python to create the lengthy but very similar env.Sconscript lines
688     # Third Party libraries
689     env.SConscript(dirs = ['tools/CppUnitTest/src'], build_dir='build/$PLATFORM/tools/CppUnitTest', duplicate=0)
690     # C/C++ Libraries
691     env.SConscript(dirs = ['paso/src'], build_dir='build/$PLATFORM/paso', duplicate=0)
692 gross 958 # bruce is removed for now as it doesn't really do anything
693     # env.SConscript(dirs = ['bruce/src'], build_dir='build/$PLATFORM/bruce', duplicate=0)
694 robwdcock 682 env.SConscript(dirs = ['escript/src'], build_dir='build/$PLATFORM/escript', duplicate=0)
695     env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)
696     env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)
697     env.SConscript(dirs = ['modellib/py_src'], build_dir='build/$PLATFORM/modellib', duplicate=0)
698 gross 707 env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0)
699 matt 863 env.SConscript(dirs = ['pyvisi/py_src'], build_dir='build/$PLATFORM/pyvisi', duplicate=0)
700 gross 898 env.SConscript(dirs = ['pycad/py_src'], build_dir='build/$PLATFORM/pycad', duplicate=0)
701 bcumming 751
702     # added by Ben Cumming
703 matt 863 env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)
704 bcumming 784 #env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0)

  ViewVC Help
Powered by ViewVC 1.1.26