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

Diff of /trunk/scons/esys_options.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 426 by gross, Tue Jan 10 04:17:43 2006 UTC revision 1810 by ksteube, Thu Sep 25 06:53:26 2008 UTC
# Line 1  Line 1 
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  # 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  # it sets default values for relevant variables and overloads them with the
17  # standart gcc settings by importing gcc_options. If there is  # standard gcc settings by importing gcc_options. If there is
18  # a <hostname>_options file it is imported to set platform specific settings  # 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:  # this is the general set up for the esys scons system:
21  libinstall = None  libinstall = None
22  pyinstall = None  pyinstall = None
23  dodebug = 0  incinstall = None
24    usedebug = 0
25    
26  # locations of libs etc used by mkl  # locations of libs etc used by mkl
27  mkl_path = ''  mkl_path = ''
# Line 18  scsl_path = '' Line 33  scsl_path = ''
33  scsl_lib_path = ''  scsl_lib_path = ''
34  scsl_libs = []  scsl_libs = []
35    
   
36  # locations of libs etc used by UMFPACK  # locations of libs etc used by UMFPACK
37  umfpack_path = ''  umfpack_path = ''
38  umfpack_lib_path = ''  umfpack_lib_path = ''
39  umfpack_libs = []  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  # locations of include files for python
47  python_path = Dir('/usr/include')  python_path = Dir('/usr/include')
48  python_lib_path =Dir('/usr/lib')  python_lib_path = Dir('/usr/lib')
49  python_lib = Library('python2.3')  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  # locations of libraries for boost
57  boost_path =Dir('/usr/include')  boost_path = '/usr/include'
58  boost_lib_path =Dir('/usr/lib')  boost_lib_path = '/usr/lib'
59  boost_lib = Library('boost_python')  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  # names of c and c++ compilers to use
71  cc = 'gcc'  cc = 'gcc'
# Line 54  ar_flags = 'crus' Line 86  ar_flags = 'crus'
86  sys_libs = []  sys_libs = []
87    
88  #==== end of setting options ===========================================  #==== end of setting options ===========================================
89    
90  import sys  import sys
91  # set esys root  
92    # set esysroot
93  options_dir = Dir(esysroot + '/scons')  options_dir = Dir(esysroot + '/scons')
94  if sys.path.count(str(options_dir))==0: sys.path.append(str(options_dir))  if sys.path.count(str(options_dir))==0: sys.path.append(str(options_dir))
95    
96  #  #
97  # ensure correct versions of python and scons  # ensure correct versions of python and scons
98  EnsurePythonVersion(2,3)  EnsurePythonVersion(2,3)
99  EnsureSConsVersion(0,96)  EnsureSConsVersion(0,96)
100  #  
 # import configuration variables passed in from  
 # calling SConscript (if any)  
101  #  #
102  # retreive command-line arguments if any and overwrite settings in <hostname>_options  # retreive command-line arguments if any and overwrite settings in <hostname>_options
103  usegcc = 0  usegcc = 0
104  options = None  options = None
105  if ARGUMENTS.get('libinstall',0): libinstall = ARGUMENTS.get('libinstall',0)  if ARGUMENTS.get('libinstall',0): libinstall = ARGUMENTS.get('libinstall',0)
106  if ARGUMENTS.get('pyinstall',0): pyinstall = ARGUMENTS.get('pyinstall',0)  if ARGUMENTS.get('pyinstall',0): pyinstall = ARGUMENTS.get('pyinstall',0)
107  if ARGUMENTS.get('debug',0): dodebug = 1  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)  if ARGUMENTS.get('options',0): options = ARGUMENTS.get('options',0)
110  if ARGUMENTS.get('usegcc',0): usegcc = 1  if ARGUMENTS.get('usegcc',0): usegcc = 1
111  #  #
# Line 80  try: Line 114  try:
114      exec "from gcc_options import *"      exec "from gcc_options import *"
115  except ImportError:  except ImportError:
116      pass      pass
117    
118  #  #
119  # try to import <hostname>_options  # try to import <hostname>_options
120  if usegcc==0:  if usegcc==0:
121     import socket     import socket
122     hostname = socket.gethostname()     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:     try:
130        exec "from "+hostname+"_options import *"        exec "from "+hostname+"_options import *"
131     except ImportError:     except ImportError:
132        pass        pass
133    
134    #
135  # import additional options:  # import additional options:
136  if options!=None:  if options!=None:
137    exec "from " + options + " import *"    exec "from " + options + " import *"
138    
139  #  #
140  # use debug options:  # use debug options:
141  if dodebug==1:  if usedebug==1:
142       cxx_flags=cxx_flags_debug       cxx_flags=cxx_flags_debug
143       c_flags=c_flags_debug       cc_flags=cc_flags_debug
144    
145    #
146    # export configuration variables
147  #  #
 # export some stuff  
148  Export(["esysroot"])  Export(["esysroot"])
149    Export(["libinstall"])
150    Export(["incinstall"])
151    Export(["pyinstall"])

Legend:
Removed from v.426  
changed lines
  Added in v.1810

  ViewVC Help
Powered by ViewVC 1.1.26