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