/[escript]/trunk/weipa/src/SConscript
ViewVC logotype

Contents of /trunk/weipa/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3096 - (show annotations)
Thu Aug 19 01:40:52 2010 UTC (9 years, 1 month ago) by caltinay
File size: 4003 byte(s)
-New VisIt simulation control interface in weipa (uses VisIt's simv2)
-Rewrote restarts.py to be a more generic data manager for restarts and exports
-Removed weipa python file since the functionality is now handled by restarts.py

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 ElementData.cpp
27 EscriptDataset.cpp
28 FileSavers.cpp
29 FinleyMesh.cpp
30 NodeData.cpp
31 VisItControl.cpp
32 """.split()
33
34 headers = """
35 DataVar.h
36 ElementData.h
37 EscriptDataset.h
38 FileSavers.h
39 FinleyMesh.h
40 NodeData.h
41 VisItControl.h
42 weipa.h
43 """.split()
44
45 if local_env['usevisit']:
46 sources.append(['VisItData.cpp'])
47 headers.append(['VisItData.h'])
48 local_env.Append(CPPDEFINES = ['USE_VISIT'])
49 local_env.AppendUnique(LIBS = ['simV2'])
50
51 local_env.AppendUnique(LIBS = ['esysUtils', 'finley', 'escript'] + env['sys_libs'])
52 if local_env['usesilo']:
53 local_env.Append(CPPDEFINES = ['USE_SILO'])
54 local_env.AppendUnique(LIBS = [env['silo_libs']])
55
56 if IS_WINDOWS_PLATFORM :
57 local_env.Append(CPPDEFINES = ['WEIPA_EXPORTS'])
58
59 module_name = 'weipa'
60
61 lib = local_env.SharedLibrary(module_name, sources)
62 env.Alias('target_weipa_so', lib)
63
64 include_path = Dir('weipa', local_env['incinstall'])
65
66 tmp = local_env.Install(include_path, headers)
67 env.Alias('target_install_weipa_headers', [tmp])
68
69 tmp = local_env.Install(local_env['libinstall'], lib)
70 env.Alias('target_install_weipa_so', tmp)
71
72 ### Python wrapper ###
73 py_wrapper_local_env.Append(LIBS = ['weipa'] + env['sys_libs'])
74 py_wrapper_name = module_name + 'cpp'
75 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'weipacpp.cpp')
76 env.Alias('target_weipacpp_so', py_wrapper_lib)
77
78 tmp_inst = os.path.join(local_env['pyinstall'], 'weipa')
79 #windows specific mod
80 if os.name == 'nt':
81 wrapper_postfix = '.pyd'
82 else:
83 wrapper_postfix = '.so'
84
85 share_name = os.path.join(tmp_inst, py_wrapper_name + wrapper_postfix)
86 tmp3 = py_wrapper_local_env.InstallAs(target=share_name,
87 source=py_wrapper_lib[0])
88 env.Alias('target_install_weipacpp_so', tmp3)
89
90 # export the lib target since tests will depend on it
91 # the lib target is a list of file nodes (why? win32 produces more than one
92 # output file: .lib, .dll, .pdb)
93 # FIXME: This list handling produces the desired result but can this be done
94 # directly with scons File nodes?
95 dep_lib = [local_env['libinstall']+'/'+str(x) for x in lib]
96 Export('dep_lib')
97
98 ######################
99 ### Plugin library ###
100 ######################
101 # This is disabled on Windows since Scons complains about compiling the same
102 # files in the same build directory twice. The plugin is currently only for
103 # Linux anyway. Correct fix is probably a second SConscript file with different
104 # build_dir setting.
105 if not IS_WINDOWS_PLATFORM:
106 visitplugin_env = clone_env(env_mpi)
107 plugin_sources = """
108 DataVar.cpp
109 ElementData.cpp
110 EscriptDataset.cpp
111 FinleyMesh.cpp
112 NodeData.cpp
113 """.split()
114
115 visitplugin_env.AppendUnique(LIBS = ['esysUtils' ] + env['sys_libs'])
116 visitplugin_env.Append(CPPDEFINES = ['VISIT_PLUGIN'])
117
118 plugin_lib = visitplugin_env.StaticLibrary('escriptreader', plugin_sources)
119 env.Alias('target_escriptreader_a', plugin_lib)
120
121 tmp = local_env.Install(local_env['libinstall'], plugin_lib)
122 env.Alias('target_install_escriptreader_a', tmp)
123
124 # Call the python SConscript
125 CallSConscript(env,dirs = ['#/weipa/py_src'], variant_dir='py', duplicate=0)
126
127 # Call the unit tests SConscript
128 #CallSConscript(local_env,dirs = ['#/weipa/test'], variant_dir='#/build/$PLATFORM/weipa/test', duplicate=0)
129

  ViewVC Help
Powered by ViewVC 1.1.26