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