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

Annotation of /branches/numpy/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1235 - (hide annotations)
Mon Aug 13 00:25:29 2007 UTC (11 years, 8 months ago) by phornby
Original Path: trunk/SConstruct
File size: 24426 byte(s)
Started the removal of IS_WINDOWS_PLATFORM, and now insis that the windows options file be kept up to date, and be complete.

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

  ViewVC Help
Powered by ViewVC 1.1.26