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

Contents of /trunk/scons/esys_options.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 481 - (show annotations)
Wed Feb 1 05:57:50 2006 UTC (13 years, 10 months ago) by jgs
File MIME type: text/x-python
File size: 2888 byte(s)
add mechanism to install .h files to inc directories
(still need to specify full lists of .h files to install)

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

  ViewVC Help
Powered by ViewVC 1.1.26