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