/[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 425 by gross, Tue Jan 10 04:10:39 2006 UTC revision 486 by jgs, Thu Feb 2 05:23:44 2006 UTC
# Line 1  Line 1 
1    # this code should be called by all esys13 scons builder and testing scripts
2    # it sets default values for relevant variables and overloads them with the
3    # standard gcc settings by importing gcc_options. If there is
4    # a <hostname>_options file it is imported to set platform specific settings
5    
6  # this is the general set up for the esys scons system:  # this is the general set up for the esys scons system:
7  libinstall = None  libinstall = None
8  pyinstall = None  pyinstall = None
9    incinstall = None
10  dodebug = 0  dodebug = 0
11    
12  # locations of libs etc used by mkl  # locations of libs etc used by mkl
# Line 13  scsl_path = '' Line 19  scsl_path = ''
19  scsl_lib_path = ''  scsl_lib_path = ''
20  scsl_libs = []  scsl_libs = []
21    
   
22  # locations of libs etc used by UMFPACK  # locations of libs etc used by UMFPACK
23  umfpack_path = ''  umfpack_path = ''
24  umfpack_lib_path = ''  umfpack_lib_path = ''
25  umfpack_libs = []  umfpack_libs = []
26    
   
27  # locations of include files for python  # locations of include files for python
28  python_path = Dir('/usr/include')  python_path = Dir('/usr/include')
29  python_lib_path =Dir('/usr/lib')  python_lib_path = Dir('/usr/lib')
30  python_lib = Library('python2.3')  python_lib = Library('python2.3')
31    
32  # locations of libraries for boost  # locations of libraries for boost
33  boost_path =Dir('/usr/include')  boost_path = Dir('/usr/include')
34  boost_lib_path =Dir('/usr/lib')  boost_lib_path = Dir('/usr/lib')
35  boost_lib = Library('boost_python')  boost_lib = Library('boost_python')
36    
37    # locations of doc building executables
38    doxygen_path = ''
39    epydoc_path = ''
40    
41  # names of c and c++ compilers to use  # names of c and c++ compilers to use
42  cc = 'gcc'  cc = 'gcc'
43  cxx = 'g++'  cxx = 'g++'
# Line 49  ar_flags = 'crus' Line 57  ar_flags = 'crus'
57  sys_libs = []  sys_libs = []
58    
59  #==== end of setting options ===========================================  #==== end of setting options ===========================================
60    
61  import sys  import sys
62  # set esys root  
63    # set esysroot
64  options_dir = Dir(esysroot + '/scons')  options_dir = Dir(esysroot + '/scons')
65  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))
66    
67  #  #
68  # ensure correct versions of python and scons  # ensure correct versions of python and scons
69  EnsurePythonVersion(2,3)  EnsurePythonVersion(2,3)
70  EnsureSConsVersion(0,96)  EnsureSConsVersion(0,96)
71  #  
 # import configuration variables passed in from  
 # calling SConscript (if any)  
72  #  #
73  # retreive command-line arguments if any and overwrite settings in <hostname>_options  # retreive command-line arguments if any and overwrite settings in <hostname>_options
74  usegcc = 0  usegcc = 0
75  options = None  options = None
76  if ARGUMENTS.get('libinstall',0): libinstall = ARGUMENTS.get('libinstall',0)  if ARGUMENTS.get('libinstall',0): libinstall = ARGUMENTS.get('libinstall',0)
77  if ARGUMENTS.get('pyinstall',0): pyinstall = ARGUMENTS.get('pyinstall',0)  if ARGUMENTS.get('pyinstall',0): pyinstall = ARGUMENTS.get('pyinstall',0)
78    if ARGUMENTS.get('incinstall',0): pyinstall = ARGUMENTS.get('incinstall',0)
79  if ARGUMENTS.get('debug',0): dodebug = 1  if ARGUMENTS.get('debug',0): dodebug = 1
80  if ARGUMENTS.get('options',0): options = ARGUMENTS.get('options',0)  if ARGUMENTS.get('options',0): options = ARGUMENTS.get('options',0)
81  if ARGUMENTS.get('usegcc',0): usegcc = 1  if ARGUMENTS.get('usegcc',0): usegcc = 1
82    
83  #  #
84  # try to import <hostname>_options  # try to import <hostname>_options
85  try:  try:
86      exec "from gcc_options import *"      exec "from gcc_options import *"
87  except ImportError:  except ImportError:
88      pass      pass
89    
90  #  #
91  # try to import <hostname>_options  # try to import <hostname>_options
92  if usegcc==0:  if usegcc==0:
# Line 84  if usegcc==0: Line 96  if usegcc==0:
96        exec "from "+hostname+"_options import *"        exec "from "+hostname+"_options import *"
97     except ImportError:     except ImportError:
98        pass        pass
99    
100    #
101  # import additional options:  # import additional options:
102  if options!=None:  if options!=None:
103    exec "from " + options + " import *"    exec "from " + options + " import *"
104    
105  #  #
106  # use debug options:  # use debug options:
107  if dodebug==1:  if dodebug==1:
108       cxx_flags=cxx_flags_debug       cxx_flags=cxx_flags_debug
109       c_flags=c_flags_debug       cc_flags=cc_flags_debug
110    
111  #  #
112  # export some stuff  # export configuration variables
113  Export(["esysroot"])  Export(["esysroot"])
114    Export(["libinstall"])
115    Export(["pyinstall"])
116    Export(["incinstall"])

Legend:
Removed from v.425  
changed lines
  Added in v.486

  ViewVC Help
Powered by ViewVC 1.1.26