1 |
elspeth |
645 |
|
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 |
gross |
426 |
# 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 |
jgs |
455 |
# standard gcc settings by importing gcc_options. If there is |
15 |
gross |
426 |
# a <hostname>_options file it is imported to set platform specific settings |
16 |
|
|
|
17 |
gross |
425 |
# this is the general set up for the esys scons system: |
18 |
|
|
libinstall = None |
19 |
|
|
pyinstall = None |
20 |
jgs |
481 |
incinstall = None |
21 |
gross |
425 |
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 |
gross |
805 |
# locations of libs etc used by BLAS |
39 |
|
|
blas_path = '' |
40 |
|
|
blas_lib_path = '' |
41 |
|
|
blas_libs = [] |
42 |
|
|
|
43 |
gross |
425 |
# locations of include files for python |
44 |
|
|
python_path = Dir('/usr/include') |
45 |
jgs |
486 |
python_lib_path = Dir('/usr/lib') |
46 |
gross |
584 |
python_lib = [ 'python2.3' ] |
47 |
gross |
425 |
|
48 |
gross |
584 |
# locations of PAPI |
49 |
|
|
papi_path = '' |
50 |
|
|
papi_lib_path = '' |
51 |
|
|
papi_libs = [] |
52 |
|
|
|
53 |
gross |
425 |
# locations of libraries for boost |
54 |
gross |
584 |
boost_path = '/usr/include' |
55 |
|
|
boost_lib_path = '/usr/lib' |
56 |
|
|
boost_lib = 'boost_python' |
57 |
gross |
425 |
|
58 |
jgs |
486 |
# locations of doc building executables |
59 |
|
|
doxygen_path = '' |
60 |
|
|
epydoc_path = '' |
61 |
jgs |
487 |
epydoc_pythonpath = '' |
62 |
jgs |
486 |
|
63 |
gross |
425 |
# names of c and c++ compilers to use |
64 |
|
|
cc = 'gcc' |
65 |
|
|
cxx = 'g++' |
66 |
|
|
|
67 |
|
|
# c flags to use |
68 |
|
|
cc_flags = '-O0 -std=c99 -fpic -W -Wall -Wno-unknown-pragmas' |
69 |
|
|
cc_flags_debug = '-g -O0 -std=c99 -fpic -W -Wall -Wno-unknown-pragmas' |
70 |
|
|
|
71 |
|
|
# c++ flags to use |
72 |
|
|
cxx_flags = '-O0 -ansi -fpic -W -Wall -Wno-unknown-pragmas' |
73 |
|
|
cxx_flags_debug = '-g -O0 -ansi -fpic -W -Wall -Wno-unknown-pragmas -DDOASSERT -DDOPROF' |
74 |
|
|
|
75 |
|
|
# static library archiver flags to use |
76 |
|
|
ar_flags = 'crus' |
77 |
|
|
|
78 |
|
|
# system specific libraries to link with |
79 |
|
|
sys_libs = [] |
80 |
|
|
|
81 |
|
|
#==== end of setting options =========================================== |
82 |
jgs |
455 |
|
83 |
gross |
425 |
import sys |
84 |
jgs |
455 |
|
85 |
|
|
# set esysroot |
86 |
gross |
425 |
options_dir = Dir(esysroot + '/scons') |
87 |
|
|
if sys.path.count(str(options_dir))==0: sys.path.append(str(options_dir)) |
88 |
jgs |
455 |
|
89 |
gross |
425 |
# |
90 |
|
|
# ensure correct versions of python and scons |
91 |
|
|
EnsurePythonVersion(2,3) |
92 |
|
|
EnsureSConsVersion(0,96) |
93 |
jgs |
455 |
|
94 |
gross |
425 |
# |
95 |
|
|
# retreive command-line arguments if any and overwrite settings in <hostname>_options |
96 |
|
|
usegcc = 0 |
97 |
|
|
options = None |
98 |
|
|
if ARGUMENTS.get('libinstall',0): libinstall = ARGUMENTS.get('libinstall',0) |
99 |
|
|
if ARGUMENTS.get('pyinstall',0): pyinstall = ARGUMENTS.get('pyinstall',0) |
100 |
jgs |
481 |
if ARGUMENTS.get('incinstall',0): pyinstall = ARGUMENTS.get('incinstall',0) |
101 |
gross |
425 |
if ARGUMENTS.get('debug',0): dodebug = 1 |
102 |
|
|
if ARGUMENTS.get('options',0): options = ARGUMENTS.get('options',0) |
103 |
|
|
if ARGUMENTS.get('usegcc',0): usegcc = 1 |
104 |
|
|
# |
105 |
|
|
# try to import <hostname>_options |
106 |
|
|
try: |
107 |
|
|
exec "from gcc_options import *" |
108 |
|
|
except ImportError: |
109 |
|
|
pass |
110 |
jgs |
455 |
|
111 |
gross |
425 |
# |
112 |
|
|
# try to import <hostname>_options |
113 |
|
|
if usegcc==0: |
114 |
|
|
import socket |
115 |
gross |
619 |
from string import ascii_letters,digits |
116 |
|
|
hostname="" |
117 |
|
|
for s in socket.gethostname().split('.')[0]: |
118 |
|
|
if s in ascii_letters+digits: |
119 |
|
|
hostname+=s |
120 |
|
|
else: |
121 |
|
|
hostname+="_" |
122 |
gross |
425 |
try: |
123 |
|
|
exec "from "+hostname+"_options import *" |
124 |
|
|
except ImportError: |
125 |
|
|
pass |
126 |
jgs |
455 |
|
127 |
|
|
# |
128 |
gross |
425 |
# import additional options: |
129 |
|
|
if options!=None: |
130 |
|
|
exec "from " + options + " import *" |
131 |
jgs |
455 |
|
132 |
gross |
425 |
# |
133 |
|
|
# use debug options: |
134 |
|
|
if dodebug==1: |
135 |
|
|
cxx_flags=cxx_flags_debug |
136 |
gross |
427 |
cc_flags=cc_flags_debug |
137 |
jgs |
455 |
|
138 |
jgs |
481 |
# |
139 |
|
|
# export configuration variables |
140 |
gross |
584 |
# |
141 |
gross |
425 |
Export(["esysroot"]) |
142 |
jgs |
457 |
Export(["libinstall"]) |
143 |
gross |
584 |
Export(["incinstall"]) |
144 |
jgs |
457 |
Export(["pyinstall"]) |