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

Annotation of /trunk/scons/esys_options.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1160 - (hide annotations)
Wed May 23 00:44:01 2007 UTC (12 years, 4 months ago) by gross
File MIME type: text/x-python
File size: 3885 byte(s)
The OMP_NUM_THREADS environment variable is now imported into the scons evironment.
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 ksteube 1139 boost_libs_path = '/usr/lib'
56     boost_libs = 'boost_python'
57 gross 425
58 gross 950 # locations of libraries for netCDF:
59 gross 1160 useNetCDF="yes"
60 gross 950 netCDF_path = '/usr/local/include'
61     netCDF_lib_path = '/usr/local/lib'
62 gross 1160 netCDF_libs = [ 'netcdf_c++', 'netcdf' ]
63 jgs 486 # locations of doc building executables
64     doxygen_path = ''
65     epydoc_path = ''
66 jgs 487 epydoc_pythonpath = ''
67 jgs 486
68 gross 425 # names of c and c++ compilers to use
69     cc = 'gcc'
70     cxx = 'g++'
71    
72     # c flags to use
73     cc_flags = '-O0 -std=c99 -fpic -W -Wall -Wno-unknown-pragmas'
74     cc_flags_debug = '-g -O0 -std=c99 -fpic -W -Wall -Wno-unknown-pragmas'
75    
76     # c++ flags to use
77     cxx_flags = '-O0 -ansi -fpic -W -Wall -Wno-unknown-pragmas'
78     cxx_flags_debug = '-g -O0 -ansi -fpic -W -Wall -Wno-unknown-pragmas -DDOASSERT -DDOPROF'
79    
80     # static library archiver flags to use
81     ar_flags = 'crus'
82    
83     # system specific libraries to link with
84     sys_libs = []
85    
86     #==== end of setting options ===========================================
87 jgs 455
88 gross 425 import sys
89 jgs 455
90     # set esysroot
91 gross 425 options_dir = Dir(esysroot + '/scons')
92     if sys.path.count(str(options_dir))==0: sys.path.append(str(options_dir))
93 jgs 455
94 gross 425 #
95     # ensure correct versions of python and scons
96     EnsurePythonVersion(2,3)
97     EnsureSConsVersion(0,96)
98 jgs 455
99 gross 425 #
100     # retreive command-line arguments if any and overwrite settings in <hostname>_options
101     usegcc = 0
102     options = None
103     if ARGUMENTS.get('libinstall',0): libinstall = ARGUMENTS.get('libinstall',0)
104     if ARGUMENTS.get('pyinstall',0): pyinstall = ARGUMENTS.get('pyinstall',0)
105 jgs 481 if ARGUMENTS.get('incinstall',0): pyinstall = ARGUMENTS.get('incinstall',0)
106 gross 425 if ARGUMENTS.get('debug',0): dodebug = 1
107     if ARGUMENTS.get('options',0): options = ARGUMENTS.get('options',0)
108     if ARGUMENTS.get('usegcc',0): usegcc = 1
109     #
110     # try to import <hostname>_options
111     try:
112     exec "from gcc_options import *"
113     except ImportError:
114     pass
115 jgs 455
116 gross 425 #
117     # try to import <hostname>_options
118     if usegcc==0:
119     import socket
120 gross 619 from string import ascii_letters,digits
121     hostname=""
122     for s in socket.gethostname().split('.')[0]:
123     if s in ascii_letters+digits:
124     hostname+=s
125     else:
126     hostname+="_"
127 gross 425 try:
128     exec "from "+hostname+"_options import *"
129     except ImportError:
130     pass
131 jgs 455
132     #
133 gross 425 # import additional options:
134     if options!=None:
135     exec "from " + options + " import *"
136 jgs 455
137 gross 425 #
138     # use debug options:
139     if dodebug==1:
140     cxx_flags=cxx_flags_debug
141 gross 427 cc_flags=cc_flags_debug
142 jgs 455
143 jgs 481 #
144     # export configuration variables
145 gross 584 #
146 gross 425 Export(["esysroot"])
147 jgs 457 Export(["libinstall"])
148 gross 584 Export(["incinstall"])
149 jgs 457 Export(["pyinstall"])

  ViewVC Help
Powered by ViewVC 1.1.26