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

Annotation of /trunk/weipa/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3096 - (hide annotations)
Thu Aug 19 01:40:52 2010 UTC (10 years, 3 months 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 caltinay 2184 ########################################################
2     #
3 jfenwick 2881 # Copyright (c) 2003-2010 by University of Queensland
4 caltinay 2184 # 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 caltinay 2810 local_env = clone_env(env_mpi)
18 caltinay 2812 py_wrapper_local_env = clone_env(env_mpi)
19 caltinay 2810
20 caltinay 2812 # 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 caltinay 2184 sources = """
25 caltinay 2810 DataVar.cpp
26     ElementData.cpp
27     EscriptDataset.cpp
28 caltinay 2812 FileSavers.cpp
29 caltinay 2810 FinleyMesh.cpp
30     NodeData.cpp
31 caltinay 3096 VisItControl.cpp
32 caltinay 2184 """.split()
33 caltinay 2812
34 caltinay 2184 headers = """
35 caltinay 2810 DataVar.h
36     ElementData.h
37     EscriptDataset.h
38 caltinay 2812 FileSavers.h
39 caltinay 2810 FinleyMesh.h
40     NodeData.h
41 caltinay 3096 VisItControl.h
42 caltinay 3037 weipa.h
43 caltinay 2184 """.split()
44    
45 caltinay 3096 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 caltinay 2893 local_env.AppendUnique(LIBS = ['esysUtils', 'finley', 'escript'] + env['sys_libs'])
52 caltinay 2811 if local_env['usesilo']:
53 caltinay 2910 local_env.Append(CPPDEFINES = ['USE_SILO'])
54 caltinay 2811 local_env.AppendUnique(LIBS = [env['silo_libs']])
55 caltinay 2184
56 caltinay 2810 if IS_WINDOWS_PLATFORM :
57 caltinay 3037 local_env.Append(CPPDEFINES = ['WEIPA_EXPORTS'])
58 caltinay 2184
59 caltinay 3037 module_name = 'weipa'
60 caltinay 2184
61 caltinay 2810 lib = local_env.SharedLibrary(module_name, sources)
62 caltinay 3037 env.Alias('target_weipa_so', lib)
63 caltinay 2184
64 caltinay 3037 include_path = Dir('weipa', local_env['incinstall'])
65 caltinay 2810
66 caltinay 2910 tmp = local_env.Install(include_path, headers)
67 caltinay 3037 env.Alias('target_install_weipa_headers', [tmp])
68 caltinay 2810
69 caltinay 2910 tmp = local_env.Install(local_env['libinstall'], lib)
70 caltinay 3037 env.Alias('target_install_weipa_so', tmp)
71 caltinay 2810
72 caltinay 2812 ### Python wrapper ###
73 caltinay 3037 py_wrapper_local_env.Append(LIBS = ['weipa'] + env['sys_libs'])
74 caltinay 2812 py_wrapper_name = module_name + 'cpp'
75 caltinay 3037 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'weipacpp.cpp')
76     env.Alias('target_weipacpp_so', py_wrapper_lib)
77 caltinay 2812
78 caltinay 3037 tmp_inst = os.path.join(local_env['pyinstall'], 'weipa')
79 caltinay 2812 #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 caltinay 3037 env.Alias('target_install_weipacpp_so', tmp3)
89 caltinay 2812
90 caltinay 2810 # 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 caltinay 2918 ######################
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 caltinay 2812 # Call the python SConscript
125 jfenwick 3078 CallSConscript(env,dirs = ['#/weipa/py_src'], variant_dir='py', duplicate=0)
126 caltinay 2812
127 caltinay 2810 # Call the unit tests SConscript
128 jfenwick 3078 #CallSConscript(local_env,dirs = ['#/weipa/test'], variant_dir='#/build/$PLATFORM/weipa/test', duplicate=0)
129 caltinay 2810

  ViewVC Help
Powered by ViewVC 1.1.26