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