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

Contents of /trunk/dudley/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3982 - (show annotations)
Fri Sep 21 03:23:22 2012 UTC (6 years, 10 months ago) by jfenwick
File size: 4746 byte(s)
More edits + removing pyvisi from trunk

1
2
3 ##############################################################################
4 #
5 # Copyright (c) 2003-2012 by University of Queensland
6 # http://www.uq.edu.au
7 #
8 # Primary Business: Queensland, Australia
9 # Licensed under the Open Software License version 3.0
10 # http://www.opensource.org/licenses/osl-3.0.php
11 #
12 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
13 # Development since 2012 by School of Earth Sciences
14 #
15 ##############################################################################
16
17
18 import os
19 Import('*')
20
21 local_env = env.Clone()
22 py_wrapper_local_env = env.Clone()
23 local_unroll_env = env.Clone()
24 local_unroll_env.Append(CFLAGS = env['dudley_assemble_flags'])
25
26
27 # Remove the sharedlibrary prefix on all platform - we don't want 'lib' mucking with our python modules
28 del py_wrapper_local_env['SHLIBPREFIX']
29
30 sources = """
31 Assemble_AverageElementData.c
32 Assemble_CopyElementData.c
33 Assemble_CopyNodalData.c
34 Assemble_LumpedSystem.c
35 Assemble_NodeCoordinates.c
36 Assemble_PDE.c
37 Assemble_PDE_Points.c
38 Assemble_PDE_Single2_2D.c
39 Assemble_PDE_Single2_3D.c
40 Assemble_PDE_System2_2D.c
41 Assemble_PDE_System2_3D.c
42 Assemble_addToSystemMatrix.c
43 Assemble_getAssembleParameters.c
44 Assemble_getSize.c
45 Assemble_integrate.c
46 Assemble_interpolate.c
47 Assemble_setNormal.c
48 ElementFile.c
49 ElementFile_allocTable.c
50 ElementFile_copyTable.c
51 ElementFile_createColoring.c
52 ElementFile_distributeByRankOfDOF.c
53 ElementFile_gather.c
54 ElementFile_jacobeans.c
55 ElementFile_markNodes.c
56 ElementFile_optimizeOrdering.c
57 ElementFile_relableNodes.c
58 ElementFile_scatter.c
59 ElementFile_setCoordinates.c
60 ElementFile_setNodeRange.c
61 ElementFile_setTags.c
62 ElementType.c
63 Dudley.c
64 IndexList.c
65 Mesh.c
66 Mesh_createNodeFileMappings.c
67 Mesh_distributeByRankOfDOF.c
68 Mesh_findMatchingFaces.c
69 Mesh_getPattern.c
70 Mesh_markNodes.c
71 Mesh_optimizeDOFDistribution.c
72 Mesh_optimizeDOFLabeling.c
73 Mesh_prepare.c
74 Mesh_print.c
75 Mesh_read.c
76 Mesh_readGmsh.c
77 Mesh_relableElementNodes.c
78 Mesh_resolveNodeIds.c
79 Mesh_saveDX.c
80 Mesh_setCoordinates.c
81 Mesh_tagmaps.c
82 Mesh_tet4.c
83 Mesh_tri3.c
84 Mesh_write.c
85 NodeFile.c
86 NodeFile_allocTable.c
87 NodeFile_copyTable.c
88 NodeFile_createDenseLabelings.c
89 NodeFile_gather.c
90 NodeFile_scatter.c
91 NodeFile_setCoordinates.c
92 NodeFile_setIdRange.c
93 NodeFile_setTags.c
94 NodeMapping.c
95 ShapeTable.c
96 TagMap.c
97 Util.c
98 CPPAdapter/DudleyAdapterException.cpp
99 CPPAdapter/DudleyError.cpp
100 CPPAdapter/MeshAdapter.cpp
101 CPPAdapter/MeshAdapterFactory.cpp
102 """.split()
103 unroll_sources= """
104 Assemble_gradient.c
105 Assemble_jacobeans.c
106 """.split()
107
108
109 headers = """
110 Assemble.h
111 Dudley.h
112 DudleyVersion.h
113 ElementFile.h
114 ElementType.h
115 IndexList.h
116 Mesh.h
117 NodeFile.h
118 NodeMapping.h
119 TriangularMesh.h
120 ShapeTable.h
121 TagMap.h
122 Util.h
123 """.split()
124 cppadapter_headers = """
125 CPPAdapter/DudleyAdapterException.h
126 CPPAdapter/DudleyError.h
127 CPPAdapter/MeshAdapter.h
128 CPPAdapter/MeshAdapterFactory.h
129 CPPAdapter/system_dep.h
130 """.split()
131
132 local_env.Prepend(LIBS = ['pasowrap', 'escript', 'paso', 'esysUtils'])
133
134 if IS_WINDOWS :
135 local_env.Append(CPPDEFINES = ['DUDLEY_EXPORTS'])
136
137 module_name = 'dudley'
138
139 un = [ local_unroll_env.SharedObject(x) for x in unroll_sources]
140
141 lib = local_env.SharedLibrary(module_name, sources+un)
142 env.Alias('build_dudley_lib', lib)
143
144 include_path = Dir('dudley', local_env['incinstall'])
145 cppadapter_include_path = Dir('CppAdapter', include_path)
146
147 hdr_inst1 = local_env.Install(include_path, headers )
148 hdr_inst2 = local_env.Install(cppadapter_include_path, cppadapter_headers )
149 env.Alias('install_dudley_headers', [hdr_inst1, hdr_inst2])
150
151 lib_inst = local_env.Install(local_env['libinstall'], lib)
152 env.Alias('install_dudley_lib', lib_inst)
153
154 ### Python wrapper ###
155 if not env['build_shared']:
156 py_wrapper_local_env.Prepend(LIBS = ['dudley', 'pasowrap', 'escript', 'esysUtils'])
157 else:
158 py_wrapper_local_env.Prepend(LIBS = ['dudley', 'pasowrap', 'escript', 'paso', 'esysUtils'])
159 py_wrapper_name = module_name + 'cpp'
160 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'CPPAdapter/dudleycpp.cpp')
161 env.Alias('build_dudleycpp_lib', py_wrapper_lib)
162
163 tmp_inst = os.path.join(local_env['pyinstall'], module_name)
164 if IS_WINDOWS:
165 wrapper_ext = '.pyd'
166 else:
167 wrapper_ext = '.so'
168
169 share_name = os.path.join(tmp_inst, py_wrapper_name+wrapper_ext)
170 mod_inst = py_wrapper_local_env.InstallAs(target=share_name,
171 source=py_wrapper_lib[0])
172 env.Alias('install_dudleycpp_lib', mod_inst)
173
174 # configure python module
175 local_env.SConscript(dirs = ['#/dudley/py_src'], variant_dir='py', duplicate=0)
176
177 # configure unit tests
178 local_env.SConscript(dirs = ['#/dudley/test'], variant_dir='$BUILD_DIR/$PLATFORM/dudley/test', duplicate=0, exports=['py_wrapper_lib'])
179

  ViewVC Help
Powered by ViewVC 1.1.26