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