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

Contents of /trunk/scons/esys_options.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 457 - (show annotations)
Tue Jan 24 06:13:03 2006 UTC (13 years, 10 months ago) by jgs
File MIME type: text/x-python
File size: 2736 byte(s)
fix installation to directories specified by pyinstall and libinstall

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

  ViewVC Help
Powered by ViewVC 1.1.26