/[escript]/trunk/finley/test/MeshAdapter/SConscript
ViewVC logotype

Annotation of /trunk/finley/test/MeshAdapter/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 325 - (hide annotations)
Wed Dec 7 02:08:17 2005 UTC (14 years, 2 months ago) by jgs
File size: 3408 byte(s)
now determine hostname via socket.gethostname() as HOSTNAME
environment variable is apparently not set on all platforms

1 jgs 228 # Scons configuration file for finley MeshAdapter unit tests
2 jgs 204
3     import os
4 jgs 228 import sys
5 jgs 204
6 jgs 228 #
7     # ensure correct versions of python and scons
8 jgs 204
9 jgs 228 EnsurePythonVersion(2,3)
10     EnsureSConsVersion(0,96)
11 jgs 204
12 jgs 228 #
13     # set appropriate defaults for configuration variables
14 jgs 204
15 jgs 228 esysroot = Dir('#../../..')
16     usegcc = 0
17 jgs 246 options = None
18 jgs 252 sys_libs = []
19 jgs 255 solver_libs = []
20 jgs 204
21 jgs 228 #
22 jgs 248 # import configuration variables passed in from
23     # calling SConscript (if any)
24    
25     Import('*')
26    
27     #
28 jgs 228 # retreive command-line arguments if any
29 jgs 204
30 jgs 228 if ARGUMENTS.get('usegcc',0):
31     usegcc = 1
32 jgs 204
33 jgs 246 if ARGUMENTS.get('options',0):
34     options = ARGUMENTS.get('options',0)
35    
36 jgs 228 #
37     # determine platform
38    
39     env = Environment(ENV = os.environ)
40     platform = env['PLATFORM']
41    
42     #
43     # determine hostname
44    
45 jgs 325 import socket
46     hostname = socket.gethostname()
47 jgs 228
48     #
49     # load configuration settings
50    
51     options_dir = str(esysroot) + '/scons'
52     sys.path.append(options_dir)
53    
54 jgs 309 from default_options import *
55    
56 jgs 228 if hostname=='ess':
57     from ess_options import *
58    
59 jgs 241 if usegcc==1:
60     from gcc_options import *
61    
62 jgs 246 if options!=None:
63     exec "from " + options + " import *"
64    
65 jgs 228 cxx_flags=cxx_flags_debug
66    
67     #
68     # print out build configuration for this module
69    
70     print "Build configuration for module: MeshAdapter unit tests"
71     print " dodebug: 1"
72     print " usegcc: ", usegcc
73     print " cxx: ", cxx
74     print " platform: ", platform
75     print " hostname: ", hostname
76    
77     #
78     # do the actual build
79    
80 jgs 204 meshadapter_test_path = str(esysroot) + '/finley/test/MeshAdapter'
81     escript_path = str(esysroot) + '/escript/inc'
82 jgs 205 finley_path = str(esysroot) + '/finley/src/finley'
83     finley_cppadapter_path = str(esysroot) + '/finley/src/finley/CPPAdapter'
84 jgs 204 paso_path = str(esysroot) + '/paso/inc'
85     mmio_path = str(esysroot) + '/tools/mmio/inc'
86     esysUtils_path = str(esysroot) + '/esysUtils/inc'
87     CppUnitTest_path = str(esysroot) + '/tools/CppUnitTest/inc'
88    
89     esys_lib_path = str(esysroot) + '/lib'
90     finley_lib_path = str(esysroot) + '/finley/lib'
91     mmio_lib_path = str(esysroot) + '/tools/mmio/lib'
92     esysUtils_lib_path = str(esysroot) + '/esysUtils/lib'
93     CppUnitTest_lib_path = str(esysroot) + '/tools/CppUnitTest/lib'
94    
95 jgs 288 finley_lib = str(esys_lib_path) + '/libfinleycpp.so'
96    
97     install_dir = str(esysroot) + '/finley/test'
98    
99 jgs 204 cpp_path = [meshadapter_test_path,
100     escript_path,
101     finley_path,
102 jgs 205 finley_cppadapter_path,
103 jgs 204 paso_path,
104     mmio_path,
105     esysUtils_path,
106     CppUnitTest_path,
107     python_path,
108     boost_path]
109    
110     lib_path = [esys_lib_path,
111     finley_lib_path,
112     mmio_lib_path,
113     esysUtils_lib_path,
114     CppUnitTest_lib_path,
115     python_lib_path,
116     boost_lib_path]
117    
118     libs = ['escriptcpp',
119     'esysUtils',
120 jgs 205 'finleycpp',
121 jgs 204 'paso',
122     'mmio',
123     'CppUnitTest',
124 jgs 239 str(python_lib),
125     str(boost_lib),
126 jgs 204 'dl',
127 jgs 252 'util']
128 jgs 204
129 jgs 252 libs.extend(sys_libs)
130 jgs 255 libs.extend(solver_libs)
131 jgs 252
132 jgs 204 sources = ['MeshAdapterTestCase.cpp',
133     'MeshAdapterTest.cpp']
134    
135     target = 'MeshAdapterTest.exe'
136    
137     meshadapter_env = Environment(ENV = os.environ)
138    
139 jgs 228 meshadapter_env.Replace(CXX = cxx)
140 jgs 204 meshadapter_env.Replace(CXXFLAGS = cxx_flags)
141     meshadapter_env.Replace(CPPPATH = cpp_path)
142     meshadapter_env.Replace(LIBPATH = lib_path)
143     meshadapter_env.Replace(LIBS = libs)
144    
145     meshadapter_test_exe = meshadapter_env.Program(target, sources)
146 jgs 288
147     Depends(meshadapter_test_exe, finley_lib)
148    
149     meshadapter_env.Install(install_dir, meshadapter_test_exe)

  ViewVC Help
Powered by ViewVC 1.1.26