15 |
EnsureSConsVersion(0,96,91) |
EnsureSConsVersion(0,96,91) |
16 |
EnsurePythonVersion(2,3) |
EnsurePythonVersion(2,3) |
17 |
|
|
18 |
|
# import tools: |
19 |
|
import glob |
20 |
import sys, os |
import sys, os |
21 |
# Add our extensions |
# Add our extensions |
22 |
if sys.path.count('scons')==0: sys.path.append('scons') |
if sys.path.count('scons')==0: sys.path.append('scons') |
45 |
('incinstall', 'where the esys headers will be installed', Dir('#.').abspath+'/include'), |
('incinstall', 'where the esys headers will be installed', Dir('#.').abspath+'/include'), |
46 |
('libinstall', 'where the esys libraries will be installed', Dir('#.').abspath+'/lib'), |
('libinstall', 'where the esys libraries will be installed', Dir('#.').abspath+'/lib'), |
47 |
('pyinstall', 'where the esys python modules will be installed', Dir('#.').abspath), |
('pyinstall', 'where the esys python modules will be installed', Dir('#.').abspath), |
48 |
|
('src_zipfile', 'the source zip file will be installed.', Dir('#.').abspath+"/release/escript_src.zip"), |
49 |
|
('test_zipfile', 'the test zip file will be installed.', Dir('#.').abspath+"/release/escript_src_tests.zip"), |
50 |
|
('src_tarfile', 'the source tar file will be installed.', Dir('#.').abspath+"/release/escript_src.tar.gz"), |
51 |
|
('test_tarfile', 'the test tar file will be installed.', Dir('#.').abspath+"/release/escript_src_tests.tar.gz"), |
52 |
|
('doc', 'where the doc files will be installed', Dir('#.').abspath+'/release/doc'), |
53 |
|
|
54 |
# Compilation options |
# Compilation options |
55 |
BoolOption('dodebug', 'Do you want a debug build?', 'yes'), |
BoolOption('dodebug', 'Do you want a debug build?', 'no'), |
56 |
('options_file', "Optional file containing preferred options. Ignored if it doesn't exist (default: scons/hostname_options.py)", options_file), |
('options_file', "Optional file containing preferred options. Ignored if it doesn't exist (default: scons/hostname_options.py)", options_file), |
57 |
('cc_defines','C/C++ defines to use', None), |
('cc_defines','C/C++ defines to use', None), |
58 |
('cc_flags','C compiler flags to use (Release build)', None), |
('cc_flags','C compiler flags to use (Release build)', '-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas'), |
59 |
('cc_flags_debug', 'C compiler flags to use (Debug build)', None), |
('cc_flags_debug', 'C compiler flags to use (Debug build)', '-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas'), |
60 |
('cxx_flags', 'C++ compiler flags to use (Release build)', None), |
('cxx_flags', 'C++ compiler flags to use (Release build)', '--no-warn -ansi'), |
61 |
('cxx_flags_debug', 'C++ compiler flags to use (Debug build)', None), |
('cxx_flags_debug', 'C++ compiler flags to use (Debug build)', '--no-warn -ansi -DDOASSERT -DDOPROF'), |
62 |
('ar_flags', 'Static library archiver flags to use', None), |
('ar_flags', 'Static library archiver flags to use', None), |
63 |
('sys_libs', 'System libraries to link with', None), |
('sys_libs', 'System libraries to link with', None), |
64 |
|
('tar_flags','flags for zip files','-c -z'), |
65 |
# MKL |
# MKL |
66 |
PathOption('mkl_path', 'Path to MKL includes', None), |
PathOption('mkl_path', 'Path to MKL includes', None), |
67 |
PathOption('mkl_lib_path', 'Path to MKL libs', None), |
PathOption('mkl_lib_path', 'Path to MKL libs', None), |
83 |
PathOption('boost_path', 'Path to Boost includes', '/usr/include'), |
PathOption('boost_path', 'Path to Boost includes', '/usr/include'), |
84 |
PathOption('boost_lib_path', 'Path to Boost libs', '/usr/lib'), |
PathOption('boost_lib_path', 'Path to Boost libs', '/usr/lib'), |
85 |
('boost_lib', 'Boost libraries to link with', ['boost_python',]), |
('boost_lib', 'Boost libraries to link with', ['boost_python',]), |
|
# CppUnit |
|
|
PathOption('cppunit_path', 'Path to CppUnit includes', Dir('#.').abspath+'/tools/CppUnitTest/inc'), |
|
|
PathOption('cppunit_lib_path', 'Path to CppUnit libs', Dir('#.').abspath+'/lib'), |
|
|
('cppunit_lib', 'CppUnit libraries to link with', ['CppUnitTest',]), |
|
86 |
# Doc building |
# Doc building |
87 |
PathOption('doxygen_path', 'Path to Doxygen executable', None), |
PathOption('doxygen_path', 'Path to Doxygen executable', None), |
88 |
PathOption('epydoc_path', 'Path to Epydoc executable', None), |
PathOption('epydoc_path', 'Path to Epydoc executable', None), |
212 |
sys_libs = '' |
sys_libs = '' |
213 |
|
|
214 |
try: |
try: |
215 |
|
tar_flags = env['tar_flags'] |
216 |
|
env.Replace(TARFLAGS = tar_flags) |
217 |
|
except KeyError: |
218 |
|
pass |
219 |
|
|
220 |
|
try: |
221 |
includes = env['mkl_path'] |
includes = env['mkl_path'] |
222 |
env.Append(CPPPATH = [includes,]) |
env.Append(CPPPATH = [includes,]) |
223 |
except KeyError: |
except KeyError: |
224 |
pass |
pass |
225 |
|
|
226 |
try: |
try: |
227 |
lib_path = env['mkl_lib_path'] |
lib_path = env['mkl_lib_path'] |
228 |
env.Append(LIBPATH = [lib_path,]) |
env.Append(LIBPATH = [lib_path,]) |
229 |
except KeyError: |
except KeyError: |
230 |
pass |
pass |
231 |
|
|
232 |
try: |
try: |
233 |
mkl_libs = env['mkl_libs'] |
mkl_libs = env['mkl_libs'] |
234 |
except KeyError: |
except KeyError: |
276 |
except KeyError: |
except KeyError: |
277 |
boost_lib = None |
boost_lib = None |
278 |
try: |
try: |
|
includes = env['cppunit_path'] |
|
|
env.Append(CPPPATH = [includes,]) |
|
|
except KeyError: |
|
|
pass |
|
|
try: |
|
|
lib_path = env['cppunit_lib_path'] |
|
|
env.Append(LIBPATH = [lib_path,]) |
|
|
except KeyError: |
|
|
pass |
|
|
try: |
|
|
cppunit_lib = env['cppunit_lib'] |
|
|
except KeyError: |
|
|
boost_lib = None |
|
|
try: |
|
279 |
includes = env['python_path'] |
includes = env['python_path'] |
280 |
env.Append(CPPPATH = [includes,]) |
env.Append(CPPPATH = [includes,]) |
281 |
except KeyError: |
except KeyError: |
316 |
except KeyError: |
except KeyError: |
317 |
papi_libs = None |
papi_libs = None |
318 |
|
|
319 |
# Targets |
try: |
320 |
|
src_zipfile = env['src_zipfile'] |
321 |
|
except KeyError: |
322 |
|
src_zipfile = None |
323 |
|
|
324 |
|
|
325 |
|
try: |
326 |
|
test_zipfile = env['test_zipfile'] |
327 |
|
except KeyError: |
328 |
|
test_zipfile = None |
329 |
|
|
330 |
|
try: |
331 |
|
src_tarfile = env['src_tarfile'] |
332 |
|
except KeyError: |
333 |
|
src_tarfile = None |
334 |
|
|
335 |
|
|
336 |
|
try: |
337 |
|
test_tarfile = env['test_tarfile'] |
338 |
|
except KeyError: |
339 |
|
test_tarfile = None |
340 |
|
|
341 |
|
try: |
342 |
|
doc = env['doc'] |
343 |
|
except KeyError: |
344 |
|
doc = None |
345 |
|
|
346 |
|
# Zipgets |
347 |
env.Default(libinstall) |
env.Default(libinstall) |
348 |
env.Default(incinstall) |
env.Default(incinstall) |
349 |
env.Default(pyinstall) |
env.Default(pyinstall) |
350 |
|
env.Alias('release_src',[ src_zipfile, src_tarfile ]) |
351 |
|
env.Alias('release_tests',[ test_zipfile, test_tarfile]) |
352 |
|
env.Alias('release', ['release_src', 'release_tests']) |
353 |
|
env.Alias('docs') |
354 |
env.Alias('build_tests') |
env.Alias('build_tests') |
355 |
env.Alias('run_tests') |
env.Alias('build_py_tests') |
356 |
env.Alias('py_tests') |
env.Alias('local_py_tests') |
357 |
env.Alias('basic_py_tests') |
env.Alias('run_tests',['build_tests']) |
358 |
|
env.Alias('py_tests', ['build_py_tests']) |
359 |
env.Alias('all_tests', ['run_tests', 'py_tests']) |
env.Alias('all_tests', ['run_tests', 'py_tests']) |
360 |
|
|
361 |
# Python install - esys __init__.py |
# Python install - esys __init__.py |
365 |
|
|
366 |
# Allow sconscripts to see the env |
# Allow sconscripts to see the env |
367 |
Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", |
Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", |
368 |
"boost_lib", "python_lib", "doxygen_path", "epydoc_path", "epydoc_pythonpath", "papi_libs", "cppunit_lib", "sys_libs" ]) |
"boost_lib", "python_lib", "doxygen_path", "epydoc_path", "epydoc_pythonpath", "papi_libs", |
369 |
|
"sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "doc" ]) |
370 |
|
|
371 |
# End initialisation section |
# End initialisation section |
372 |
# Begin configuration section |
# Begin configuration section |
373 |
|
# adds this file and the scons option directore to the source tar |
374 |
|
release_srcfiles=[env.File('SConstruct'),]+[ env.File(x) for x in glob.glob('scons/*.py') ] |
375 |
|
release_testfiles=[env.File('README_TESTS'),] |
376 |
|
env.Zip(src_zipfile,release_srcfiles) |
377 |
|
env.Zip(test_zipfile, release_testfiles) |
378 |
|
env.Tar(src_tarfile, release_srcfiles) |
379 |
|
env.Tar(test_tarfile, release_testfiles) |
380 |
|
|
381 |
# Insert new components to be build here |
# Insert new components to be build here |
382 |
# FIXME: might be nice to replace this verbosity with a list of targets and some |
# FIXME: might be nice to replace this verbosity with a list of targets and some |
383 |
# FIXME: nifty python to create the lengthy but very similar env.Sconscript lines |
# FIXME: nifty python to create the lengthy but very similar env.Sconscript lines |
390 |
env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0) |
env.SConscript(dirs = ['esysUtils/src'], build_dir='build/$PLATFORM/esysUtils', duplicate=0) |
391 |
env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0) |
env.SConscript(dirs = ['finley/src'], build_dir='build/$PLATFORM/finley', duplicate=0) |
392 |
env.SConscript(dirs = ['modellib/py_src'], build_dir='build/$PLATFORM/modellib', duplicate=0) |
env.SConscript(dirs = ['modellib/py_src'], build_dir='build/$PLATFORM/modellib', duplicate=0) |
393 |
env.SConscript(dirs = ['pyvisi/py_src'], build_dir='build/$PLATFORM/pyvisi', duplicate=0) |
#env.SConscript(dirs = ['pyvisi/py_src'], build_dir='build/$PLATFORM/pyvisi', duplicate=0) |
394 |
|
|
395 |
# FIXME:need to be incorporated into build system |
# FIXME:need to be incorporated into build system |
|
# FIXME: 'pyvisi/SConstruct'] |
|
396 |
# FIXME: 'doc/SConstruct'] |
# FIXME: 'doc/SConstruct'] |
397 |
# FIXME: 'doc/SConstruct'] |
# FIXME: 'doc/SConstruct'] |