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 |
|
41 |
# names of c and c++ compilers to use |
42 |
cc = 'gcc' |
43 |
cxx = 'g++' |
44 |
|
45 |
# c flags to use |
46 |
cc_flags = '-O0 -std=c99 -fpic -W -Wall -Wno-unknown-pragmas' |
47 |
cc_flags_debug = '-g -O0 -std=c99 -fpic -W -Wall -Wno-unknown-pragmas' |
48 |
|
49 |
# c++ flags to use |
50 |
cxx_flags = '-O0 -ansi -fpic -W -Wall -Wno-unknown-pragmas' |
51 |
cxx_flags_debug = '-g -O0 -ansi -fpic -W -Wall -Wno-unknown-pragmas -DDOASSERT -DDOPROF' |
52 |
|
53 |
# static library archiver flags to use |
54 |
ar_flags = 'crus' |
55 |
|
56 |
# system specific libraries to link with |
57 |
sys_libs = [] |
58 |
|
59 |
#==== end of setting options =========================================== |
60 |
|
61 |
import sys |
62 |
|
63 |
# set esysroot |
64 |
options_dir = Dir(esysroot + '/scons') |
65 |
if sys.path.count(str(options_dir))==0: sys.path.append(str(options_dir)) |
66 |
|
67 |
# |
68 |
# ensure correct versions of python and scons |
69 |
EnsurePythonVersion(2,3) |
70 |
EnsureSConsVersion(0,96) |
71 |
|
72 |
# |
73 |
# retreive command-line arguments if any and overwrite settings in <hostname>_options |
74 |
usegcc = 0 |
75 |
options = None |
76 |
if ARGUMENTS.get('libinstall',0): libinstall = ARGUMENTS.get('libinstall',0) |
77 |
if ARGUMENTS.get('pyinstall',0): pyinstall = ARGUMENTS.get('pyinstall',0) |
78 |
if ARGUMENTS.get('incinstall',0): pyinstall = ARGUMENTS.get('incinstall',0) |
79 |
if ARGUMENTS.get('debug',0): dodebug = 1 |
80 |
if ARGUMENTS.get('options',0): options = ARGUMENTS.get('options',0) |
81 |
if ARGUMENTS.get('usegcc',0): usegcc = 1 |
82 |
|
83 |
# |
84 |
# try to import <hostname>_options |
85 |
try: |
86 |
exec "from gcc_options import *" |
87 |
except ImportError: |
88 |
pass |
89 |
|
90 |
# |
91 |
# try to import <hostname>_options |
92 |
if usegcc==0: |
93 |
import socket |
94 |
hostname = socket.gethostname() |
95 |
try: |
96 |
exec "from "+hostname+"_options import *" |
97 |
except ImportError: |
98 |
pass |
99 |
|
100 |
# |
101 |
# import additional options: |
102 |
if options!=None: |
103 |
exec "from " + options + " import *" |
104 |
|
105 |
# |
106 |
# use debug options: |
107 |
if dodebug==1: |
108 |
cxx_flags=cxx_flags_debug |
109 |
cc_flags=cc_flags_debug |
110 |
|
111 |
# |
112 |
# export configuration variables |
113 |
Export(["esysroot"]) |
114 |
Export(["libinstall"]) |
115 |
Export(["pyinstall"]) |
116 |
Export(["incinstall"]) |