/[escript]/trunk/scons/esys_options.py
ViewVC logotype

Contents of /trunk/scons/esys_options.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1250 - (show annotations)
Thu Aug 16 02:54:42 2007 UTC (11 years, 11 months ago) by ksteube
File MIME type: text/x-python
File size: 3860 byte(s)
Minor repairs to scons files

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

  ViewVC Help
Powered by ViewVC 1.1.26