1 |
gross |
426 |
# 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 |
jgs |
455 |
# standard gcc settings by importing gcc_options. If there is |
4 |
gross |
426 |
# a <hostname>_options file it is imported to set platform specific settings |
5 |
|
|
|
6 |
gross |
425 |
# this is the general set up for the esys scons system: |
7 |
|
|
libinstall = None |
8 |
|
|
pyinstall = None |
9 |
jgs |
481 |
incinstall = None |
10 |
gross |
425 |
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 |
jgs |
486 |
python_lib_path = Dir('/usr/lib') |
30 |
gross |
425 |
python_lib = Library('python2.3') |
31 |
|
|
|
32 |
|
|
# locations of libraries for boost |
33 |
jgs |
486 |
boost_path = Dir('/usr/include') |
34 |
|
|
boost_lib_path = Dir('/usr/lib') |
35 |
gross |
425 |
boost_lib = Library('boost_python') |
36 |
|
|
|
37 |
jgs |
486 |
# locations of doc building executables |
38 |
|
|
doxygen_path = '' |
39 |
|
|
epydoc_path = '' |
40 |
|
|
|
41 |
gross |
425 |
# 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 |
jgs |
455 |
|
61 |
gross |
425 |
import sys |
62 |
jgs |
455 |
|
63 |
|
|
# set esysroot |
64 |
gross |
425 |
options_dir = Dir(esysroot + '/scons') |
65 |
|
|
if sys.path.count(str(options_dir))==0: sys.path.append(str(options_dir)) |
66 |
jgs |
455 |
|
67 |
gross |
425 |
# |
68 |
|
|
# ensure correct versions of python and scons |
69 |
|
|
EnsurePythonVersion(2,3) |
70 |
|
|
EnsureSConsVersion(0,96) |
71 |
jgs |
455 |
|
72 |
gross |
425 |
# |
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 |
jgs |
481 |
if ARGUMENTS.get('incinstall',0): pyinstall = ARGUMENTS.get('incinstall',0) |
79 |
gross |
425 |
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 |
jgs |
455 |
|
83 |
gross |
425 |
# |
84 |
|
|
# try to import <hostname>_options |
85 |
|
|
try: |
86 |
|
|
exec "from gcc_options import *" |
87 |
|
|
except ImportError: |
88 |
|
|
pass |
89 |
jgs |
455 |
|
90 |
gross |
425 |
# |
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 |
jgs |
455 |
|
100 |
|
|
# |
101 |
gross |
425 |
# import additional options: |
102 |
|
|
if options!=None: |
103 |
|
|
exec "from " + options + " import *" |
104 |
jgs |
455 |
|
105 |
gross |
425 |
# |
106 |
|
|
# use debug options: |
107 |
|
|
if dodebug==1: |
108 |
|
|
cxx_flags=cxx_flags_debug |
109 |
gross |
427 |
cc_flags=cc_flags_debug |
110 |
jgs |
455 |
|
111 |
jgs |
481 |
# |
112 |
|
|
# export configuration variables |
113 |
gross |
425 |
Export(["esysroot"]) |
114 |
jgs |
457 |
Export(["libinstall"]) |
115 |
|
|
Export(["pyinstall"]) |
116 |
jgs |
481 |
Export(["incinstall"]) |