/[escript]/trunk/SConstruct
ViewVC logotype

Contents of /trunk/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.26