1 |
# this is the general set up for the esys scons system: |
2 |
libinstall = None |
3 |
pyinstall = None |
4 |
dodebug = 0 |
5 |
|
6 |
# locations of libs etc used by mkl |
7 |
mkl_path = '' |
8 |
mkl_lib_path = '' |
9 |
mkl_libs = [] |
10 |
|
11 |
# locations of libs etc used by SCSL |
12 |
scsl_path = '' |
13 |
scsl_lib_path = '' |
14 |
scsl_libs = [] |
15 |
|
16 |
|
17 |
# locations of libs etc used by UMFPACK |
18 |
umfpack_path = '' |
19 |
umfpack_lib_path = '' |
20 |
umfpack_libs = [] |
21 |
|
22 |
|
23 |
# locations of include files for python |
24 |
python_path = Dir('/usr/include') |
25 |
python_lib_path =Dir('/usr/lib') |
26 |
python_lib = Library('python2.3') |
27 |
|
28 |
# locations of libraries for boost |
29 |
boost_path =Dir('/usr/include') |
30 |
boost_lib_path =Dir('/usr/lib') |
31 |
boost_lib = Library('boost_python') |
32 |
|
33 |
# names of c and c++ compilers to use |
34 |
cc = 'gcc' |
35 |
cxx = 'g++' |
36 |
|
37 |
# c flags to use |
38 |
cc_flags = '-O0 -std=c99 -fpic -W -Wall -Wno-unknown-pragmas' |
39 |
cc_flags_debug = '-g -O0 -std=c99 -fpic -W -Wall -Wno-unknown-pragmas' |
40 |
|
41 |
# c++ flags to use |
42 |
cxx_flags = '-O0 -ansi -fpic -W -Wall -Wno-unknown-pragmas' |
43 |
cxx_flags_debug = '-g -O0 -ansi -fpic -W -Wall -Wno-unknown-pragmas -DDOASSERT -DDOPROF' |
44 |
|
45 |
# static library archiver flags to use |
46 |
ar_flags = 'crus' |
47 |
|
48 |
# system specific libraries to link with |
49 |
sys_libs = [] |
50 |
|
51 |
#==== end of setting options =========================================== |
52 |
import sys |
53 |
# set esys root |
54 |
options_dir = Dir(esysroot + '/scons') |
55 |
if sys.path.count(str(options_dir))==0: sys.path.append(str(options_dir)) |
56 |
# |
57 |
# ensure correct versions of python and scons |
58 |
EnsurePythonVersion(2,3) |
59 |
EnsureSConsVersion(0,96) |
60 |
# |
61 |
# import configuration variables passed in from |
62 |
# calling SConscript (if any) |
63 |
# |
64 |
# retreive command-line arguments if any and overwrite settings in <hostname>_options |
65 |
usegcc = 0 |
66 |
options = None |
67 |
if ARGUMENTS.get('libinstall',0): libinstall = ARGUMENTS.get('libinstall',0) |
68 |
if ARGUMENTS.get('pyinstall',0): pyinstall = ARGUMENTS.get('pyinstall',0) |
69 |
if ARGUMENTS.get('debug',0): dodebug = 1 |
70 |
if ARGUMENTS.get('options',0): options = ARGUMENTS.get('options',0) |
71 |
if ARGUMENTS.get('usegcc',0): usegcc = 1 |
72 |
# |
73 |
# try to import <hostname>_options |
74 |
try: |
75 |
exec "from gcc_options import *" |
76 |
except ImportError: |
77 |
pass |
78 |
# |
79 |
# try to import <hostname>_options |
80 |
if usegcc==0: |
81 |
import socket |
82 |
hostname = socket.gethostname() |
83 |
try: |
84 |
exec "from "+hostname+"_options import *" |
85 |
except ImportError: |
86 |
pass |
87 |
# import additional options: |
88 |
if options!=None: |
89 |
exec "from " + options + " import *" |
90 |
# |
91 |
# use debug options: |
92 |
if dodebug==1: |
93 |
cxx_flags=cxx_flags_debug |
94 |
c_flags=c_flags_debug |
95 |
# |
96 |
# export some stuff |
97 |
Export(["esysroot"]) |