/[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 427 by gross, Tue Jan 10 04:24:07 2006 UTC revision 1160 by gross, Wed May 23 00:44:01 2007 UTC
# Line 1  Line 1 
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  # 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  # it sets default values for relevant variables and overloads them with the
14  # standart gcc settings by importing gcc_options. If there is  # standard gcc settings by importing gcc_options. If there is
15  # a <hostname>_options file it is imported to set platform specific settings  # 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:  # this is the general set up for the esys scons system:
18  libinstall = None  libinstall = None
19  pyinstall = None  pyinstall = None
20    incinstall = None
21  dodebug = 0  dodebug = 0
22    
23  # locations of libs etc used by mkl  # locations of libs etc used by mkl
# Line 18  scsl_path = '' Line 30  scsl_path = ''
30  scsl_lib_path = ''  scsl_lib_path = ''
31  scsl_libs = []  scsl_libs = []
32    
   
33  # locations of libs etc used by UMFPACK  # locations of libs etc used by UMFPACK
34  umfpack_path = ''  umfpack_path = ''
35  umfpack_lib_path = ''  umfpack_lib_path = ''
36  umfpack_libs = []  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  # locations of include files for python
44  python_path = Dir('/usr/include')  python_path = Dir('/usr/include')
45  python_lib_path =Dir('/usr/lib')  python_lib_path = Dir('/usr/lib')
46  python_lib = Library('python2.3')  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  # locations of libraries for boost
54  boost_path =Dir('/usr/include')  boost_path = '/usr/include'
55  boost_lib_path =Dir('/usr/lib')  boost_libs_path = '/usr/lib'
56  boost_lib = Library('boost_python')  boost_libs = '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    epydoc_pythonpath = ''
67    
68  # names of c and c++ compilers to use  # names of c and c++ compilers to use
69  cc = 'gcc'  cc = 'gcc'
# Line 54  ar_flags = 'crus' Line 84  ar_flags = 'crus'
84  sys_libs = []  sys_libs = []
85    
86  #==== end of setting options ===========================================  #==== end of setting options ===========================================
87    
88  import sys  import sys
89  # set esys root  
90    # set esysroot
91  options_dir = Dir(esysroot + '/scons')  options_dir = Dir(esysroot + '/scons')
92  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))
93    
94  #  #
95  # ensure correct versions of python and scons  # ensure correct versions of python and scons
96  EnsurePythonVersion(2,3)  EnsurePythonVersion(2,3)
97  EnsureSConsVersion(0,96)  EnsureSConsVersion(0,96)
98  #  
 # import configuration variables passed in from  
 # calling SConscript (if any)  
99  #  #
100  # retreive command-line arguments if any and overwrite settings in <hostname>_options  # retreive command-line arguments if any and overwrite settings in <hostname>_options
101  usegcc = 0  usegcc = 0
102  options = None  options = None
103  if ARGUMENTS.get('libinstall',0): libinstall = ARGUMENTS.get('libinstall',0)  if ARGUMENTS.get('libinstall',0): libinstall = ARGUMENTS.get('libinstall',0)
104  if ARGUMENTS.get('pyinstall',0): pyinstall = ARGUMENTS.get('pyinstall',0)  if ARGUMENTS.get('pyinstall',0): pyinstall = ARGUMENTS.get('pyinstall',0)
105    if ARGUMENTS.get('incinstall',0): pyinstall = ARGUMENTS.get('incinstall',0)
106  if ARGUMENTS.get('debug',0): dodebug = 1  if ARGUMENTS.get('debug',0): dodebug = 1
107  if ARGUMENTS.get('options',0): options = ARGUMENTS.get('options',0)  if ARGUMENTS.get('options',0): options = ARGUMENTS.get('options',0)
108  if ARGUMENTS.get('usegcc',0): usegcc = 1  if ARGUMENTS.get('usegcc',0): usegcc = 1
# Line 80  try: Line 112  try:
112      exec "from gcc_options import *"      exec "from gcc_options import *"
113  except ImportError:  except ImportError:
114      pass      pass
115    
116  #  #
117  # try to import <hostname>_options  # try to import <hostname>_options
118  if usegcc==0:  if usegcc==0:
119     import socket     import socket
120     hostname = socket.gethostname()     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     try:     try:
128        exec "from "+hostname+"_options import *"        exec "from "+hostname+"_options import *"
129     except ImportError:     except ImportError:
130        pass        pass
131    
132    #
133  # import additional options:  # import additional options:
134  if options!=None:  if options!=None:
135    exec "from " + options + " import *"    exec "from " + options + " import *"
136    
137  #  #
138  # use debug options:  # use debug options:
139  if dodebug==1:  if dodebug==1:
140       cxx_flags=cxx_flags_debug       cxx_flags=cxx_flags_debug
141       cc_flags=cc_flags_debug       cc_flags=cc_flags_debug
142    
143    #
144    # export configuration variables
145  #  #
 # export some stuff  
146  Export(["esysroot"])  Export(["esysroot"])
147    Export(["libinstall"])
148    Export(["incinstall"])
149    Export(["pyinstall"])

Legend:
Removed from v.427  
changed lines
  Added in v.1160

  ViewVC Help
Powered by ViewVC 1.1.26