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

Annotation of /trunk/scons/esys_options.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 455 - (hide annotations)
Tue Jan 24 04:36:54 2006 UTC (13 years, 9 months ago) by jgs
File MIME type: text/x-python
File size: 2691 byte(s)
minor comment and formatting changes

1 gross 426 # 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 jgs 455 # standard gcc settings by importing gcc_options. If there is
4 gross 426 # a <hostname>_options file it is imported to set platform specific settings
5    
6 gross 425 # 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 jgs 455
56 gross 425 import sys
57 jgs 455
58     # set esysroot
59 gross 425 options_dir = Dir(esysroot + '/scons')
60     if sys.path.count(str(options_dir))==0: sys.path.append(str(options_dir))
61 jgs 455
62 gross 425 #
63     # ensure correct versions of python and scons
64     EnsurePythonVersion(2,3)
65     EnsureSConsVersion(0,96)
66 jgs 455
67 gross 425 #
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 jgs 455
77 gross 425 #
78     # try to import <hostname>_options
79     try:
80     exec "from gcc_options import *"
81     except ImportError:
82     pass
83 jgs 455
84 gross 425 #
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 jgs 455
94     #
95 gross 425 # import additional options:
96     if options!=None:
97     exec "from " + options + " import *"
98 jgs 455
99 gross 425 #
100     # use debug options:
101     if dodebug==1:
102     cxx_flags=cxx_flags_debug
103 gross 427 cc_flags=cc_flags_debug
104 jgs 455
105 gross 425 Export(["esysroot"])

  ViewVC Help
Powered by ViewVC 1.1.26