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

Contents of /trunk/scons/esys_options.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 426 - (show annotations)
Tue Jan 10 04:17:43 2006 UTC (13 years, 9 months ago) by gross
File MIME type: text/x-python
File size: 2783 byte(s)
some commends added

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 # standart 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:
7 libinstall = None
8 pyinstall = None
9 dodebug = 0
10
11 # locations of libs etc used by mkl
12 mkl_path = ''
13 mkl_lib_path = ''
14 mkl_libs = []
15
16 # locations of libs etc used by SCSL
17 scsl_path = ''
18 scsl_lib_path = ''
19 scsl_libs = []
20
21
22 # locations of libs etc used by UMFPACK
23 umfpack_path = ''
24 umfpack_lib_path = ''
25 umfpack_libs = []
26
27
28 # locations of include files for python
29 python_path = Dir('/usr/include')
30 python_lib_path =Dir('/usr/lib')
31 python_lib = Library('python2.3')
32
33 # locations of libraries for boost
34 boost_path =Dir('/usr/include')
35 boost_lib_path =Dir('/usr/lib')
36 boost_lib = Library('boost_python')
37
38 # names of c and c++ compilers to use
39 cc = 'gcc'
40 cxx = 'g++'
41
42 # c flags to use
43 cc_flags = '-O0 -std=c99 -fpic -W -Wall -Wno-unknown-pragmas'
44 cc_flags_debug = '-g -O0 -std=c99 -fpic -W -Wall -Wno-unknown-pragmas'
45
46 # c++ flags to use
47 cxx_flags = '-O0 -ansi -fpic -W -Wall -Wno-unknown-pragmas'
48 cxx_flags_debug = '-g -O0 -ansi -fpic -W -Wall -Wno-unknown-pragmas -DDOASSERT -DDOPROF'
49
50 # static library archiver flags to use
51 ar_flags = 'crus'
52
53 # system specific libraries to link with
54 sys_libs = []
55
56 #==== end of setting options ===========================================
57 import sys
58 # set esys root
59 options_dir = Dir(esysroot + '/scons')
60 if sys.path.count(str(options_dir))==0: sys.path.append(str(options_dir))
61 #
62 # ensure correct versions of python and scons
63 EnsurePythonVersion(2,3)
64 EnsureSConsVersion(0,96)
65 #
66 # import configuration variables passed in from
67 # calling SConscript (if any)
68 #
69 # retreive command-line arguments if any and overwrite settings in <hostname>_options
70 usegcc = 0
71 options = None
72 if ARGUMENTS.get('libinstall',0): libinstall = ARGUMENTS.get('libinstall',0)
73 if ARGUMENTS.get('pyinstall',0): pyinstall = ARGUMENTS.get('pyinstall',0)
74 if ARGUMENTS.get('debug',0): dodebug = 1
75 if ARGUMENTS.get('options',0): options = ARGUMENTS.get('options',0)
76 if ARGUMENTS.get('usegcc',0): usegcc = 1
77 #
78 # try to import <hostname>_options
79 try:
80 exec "from gcc_options import *"
81 except ImportError:
82 pass
83 #
84 # try to import <hostname>_options
85 if usegcc==0:
86 import socket
87 hostname = socket.gethostname()
88 try:
89 exec "from "+hostname+"_options import *"
90 except ImportError:
91 pass
92 # import additional options:
93 if options!=None:
94 exec "from " + options + " import *"
95 #
96 # use debug options:
97 if dodebug==1:
98 cxx_flags=cxx_flags_debug
99 c_flags=c_flags_debug
100 #
101 # export some stuff
102 Export(["esysroot"])

  ViewVC Help
Powered by ViewVC 1.1.26