1 |
libinstall = None |
2 |
incinstall = None |
3 |
|
4 |
Import('*') |
5 |
|
6 |
import os |
7 |
import string |
8 |
|
9 |
libname = 'finleycpp' |
10 |
|
11 |
finley_path = str(esysroot) + '/finley/src' |
12 |
finley_cppadapter_path = str(esysroot) + '/finley/src/CPPAdapter' |
13 |
paso_path = str(esysroot) + '/paso/src' |
14 |
escript_path = str(esysroot) + '/escript/src' |
15 |
esysUtils_path = str(esysroot) + '/esysUtils/src' |
16 |
|
17 |
esys_lib_path = str(esysroot) + '/lib' |
18 |
mmio_lib_path = str(esysroot) + '/tools/mmio/lib' |
19 |
esysUtils_lib_path = str(esysroot) + '/esysUtils/lib' |
20 |
|
21 |
esysUtils_lib = str(esysUtils_lib_path) + '/libesysUtils.a' |
22 |
escript_lib = str(esys_lib_path) + '/libescriptcpp.so' |
23 |
paso_lib = str(esys_lib_path) + '/libpaso.a' |
24 |
mmio_lib = str(mmio_lib_path) + '/libmmio.a' |
25 |
|
26 |
cpp_path = [finley_path, |
27 |
finley_cppadapter_path, |
28 |
paso_path, |
29 |
escript_path, |
30 |
esysUtils_path, |
31 |
python_path, |
32 |
boost_path] |
33 |
|
34 |
incs = ['Assemble.h', |
35 |
'ElementFile.h', |
36 |
'Finley.h', |
37 |
'FinleyVersion.h', |
38 |
'IndexList.h', |
39 |
'Mesh.h', |
40 |
'NodeFile.h', |
41 |
'Quadrature.h', |
42 |
'RectangularMesh.h', |
43 |
'ReferenceElements.h', |
44 |
'ShapeFunctions.h', |
45 |
'Util.h', |
46 |
# 'vtkCellType.h', |
47 |
'CPPAdapter/FinleyAdapterException.h', |
48 |
'CPPAdapter/FinleyError.h', |
49 |
'CPPAdapter/MeshAdapterFactory.h', |
50 |
'CPPAdapter/MeshAdapter.h', |
51 |
'CPPAdapter/SystemMatrixAdapter.h'] |
52 |
|
53 |
sources = ['Assemble_addToSystemMatrix.c', |
54 |
'Assemble_CopyElementData.c', |
55 |
'Assemble_CopyNodalData.c', |
56 |
'Assemble_getAssembleParameters.c', |
57 |
'Assemble_getSize.c', |
58 |
'Assemble_gradient.c', |
59 |
'Assemble_handelShapeMissMatch.c', |
60 |
'Assemble_integrate.c', |
61 |
'Assemble_interpolate.c', |
62 |
'Assemble_NodeCoordinates.c', |
63 |
'Assemble_PDE.c', |
64 |
'Assemble_PDEMatrix_Single2.c', |
65 |
'Assemble_PDEMatrix_System2.c', |
66 |
'Assemble_PDE_RHS.c', |
67 |
'Assemble_RHSMatrix_Single.c', |
68 |
'Assemble_RHSMatrix_System.c', |
69 |
'Assemble_RobinCondition.c', |
70 |
'Assemble_RobinCondition_RHS.c', |
71 |
'Assemble_setNormal.c', |
72 |
'ElementFile_allocTable.c', |
73 |
'ElementFile.c', |
74 |
'ElementFile_copyTable.c', |
75 |
'ElementFile_gather.c', |
76 |
'ElementFile_improveColoring.c', |
77 |
'ElementFile_markNodes.c', |
78 |
'ElementFile_optimizeDistribution.c', |
79 |
'ElementFile_prepare.c', |
80 |
'ElementFile_relableNodes.c', |
81 |
'ElementFile_scatter.c', |
82 |
'ElementFile_setNodeRange.c', |
83 |
'ElementFile_setCoordinates.c', |
84 |
'Finley.c', |
85 |
'IndexList.c', |
86 |
'Mesh.c', |
87 |
'Mesh_findMatchingFaces.c', |
88 |
'Mesh_getPattern.c', |
89 |
'Mesh_glueFaces.c', |
90 |
'Mesh_hex20.c', |
91 |
'Mesh_hex8.c', |
92 |
'Mesh_joinFaces.c', |
93 |
'Mesh_line2.c', |
94 |
'Mesh_line3.c', |
95 |
'Mesh_markNodes.c', |
96 |
'Mesh_merge.c', |
97 |
'Mesh_prepare.c', |
98 |
'Mesh_prepareNodes.c', |
99 |
'Mesh_print.c', |
100 |
'Mesh_read.c', |
101 |
'Mesh_rec4.c', |
102 |
'Mesh_rec8.c', |
103 |
'Mesh_relabelElementNodes.c', |
104 |
'Mesh_resolveNodeIds.c', |
105 |
'Mesh_saveDX.c', |
106 |
'Mesh_saveVTK.c', |
107 |
'Mesh_write.c', |
108 |
'Mesh_setCoordinates.c', |
109 |
'NodeFile_allocTable.c', |
110 |
'NodeFile.c', |
111 |
'NodeFile_copyTable.c', |
112 |
'NodeFile_gatter.c', |
113 |
'NodeFile_scatter.c', |
114 |
'NodeFile_setCoordinates.c', |
115 |
'NodeFile_setIdRange.c', |
116 |
'Quadrature.c', |
117 |
'ReferenceElements.c', |
118 |
'ShapeFunctions.c', |
119 |
'Util.c', |
120 |
'CPPAdapter/FinleyError.cpp', |
121 |
'CPPAdapter/MeshAdapter.cpp', |
122 |
'CPPAdapter/MeshAdapterFactory.cpp', |
123 |
'CPPAdapter/SystemMatrixAdapter.cpp', |
124 |
'CPPAdapter/finleycpp.cpp'] |
125 |
|
126 |
lib_path = [esys_lib_path, |
127 |
mmio_lib_path, |
128 |
esysUtils_lib_path, |
129 |
boost_lib_path] \ |
130 |
+ solver_lib_paths |
131 |
|
132 |
|
133 |
libs = ['escriptcpp', |
134 |
'esysUtils', |
135 |
'paso', |
136 |
'mmio', |
137 |
str(boost_lib), |
138 |
'dl', |
139 |
'util'] \ |
140 |
+ sys_libs \ |
141 |
+ solver_libs |
142 |
|
143 |
finley_env = Environment(ENV = os.environ) |
144 |
|
145 |
finley_env.Replace(CC = cc) |
146 |
finley_env.Replace(CXX = cxx) |
147 |
finley_env.Replace(CCFLAGS = cc_flags) |
148 |
finley_env.Replace(CXXFLAGS = cxx_flags) |
149 |
finley_env.Replace(SHOBJSUFFIX = '.lo') |
150 |
finley_env.Replace(CPPPATH = cpp_path) |
151 |
finley_env.Replace(LIBPATH = lib_path) |
152 |
finley_env.Replace(LIBS = libs) |
153 |
|
154 |
finley_lib = finley_env.SharedLibrary(libname, sources) |
155 |
|
156 |
Depends(finley_lib, esysUtils_lib) |
157 |
Depends(finley_lib, escript_lib) |
158 |
Depends(finley_lib, paso_lib) |
159 |
Depends(finley_lib, mmio_lib) |
160 |
|
161 |
Default(finley_env.Install(incdir, incs)) |
162 |
Default(finley_env.Install(incdir2, incs)) |
163 |
if incinstall != None: |
164 |
Default(finley_env.Install(incinstall, incs)) |
165 |
|
166 |
Default(finley_env.Install(libdir, finley_lib)) |
167 |
Default(finley_env.Install(libdir2, finley_lib)) |
168 |
if libinstall != None: |
169 |
Default(finley_env.Install(libinstall, finley_lib)) |