/[escript]/branches/scons_revamp_from_3210/weipa/src/SConscript
ViewVC logotype

Contents of /branches/scons_revamp_from_3210/weipa/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3212 - (show annotations)
Tue Sep 28 01:06:07 2010 UTC (10 years, 6 months ago) by caltinay
File size: 4063 byte(s)
First iteration:
- cleanup of main SConstruct file
- new template options file with commented options
- moved our extensions to the "proper" place according to scons docs
- fixed a regex issue in wrapper script
- this version works on guineapig and shake75

1 ########################################################
2 #
3 # Copyright (c) 2003-2010 by University of Queensland
4 # Earth Systems Science Computational Center (ESSCC)
5 # http://www.uq.edu.au/esscc
6 #
7 # Primary Business: Queensland, Australia
8 # Licensed under the Open Software License version 3.0
9 # http://www.opensource.org/licenses/osl-3.0.php
10 #
11 ########################################################
12
13
14 import os
15 Import('*')
16
17 local_env = clone_env(env_mpi)
18 py_wrapper_local_env = clone_env(env_mpi)
19
20 # Remove the shared library prefix on all platforms - we don't want 'lib'
21 # mucking with our python modules
22 del py_wrapper_local_env['SHLIBPREFIX']
23
24 sources = """
25 DataVar.cpp
26 EscriptDataset.cpp
27 FileWriter.cpp
28 FinleyDomain.cpp
29 FinleyElements.cpp
30 FinleyNodes.cpp
31 VisItControl.cpp
32 """.split()
33
34 headers = """
35 DataVar.h
36 DomainChunk.h
37 ElementData.h
38 EscriptDataset.h
39 FileWriter.h
40 FinleyDomain.h
41 FinleyElements.h
42 FinleyNodes.h
43 NodeData.h
44 VisItControl.h
45 weipa.h
46 """.split()
47
48 if local_env['visit']:
49 sources.append(['VisItData.cpp'])
50 headers.append(['VisItData.h'])
51 local_env.Append(CPPDEFINES = ['USE_VISIT'])
52 local_env.AppendUnique(LIBS = ['simV2'])
53
54 local_env.AppendUnique(LIBS = ['esysUtils', 'finley', 'escript'] + env['sys_libs'])
55 if local_env['silo']:
56 local_env.Append(CPPDEFINES = ['USE_SILO'])
57 local_env.AppendUnique(LIBS = [env['silo_libs']])
58
59 if IS_WINDOWS:
60 local_env.Append(CPPDEFINES = ['WEIPA_EXPORTS'])
61
62 module_name = 'weipa'
63
64 lib = local_env.SharedLibrary(module_name, sources)
65 env.Alias('target_weipa_so', lib)
66
67 include_path = Dir('weipa', local_env['incinstall'])
68
69 tmp = local_env.Install(include_path, headers)
70 env.Alias('target_install_weipa_headers', [tmp])
71
72 tmp = local_env.Install(local_env['libinstall'], lib)
73 env.Alias('target_install_weipa_so', tmp)
74
75 ### Python wrapper ###
76 py_wrapper_local_env.Append(LIBS = ['weipa', 'escript'] + env['sys_libs'])
77 py_wrapper_name = module_name + 'cpp'
78 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'weipacpp.cpp')
79 env.Alias('target_weipacpp_so', py_wrapper_lib)
80
81 tmp_inst = os.path.join(local_env['pyinstall'], 'weipa')
82 #windows specific mod
83 if os.name == 'nt':
84 wrapper_postfix = '.pyd'
85 else:
86 wrapper_postfix = '.so'
87
88 share_name = os.path.join(tmp_inst, py_wrapper_name + wrapper_postfix)
89 tmp3 = py_wrapper_local_env.InstallAs(target=share_name,
90 source=py_wrapper_lib[0])
91 env.Alias('target_install_weipacpp_so', tmp3)
92
93 # export the lib target since tests will depend on it
94 # the lib target is a list of file nodes (why? win32 produces more than one
95 # output file: .lib, .dll, .pdb)
96 # FIXME: This list handling produces the desired result but can this be done
97 # directly with scons File nodes?
98 dep_lib = [local_env['libinstall']+'/'+str(x) for x in lib]
99 Export('dep_lib')
100
101 ######################
102 ### Plugin library ###
103 ######################
104 # This is disabled on Windows since Scons complains about compiling the same
105 # files in the same build directory twice. The plugin is currently only for
106 # Linux anyway. Correct fix is probably a second SConscript file with different
107 # build_dir setting.
108 if not IS_WINDOWS:
109 visitplugin_env = clone_env(env_mpi)
110 plugin_sources = """
111 DataVar.cpp
112 EscriptDataset.cpp
113 FinleyDomain.cpp
114 FinleyElements.cpp
115 FinleyNodes.cpp
116 """.split()
117
118 visitplugin_env.AppendUnique(LIBS = ['esysUtils' ] + env['sys_libs'])
119 visitplugin_env.Append(CPPDEFINES = ['VISIT_PLUGIN'])
120
121 plugin_lib = visitplugin_env.StaticLibrary('escriptreader', plugin_sources)
122 env.Alias('target_escriptreader_a', plugin_lib)
123
124 tmp = local_env.Install(local_env['libinstall'], plugin_lib)
125 env.Alias('target_install_escriptreader_a', tmp)
126
127 # Call the python SConscript
128 CallSConscript(env,dirs = ['#/weipa/py_src'], variant_dir='py', duplicate=0)
129
130 # Call the unit tests SConscript
131 CallSConscript(local_env,dirs = ['#/weipa/test'], variant_dir='#/build/$PLATFORM/weipa/test', duplicate=0)
132

  ViewVC Help
Powered by ViewVC 1.1.26