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

Annotation of /trunk/scons/esys_options.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2548 - (hide annotations)
Mon Jul 20 06:20:06 2009 UTC (10 years, 3 months ago) by jfenwick
File MIME type: text/x-python
File size: 3847 byte(s)
Updating copyright notices
1 elspeth 645
2 ksteube 1810 ########################################################
3     #
4 jfenwick 2548 # Copyright (c) 2003-2009 by University of Queensland
5 ksteube 1810 # 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 elspeth 645
14    
15 gross 426 # 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 jgs 455 # standard gcc settings by importing gcc_options. If there is
18 gross 426 # a <hostname>_options file it is imported to set platform specific settings
19    
20 gross 425 # this is the general set up for the esys scons system:
21     libinstall = None
22     pyinstall = None
23 jgs 481 incinstall = None
24 ksteube 1705 usedebug = 0
25 gross 425
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 gross 805 # locations of libs etc used by BLAS
42     blas_path = ''
43     blas_lib_path = ''
44     blas_libs = []
45    
46 gross 425 # locations of include files for python
47     python_path = Dir('/usr/include')
48 jgs 486 python_lib_path = Dir('/usr/lib')
49 gross 584 python_lib = [ 'python2.3' ]
50 gross 425
51 gross 584 # locations of PAPI
52     papi_path = ''
53     papi_lib_path = ''
54     papi_libs = []
55    
56 gross 425 # locations of libraries for boost
57 gross 584 boost_path = '/usr/include'
58 ksteube 1250 boost_lib_path = '/usr/lib'
59     boost_lib = 'boost_python'
60 gross 425
61 gross 950 # locations of libraries for netCDF:
62 gross 1160 useNetCDF="yes"
63 gross 950 netCDF_path = '/usr/local/include'
64     netCDF_lib_path = '/usr/local/lib'
65 gross 1160 netCDF_libs = [ 'netcdf_c++', 'netcdf' ]
66 jgs 486 # locations of doc building executables
67     doxygen_path = ''
68     epydoc_path = ''
69    
70 gross 425 # 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 jgs 455
90 gross 425 import sys
91 jgs 455
92     # set esysroot
93 gross 425 options_dir = Dir(esysroot + '/scons')
94     if sys.path.count(str(options_dir))==0: sys.path.append(str(options_dir))
95 jgs 455
96 gross 425 #
97     # ensure correct versions of python and scons
98     EnsurePythonVersion(2,3)
99     EnsureSConsVersion(0,96)
100 jgs 455
101 gross 425 #
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 jgs 481 if ARGUMENTS.get('incinstall',0): pyinstall = ARGUMENTS.get('incinstall',0)
108 ksteube 1705 if ARGUMENTS.get('usedebug',0): usedebug = 1
109 gross 425 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 jgs 455
118 gross 425 #
119     # try to import <hostname>_options
120     if usegcc==0:
121     import socket
122 gross 619 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 gross 425 try:
130     exec "from "+hostname+"_options import *"
131     except ImportError:
132     pass
133 jgs 455
134     #
135 gross 425 # import additional options:
136     if options!=None:
137     exec "from " + options + " import *"
138 jgs 455
139 gross 425 #
140     # use debug options:
141 ksteube 1705 if usedebug==1:
142 gross 425 cxx_flags=cxx_flags_debug
143 gross 427 cc_flags=cc_flags_debug
144 jgs 455
145 jgs 481 #
146     # export configuration variables
147 gross 584 #
148 gross 425 Export(["esysroot"])
149 jgs 457 Export(["libinstall"])
150 gross 584 Export(["incinstall"])
151 jgs 457 Export(["pyinstall"])

  ViewVC Help
Powered by ViewVC 1.1.26