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

Contents of /trunk/weipa/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3107 - (show annotations)
Thu Aug 26 03:41:28 2010 UTC (9 years, 1 month ago) by caltinay
File size: 4038 byte(s)
Removed ugly #defines in favour of a class.

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

  ViewVC Help
Powered by ViewVC 1.1.26