/[escript]/branches/scons-dev/SConstruct
ViewVC logotype

Contents of /branches/scons-dev/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1668 - (show annotations)
Wed Jul 23 20:36:21 2008 UTC (14 years ago) by ksteube
File size: 21209 byte(s)
Using AppendUnique to avoid having -I/usr/include appear 5 times
Not using PathOption any longer because Configure tells us what we need to know

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 # TODO How to modify CCFLAGS for only one file? Look for example with Program(...)
9
10 EnsureSConsVersion(0,96,91)
11 EnsurePythonVersion(2,3)
12
13 import sys, os, re, socket
14
15 # Add our extensions
16 if os.path.isdir('scons'): sys.path.append('scons')
17 import scons_extensions
18
19 # The string python2.4 or python2.5
20 python_version = 'python%s.%s' % (sys.version_info[0], sys.version_info[1])
21
22 # MS Windows support, many thanks to PH
23 IS_WINDOWS_PLATFORM = (os.name== "nt")
24
25 prefix = ARGUMENTS.get('prefix', Dir('#.').abspath)
26
27 # Read configuration options from file scons/<hostname>_options.py
28 hostname = re.sub("[^0-9a-zA-Z]", "_", socket.gethostname().split('.')[0])
29 tmp = os.path.join("scons",hostname+"_options.py")
30 options_file = ARGUMENTS.get('options_file', tmp)
31 if not os.path.isfile(options_file): options_file = False
32
33 # Load options file and command-line arguments
34 opts = Options(options_file, ARGUMENTS)
35
36 ############ Load build options ################################
37
38 opts.AddOptions(
39 # Where to install esys stuff
40 ('prefix', 'where everything will be installed', Dir('#.').abspath),
41 ('incinstall', 'where the esys headers will be installed', Dir('#.').abspath+'/include'),
42 ('libinstall', 'where the esys libraries will be installed', os.path.join(prefix,"lib")),
43 ('pyinstall', 'where the esys python modules will be installed', os.path.join(prefix,"esys")),
44 # Compilation options
45 BoolOption('dodebug', 'For backwards compatibility', 'no'),
46 BoolOption('usedebug', 'Do you want a debug build?', 'no'),
47 BoolOption('usevtk', 'Do you want to use VTK?', 'yes'),
48 ('options_file', "File of paths/options. Default: scons/<hostname>_options.py", options_file),
49 ('cc_defines','C/C++ defines to use', None),
50 # The strings -DDEFAULT_ get replaced by scons/<hostname>_options.py or by defaults below
51 ('cc_flags', 'C compiler flags to use', '-DEFAULT_1'),
52 ('cc_optim', 'C compiler optimization flags to use', '-DEFAULT_2'),
53 ('cc_debug', 'C compiler debug flags to use', '-DEFAULT_3'),
54 ('omp_optim', 'OpenMP compiler flags to use (Release build)', '-DEFAULT_4'),
55 ('omp_debug', 'OpenMP compiler flags to use (Debug build)', '-DEFAULT_5'),
56 ('sys_libs', 'System libraries to link with', []),
57 ('ar_flags', 'Static library archiver flags to use', ''),
58 BoolOption('useopenmp', 'Compile parallel version using OpenMP', 'yes'),
59 # Python
60 ('python_path', 'Path to Python includes', '/usr/include/'+python_version),
61 ('python_lib_path', 'Path to Python libs', '/usr/lib'),
62 ('python_libs', 'Python libraries to link with', [python_version]),
63 ('python_cmd', 'Python command', 'python'),
64 # Boost
65 ('boost_path', 'Path to Boost includes', "/usr/include"),
66 ('boost_lib_path', 'Path to Boost libs', '/usr/lib'),
67 ('boost_libs', 'Boost libraries to link with', ['boost_python']),
68 # NetCDF
69 BoolOption('usenetcdf', 'switch on/off the usage of netCDF', 'yes'),
70 ('netCDF_path', 'Path to netCDF includes', '/usr/include'),
71 ('netCDF_lib_path', 'Path to netCDF libs', '/usr/lib'),
72 ('netCDF_libs', 'netCDF C++ libraries to link with', ['netcdf_c++', 'netcdf']),
73 # MPI
74 BoolOption('useMPI', 'For backwards compatibility', 'no'),
75 BoolOption('usempi', 'Compile parallel version using MPI', 'no'),
76 ('MPICH_IGNORE_CXX_SEEK', 'name of macro to ignore MPI settings of C++ SEEK macro (for MPICH)' , 'MPICH_IGNORE_CXX_SEEK'),
77 ('mpi_path', 'Path to MPI includes', '/usr/include'),
78 ('mpi_run', 'mpirun name' , 'mpiexec -np 1'),
79 ('mpi_lib_path', 'Path to MPI libs (needs to be added to the LD_LIBRARY_PATH)', '/usr/lib'),
80 ('mpi_libs', 'MPI libraries to link with (needs to be shared!)', ['mpich' , 'pthread', 'rt']),
81 # ParMETIS
82 BoolOption('useparmetis', 'Compile parallel version using ParMETIS', 'yes'),
83 ('parmetis_path', 'Path to ParMETIS includes', '/usr/include'),
84 ('parmetis_lib_path', 'Path to ParMETIS library', '/usr/lib'),
85 ('parmetis_libs', 'ParMETIS library to link with', []),
86 # PAPI
87 ('papi_path', 'Path to PAPI includes', None),
88 ('papi_lib_path', 'Path to PAPI libs', None),
89 ('papi_libs', 'PAPI libraries to link with', []),
90 BoolOption('papi_instrument_solver', 'use PAPI in Solver.c to instrument each iteration of the solver', False),
91 # MKL
92 ('mkl_path', 'Path to MKL includes', None),
93 ('mkl_lib_path', 'Path to MKL libs', None),
94 ('mkl_libs', 'MKL libraries to link with', []),
95 # UMFPACK
96 BoolOption('useumfpack', 'switch on/off the usage of UMFPACK', 'no'),
97 ('ufc_path', 'Path to UFconfig includes', '/usr/include/suitesparse'),
98 ('umf_path', 'Path to UMFPACK includes', '/usr/include/suitesparse'),
99 ('umf_lib_path', 'Path to UMFPACK libs', '/usr/lib'),
100 ('umf_libs', 'UMFPACK libraries to link with', ['umfpack']),
101 # AMD (used by UMFPACK)
102 ('amd_path', 'Path to AMD includes', '/usr/include/suitesparse'),
103 ('amd_lib_path', 'Path to AMD libs', '/usr/lib'),
104 ('amd_libs', 'AMD libraries to link with', ['amd']),
105 # BLAS (used by UMFPACK)
106 ('blas_path', 'Path to BLAS includes', '/usr/include/suitesparse'),
107 ('blas_lib_path', 'Path to BLAS libs', '/usr/lib'),
108 ('blas_libs', 'BLAS libraries to link with', ['blas'])
109 )
110
111 ############ Specify which compilers to use ####################
112
113 # intelc uses regular expressions improperly and emits a warning about
114 # failing to find the compilers. This warning can be safely ignored.
115
116 if IS_WINDOWS_PLATFORM:
117 env = Environment(tools = ['default', 'msvc'], options = opts)
118 else:
119 if socket.gethostname().split('.')[0] == 'service0':
120 env = Environment(tools = ['default', 'intelc'], options = opts)
121 elif os.uname()[4]=='ia64':
122 env = Environment(tools = ['default', 'intelc'], options = opts)
123 if env['CXX'] == 'icpc':
124 env['LINK'] = env['CXX'] # version >=9 of intel c++ compiler requires use of icpc to link in C++ runtimes (icc does not)
125 else:
126 env = Environment(tools = ['default'], options = opts)
127 Help(opts.GenerateHelpText(env))
128
129 ############ Fill in compiler options if not set above #########
130
131 # Backwards compatibility: allow dodebug=yes and useMPI=yes
132 if env['dodebug']: env['usedebug'] = 1
133 if env['useMPI']: env['usempi'] = 1
134
135 # Default compiler options (override allowed in hostname_options.py, but should not be necessary)
136 # For both C and C++ you get: cc_flags and either the optim flags or debug flags
137
138 if env["CC"] == "icc":
139 # Intel compilers
140 cc_flags = "-fPIC -ansi -wd161 -w1 -vec-report0 -DBLOCKTIMER -DCORE_ID1"
141 cc_optim = "-O3 -ftz -IPF_ftlacc- -IPF_fma -fno-alias"
142 cc_debug = "-g -O0 -UDOASSERT -DDOPROF -DBOUNDS_CHECK"
143 omp_optim = "-openmp -openmp_report0"
144 omp_debug = "-openmp -openmp_report0"
145 elif env["CC"] == "gcc":
146 # GNU C on any system
147 cc_flags = "-fPIC -ansi -ffast-math -Wno-unknown-pragmas -pedantic-errors -Wno-long-long -DBLOCKTIMER"
148 cc_optim = "-O3"
149 cc_debug = "-g -O0 -UDOASSERT -DDOPROF -DBOUNDS_CHECK"
150 omp_optim = ""
151 omp_debug = ""
152 elif env["CC"] == "cl":
153 # Microsoft Visual C on Windows
154 cc_flags = "/FD /EHsc /GR /wd4068 -D_USE_MATH_DEFINES -DDLL_NETCDF"
155 cc_optim = "/O2 /Op /MT /W3"
156 cc_debug = "/Od /RTC1 /MTd /ZI -DBOUNDS_CHECK"
157 omp_optim = ""
158 omp_debug = ""
159
160 # If not specified in hostname_options.py then set them here
161 if env["cc_flags"] == "-DEFAULT_1": env['cc_flags'] = cc_flags
162 if env["cc_optim"] == "-DEFAULT_2": env['cc_optim'] = cc_optim
163 if env["cc_debug"] == "-DEFAULT_3": env['cc_debug'] = cc_debug
164 if env["omp_optim"] == "-DEFAULT_4": env['omp_optim'] = omp_optim
165 if env["omp_debug"] == "-DEFAULT_5": env['omp_debug'] = omp_debug
166
167 # OpenMP is disabled if useopenmp=no or both variables omp_optim and omp_debug are empty
168 if not env["useopenmp"]:
169 env['omp_optim'] = ""
170 env['omp_debug'] = ""
171
172 if env['omp_optim'] == "" and env['omp_debug'] == "": env["useopenmp"] = 0
173
174 ############ Copy environment variables into scons env #########
175
176 try: env['ENV']['OMP_NUM_THREADS'] = os.environ['OMP_NUM_THREADS']
177 except KeyError: env['ENV']['OMP_NUM_THREADS'] = 1
178
179 try: env['ENV']['PATH'] = os.environ['PATH']
180 except KeyError: pass
181
182 try: env['ENV']['PYTHONPATH'] = os.environ['PYTHONPATH']
183 except KeyError: pass
184
185 try: env['ENV']['LD_LIBRARY_PATH'] = os.environ['LD_LIBRARY_PATH']
186 except KeyError: pass
187
188 try: env['ENV']['LIBRARY_PATH'] = os.environ['LIBRARY_PATH']
189 except KeyError: pass
190
191 try: env['ENV']['DISPLAY'] = os.environ['DISPLAY']
192 except KeyError: pass
193
194 try: env['ENV']['XAUTHORITY'] = os.environ['XAUTHORITY']
195 except KeyError: pass
196
197 try: env['ENV']['HOME'] = os.environ['HOME']
198 except KeyError: pass
199
200 # Configure for test suite
201 env.PrependENVPath('PYTHONPATH', prefix)
202 env.PrependENVPath('LD_LIBRARY_PATH', env['libinstall'])
203
204 ############ Set up paths for Configure() ######################
205
206 # Make a copy of an environment
207 # Use env.Clone if available, but fall back on env.Copy for older version of scons
208 def clone_env(env):
209 if 'Clone' in dir(env): return env.Clone() # scons-0.98
210 else: return env.Copy() # scons-0.96
211
212 # Add cc option -I<Escript>/trunk/include
213 env.Append(CPPPATH = [Dir('include')])
214
215 # Add cc option -L<Escript>/trunk/lib
216 env.Append(LIBPATH = [Dir('lib')])
217
218 # Get the global Subversion revision number for getVersion() method
219 try:
220 global_revision = os.popen("svnversion -n .").read()
221 global_revision = re.sub(":.*", "", global_revision)
222 global_revision = re.sub("[^0-9]", "", global_revision)
223 except:
224 global_revision="-1"
225 if global_revision == "": global_revision="-2"
226 env.Append(CPPDEFINES = ["SVN_VERSION="+global_revision])
227
228 # Create a Configure() environment only for checking existence of
229 # libraries and headers. Later we throw it away then build the real
230 # environment.
231 conf = Configure(clone_env(env))
232
233 ############ numarray (required) ###############################
234
235 try: from numarray import identity
236 except ImportError: sys.exit(1)
237
238 ############ python libraries (required) #######################
239
240 conf.env.Append(CPPPATH = [env['python_path']])
241 conf.env.Append(LIBPATH = [env['python_lib_path']])
242 conf.env.Append(LIBS = [env['python_libs']])
243
244 if not conf.CheckCHeader('Python.h'): sys.exit(1)
245 if not conf.CheckFunc('Py_Main'): sys.exit(1)
246
247 # Add python libraries to environment env
248 env.AppendUnique(CPPPATH = [env['python_path']])
249 env.AppendUnique(LIBPATH = [env['python_lib_path']])
250 env.Append(LIBS = [env['python_libs']])
251
252 ############ boost (required) ##################################
253
254 conf.env.Append(CPPPATH = [env['boost_path']])
255 conf.env.Append(LIBPATH = [env['boost_lib_path']])
256 conf.env.Append(LIBS = [env['boost_libs']])
257
258 if not conf.CheckCXXHeader('boost/python.hpp'): sys.exit(1)
259 if not conf.CheckFunc('PyObject_SetAttr'): sys.exit(1)
260
261 # Add boost to environment env
262 env.AppendUnique(CPPPATH = [env['boost_path']])
263 env.AppendUnique(LIBPATH = [env['boost_lib_path']])
264 env.Append(LIBS = [env['boost_libs']])
265
266 ############ VTK (optional) ####################################
267
268 if env['usevtk']:
269 try:
270 import vtk
271 env['usevtk'] = 1
272 except ImportError:
273 env['usevtk'] = 0
274
275 # Add VTK to environment env
276 if env['usevtk']:
277 env.Append(CPPDEFINES = ['USE_VTK'])
278
279 ############ NetCDF (optional) #################################
280
281 if env['usenetcdf']:
282 conf.env.Append(CPPPATH = [env['netCDF_path']])
283 conf.env.Append(LIBPATH = [env['netCDF_lib_path']])
284 conf.env.Append(LIBS = [env['netCDF_libs']])
285
286 if env['usenetcdf'] and not conf.CheckCHeader('netcdf.h'): env['usenetcdf'] = 0
287 if env['usenetcdf'] and not conf.CheckFunc('nc_open'): env['usenetcdf'] = 0
288
289 # Add NetCDF to environment env
290 if env['usenetcdf']:
291 env.AppendUnique(CPPPATH = [env['netCDF_path']])
292 env.AppendUnique(LIBPATH = [env['netCDF_lib_path']])
293 env.Append(LIBS = [env['netCDF_libs']])
294 env.Append(CPPDEFINES = ['USE_NETCDF'])
295
296 ############ UMFPACK (optional) ################################
297
298 # Start a new configure environment that reflects what we've already found
299 conf.Finish()
300 conf = Configure(clone_env(env))
301
302 if env['useumfpack']:
303 conf.env.Append(CPPPATH = [env['ufc_path']])
304 conf.env.Append(CPPPATH = [env['umf_path']])
305 conf.env.Append(LIBPATH = [env['umf_lib_path']])
306 conf.env.Append(LIBS = [env['umf_libs']])
307 conf.env.Append(CPPPATH = [env['amd_path']])
308 conf.env.Append(LIBPATH = [env['amd_lib_path']])
309 conf.env.Append(LIBS = [env['amd_libs']])
310 conf.env.Append(CPPPATH = [env['blas_path']])
311 conf.env.Append(LIBPATH = [env['blas_lib_path']])
312 conf.env.Append(LIBS = [env['blas_libs']])
313
314 if env['useumfpack'] and not conf.CheckCHeader('umfpack.h'): env['useumfpack'] = 0
315 if env['useumfpack'] and not conf.CheckFunc('umfpack_di_symbolic'): env['useumfpack'] = 0
316
317 # Add UMFPACK to environment env
318 if env['useumfpack']:
319 env.AppendUnique(CPPPATH = [env['ufc_path']])
320 env.AppendUnique(CPPPATH = [env['umf_path']])
321 env.AppendUnique(LIBPATH = [env['umf_lib_path']])
322 env.Append(LIBS = [env['umf_libs']])
323 env.Append(CPPDEFINES = ['UMFPACK'])
324
325 env.AppendUnique(CPPPATH = [env['amd_path']])
326 env.AppendUnique(LIBPATH = [env['amd_lib_path']])
327 env.Append(LIBS = [env['amd_libs']])
328
329 env.AppendUnique(CPPPATH = [env['blas_path']])
330 env.AppendUnique(LIBPATH = [env['blas_lib_path']])
331 env.Append(LIBS = [env['blas_libs']])
332
333 ############ MPI (optional) ####################################
334
335 # Start a new configure environment that reflects what we've already found
336 conf.Finish()
337 conf = Configure(clone_env(env))
338
339 if env['usempi']:
340 conf.env.Append(CPPPATH = [env['mpi_path']])
341 conf.env.Append(LIBPATH = [env['mpi_lib_path']])
342 conf.env.Append(LIBS = [env['mpi_libs']])
343
344 if env['usempi'] and not conf.CheckCHeader('mpi.h'): env['usempi'] = 0
345 if env['usempi'] and not conf.CheckFunc('MPI_Init'): env['usempi'] = 0
346
347 # Create a modified environment for MPI programs
348 env_mpi = clone_env(env)
349
350 # Add MPI to environment env_mpi
351 if env_mpi['usempi']:
352 env_mpi.AppendUnique(CPPPATH = [env['mpi_path']])
353 env_mpi.AppendUnique(LIBPATH = [env['mpi_lib_path']])
354 env_mpi.Append(LIBS = [env['mpi_libs']])
355 env_mpi.Append(CPPDEFINES = ['PASO_MPI', 'MPI_NO_CPPBIND', env_mpi['MPICH_IGNORE_CXX_SEEK']])
356
357 ############ ParMETIS (optional) ###############################
358
359 # Start a new configure environment that reflects what we've already found
360 conf.Finish()
361 conf = Configure(clone_env(env_mpi))
362
363 if not env['usempi']: env['useparmetis'] = 0
364
365 if env['useparmetis']:
366 conf.env.Append(CPPPATH = [env['parmetis_path']])
367 conf.env.Append(LIBPATH = [env['parmetis_lib_path']])
368 conf.env.Append(LIBS = [env['parmetis_libs']])
369
370 if env['useparmetis'] and not conf.CheckCHeader('parmetis.h'): env['useparmetis'] = 0
371 if env['useparmetis'] and not conf.CheckFunc('ParMETIS_V3_PartGeomKway'): env['useparmetis'] = 0
372
373 # Add ParMETIS to environment env_mpi
374 if env['useparmetis']:
375 env_mpi.AppendUnique(CPPPATH = [env['parmetis_path']])
376 env_mpi.AppendUnique(LIBPATH = [env['parmetis_lib_path']])
377 env_mpi.Append(LIBS = [env['parmetis_libs']])
378 env_mpi.Append(CPPDEFINES = ['USE_PARMETIS'])
379
380 ############ Configure finished, now finish environment ########
381
382 conf.Finish()
383
384 # Enable debug by choosing either cc_debug or cc_optim
385 if env['usedebug']:
386 env.Append(CCFLAGS = env['cc_debug'])
387 env.Append(CCFLAGS = env['omp_debug'])
388 else:
389 env.Append(CCFLAGS = env['cc_optim'])
390 env.Append(CCFLAGS = env['omp_optim'])
391
392 # Always use cc_flags
393 env.Append(CCFLAGS = env['cc_flags'])
394
395 # MS Windows
396 if IS_WINDOWS_PLATFORM:
397 env.PrependENVPath('PATH', [env['boost_lib_path']])
398 env.PrependENVPath('PATH', [env['libinstall']])
399 if env['usenetcdf']:
400 env.PrependENVPath('PATH', [env['netCDF_lib_path']])
401
402 env.Append(ARFLAGS = env['ar_flags'])
403
404 ############ Summarize our environment #########################
405
406 print ""
407 print "Summary of configuration (see ./config.log for information)"
408 print " Using python libraries"
409 print " Using numarray"
410 print " Using boost"
411 if env['usenetcdf']: print " Using NetCDF"
412 else: print " Not using NetCDF"
413 if env['useumfpack']: print " Using UMFPACK"
414 else: print " Not using UMFPACK"
415 if env['usevtk']: print " Using VTK"
416 else: print " Not using VTK"
417 if env['useopenmp']: print " Using OpenMP"
418 else: print " Not using OpenMP"
419 if env['usempi']: print " Using MPI"
420 else: print " Not using MPI"
421 if env['useparmetis']: print " Using ParMETIS"
422 else: print " Not using ParMETIS (requires MPI)"
423 if env['usedebug']: print " Compiling for debug"
424 else: print " Not compiling for debug"
425 print " Installing in", prefix
426 print ""
427
428 ############ Add some custom builders ##########################
429
430 py_builder = Builder(action = scons_extensions.build_py, suffix = '.pyc', src_suffix = '.py', single_source=True)
431 env.Append(BUILDERS = {'PyCompile' : py_builder});
432
433 runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', src_suffix=env['PROGSUFFIX'], single_source=True)
434 env.Append(BUILDERS = {'RunUnitTest' : runUnitTest_builder});
435
436 runPyUnitTest_builder = Builder(action = scons_extensions.runPyUnitTest, suffix = '.passed', src_suffic='.py', single_source=True)
437 env.Append(BUILDERS = {'RunPyUnitTest' : runPyUnitTest_builder});
438
439 ############ Remember what options were used in the build ######
440
441 if not IS_WINDOWS_PLATFORM:
442 env.Execute("/bin/rm -f " + env['libinstall'] + "/Compiled.with.*")
443 if env['usedebug']: env.Execute("touch " + env['libinstall'] + "/Compiled.with.debug")
444 if env['usempi']: env.Execute("touch " + env['libinstall'] + "/Compiled.with.mpi")
445 if env['omp_optim'] != '': env.Execute("touch " + env['libinstall'] + "/Compiled.with.OpenMP")
446
447 ############ Build the desired subdirectories ##################
448
449 Export(["env", "env_mpi"])
450
451 env.SConscript(dirs = ['tools/CppUnitTest/src'], build_dir='build/$PLATFORM/tools/CppUnitTest', duplicate=0)
452 env.SConscript(dirs = ['paso/src'], build_dir='build/$PLATFORM/paso', duplicate=0)
453 env.SConscript(dirs = ['escript/src'], build_dir='build/$PLATFORM/escript', duplicate=0)
454 env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0)
455 env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0)
456 env.SConscript(dirs = ['modellib/py_src'], build_dir='build/$PLATFORM/modellib', duplicate=0)
457 env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0)
458 env.SConscript(dirs = ['pyvisi/py_src'], build_dir='build/$PLATFORM/pyvisi', duplicate=0)
459 env.SConscript(dirs = ['pycad/py_src'], build_dir='build/$PLATFORM/pycad', duplicate=0)
460 env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0)
461
462 ############ Targets to build and install libraries ############
463
464 target_init = env.Command(env['pyinstall']+'/__init__.py', None, Touch('$TARGET'))
465 env.Alias('target_init', [target_init])
466
467 # The headers have to be installed prior to build in order to satisfy #include <paso/Common.h>
468 env.Alias('build_esysUtils', ['target_install_esysUtils_headers', 'target_esysUtils_a'])
469 env.Alias('install_esysUtils', ['build_esysUtils', 'target_install_esysUtils_a'])
470
471 env.Alias('build_paso', ['target_install_paso_headers', 'target_paso_a'])
472 env.Alias('install_paso', ['build_paso', 'target_install_paso_a'])
473
474 env.Alias('build_escript', ['target_install_escript_headers', 'target_escript_so', 'target_escriptcpp_so'])
475 env.Alias('install_escript', ['build_escript', 'target_install_escript_so', 'target_install_escriptcpp_so', 'target_install_escript_py'])
476
477 env.Alias('build_finley', ['target_install_finley_headers', 'target_finley_so', 'target_finleycpp_so'])
478 env.Alias('install_finley', ['build_finley', 'target_install_finley_so', 'target_install_finleycpp_so', 'target_install_finley_py'])
479
480 # Now gather all the above into a couple easy targets: build_all and install_all
481 build_all_list = []
482 build_all_list += ['build_esysUtils']
483 build_all_list += ['build_paso']
484 build_all_list += ['build_escript']
485 build_all_list += ['build_finley']
486 if env['usempi']: build_all_list += ['target_pythonMPI_exe']
487 env.Alias('build_all', build_all_list)
488
489 install_all_list = []
490 install_all_list += ['target_init']
491 install_all_list += ['install_esysUtils']
492 install_all_list += ['install_paso']
493 install_all_list += ['install_escript']
494 install_all_list += ['install_finley']
495 install_all_list += ['target_install_pyvisi_py']
496 install_all_list += ['target_install_modellib_py']
497 install_all_list += ['target_install_pycad_py']
498 if env['usempi']: install_all_list += ['target_install_pythonMPI_exe']
499 env.Alias('install_all', install_all_list)
500
501 # Default target is install
502 env.Default('install_all')
503
504 ############ Targets to build and run the test suite ###########
505
506 env.Alias('build_cppunittest', ['target_install_cppunittest_headers', 'target_cppunittest_a'])
507 env.Alias('install_cppunittest', ['build_cppunittest', 'target_install_cppunittest_a'])
508 env.Alias('run_tests', ['install_all', 'target_install_cppunittest_a'])
509 env.Alias('all_tests', ['install_all', 'target_install_cppunittest_a', 'run_tests', 'py_tests'])
510
511 ############ Targets to build the documentation ################
512
513 env.Alias('docs', ['examples_tarfile', 'examples_zipfile', 'api_epydoc', 'api_doxygen', 'guide_pdf', 'guide_html'])
514

  ViewVC Help
Powered by ViewVC 1.1.26