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

Contents of /branches/split/weipa/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4724 - (show annotations)
Thu Mar 6 05:22:12 2014 UTC (5 years, 1 month ago) by jfenwick
File size: 4096 byte(s)
Work towards parallel domains

1 ##############################################################################
2 #
3 # Copyright (c) 2003-2014 by University of Queensland
4 # http://www.uq.edu.au
5 #
6 # Primary Business: Queensland, Australia
7 # Licensed under the Open Software License version 3.0
8 # http://www.opensource.org/licenses/osl-3.0.php
9 #
10 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
11 # Development 2012-2013 by School of Earth Sciences
12 # Development from 2014 by Centre for Geoscience Computing (GeoComp)
13 #
14 ##############################################################################
15
16 import os
17 Import('*')
18
19 local_env = env.Clone()
20 py_wrapper_local_env = env.Clone()
21
22 # Remove the shared library prefix on all platforms - we don't want 'lib'
23 # mucking with our python modules
24 del py_wrapper_local_env['SHLIBPREFIX']
25
26 sources = """
27 DataVar.cpp
28 EscriptDataset.cpp
29 FinleyDomain.cpp
30 FinleyElements.cpp
31 FinleyNodes.cpp
32 RipleyDomain.cpp
33 RipleyElements.cpp
34 RipleyNodes.cpp
35 VisItControl.cpp
36 """.split()
37
38 headers = """
39 DataVar.h
40 DomainChunk.h
41 ElementData.h
42 EscriptDataset.h
43 FinleyDomain.h
44 FinleyElements.h
45 FinleyNodes.h
46 NodeData.h
47 RipleyDomain.h
48 RipleyElements.h
49 RipleyNodes.h
50 VisItControl.h
51 vtkCellType.h
52 weipa.h
53 """.split()
54
55 if local_env['visit']:
56 sources.append(['VisItData.cpp'])
57 headers.append(['VisItData.h'])
58 local_env.Append(CPPDEFINES = ['USE_VISIT'])
59 local_env.AppendUnique(LIBS = ['simV2'])
60
61 if not env['build_shared']:
62 local_env.Prepend(LIBS = ['ripley', 'finley', 'dudley', 'escript'])
63 else:
64 local_env.Prepend(LIBS = ['ripley', 'finley', 'dudley', 'escript', 'esysUtils'])
65
66 if local_env['silo']:
67 local_env.Append(CPPDEFINES = ['USE_SILO'])
68 local_env.AppendUnique(LIBS = env['silo_libs'])
69
70 if IS_WINDOWS:
71 local_env.Append(CPPDEFINES = ['WEIPA_EXPORTS'])
72
73 module_name = 'weipa'
74
75 lib = local_env.SharedLibrary(module_name, sources)
76 env.Alias('build_weipa_lib', lib)
77
78 include_path = Dir('weipa', local_env['incinstall'])
79
80 hdr_inst = local_env.Install(include_path, headers)
81 env.Alias('install_weipa_headers', hdr_inst)
82
83 lib_inst = local_env.Install(local_env['libinstall'], lib)
84 env.Alias('install_weipa_lib', lib_inst)
85
86 ### Python wrapper ###
87 if not env['build_shared']:
88 py_wrapper_local_env.Prepend(LIBS = ['weipa', 'ripley', 'finley', 'dudley', 'escript'])
89 else:
90 py_wrapper_local_env.Prepend(LIBS = ['weipa', 'ripley', 'finley', 'dudley', 'escript', 'esysUtils'])
91
92 py_wrapper_name = module_name + 'cpp'
93 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'weipacpp.cpp')
94 env.Alias('build_weipacpp_lib', py_wrapper_lib)
95
96 tmp_inst = os.path.join(local_env['pyinstall'], module_name)
97 if IS_WINDOWS:
98 wrapper_ext = '.pyd'
99 else:
100 wrapper_ext = '.so'
101
102 share_name = os.path.join(tmp_inst, py_wrapper_name+wrapper_ext)
103 mod_inst = py_wrapper_local_env.InstallAs(target=share_name,
104 source=py_wrapper_lib[0])
105 env.Alias('install_weipacpp_lib', mod_inst)
106
107 ######################
108 ### Plugin library ###
109 ######################
110 visitplugin_env = env.Clone()
111 plugin_sources = """
112 DataVar.cpp
113 EscriptDataset.cpp
114 FinleyDomain.cpp
115 FinleyElements.cpp
116 FinleyNodes.cpp
117 """.split()
118
119 visitplugin_env.Prepend(LIBS = ['esysUtils'])
120 visitplugin_env.Append(CPPDEFINES = ['VISIT_PLUGIN'])
121 visitplugin_env['OBJPREFIX']='reader_'
122
123 if env['build_shared']:
124 plugin_lib = visitplugin_env.SharedLibrary('escriptreader', plugin_sources)
125 else:
126 if IS_WINDOWS:
127 visitplugin_env.Append(CPPDEFINES = ['WEIPA_STATIC_LIB'])
128 plugin_lib = visitplugin_env.StaticLibrary('escriptreader', plugin_sources)
129 env.Alias('build_escriptreader_lib', plugin_lib)
130
131 tmp = local_env.Install(local_env['libinstall'], plugin_lib)
132 env.Alias('install_escriptreader_lib', tmp)
133
134 # configure python module
135 local_env.SConscript(dirs = ['#/weipa/py_src'], variant_dir='py', duplicate=0, exports=['py_wrapper_lib'])
136
137 # configure unit tests
138 local_env.SConscript(dirs = ['#/weipa/test'], variant_dir='test', duplicate=0)
139

  ViewVC Help
Powered by ViewVC 1.1.26