/[escript]/branches/scons-dev/finley/src/SConscript
ViewVC logotype

Contents of /branches/scons-dev/finley/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1699 - (show annotations)
Thu Aug 14 02:38:23 2008 UTC (14 years, 7 months ago) by ksteube
File size: 4939 byte(s)
Fixed InstallAs target for Windows (removed escriptcpp.pyd since this
file is not created).
Added new config variable cc_extra to add some C/C++ options without
having to change everything.

1 #
2 # $Id$
3 #
4 #######################################################
5 #
6 # Copyright 2003-2007 by ACceSS MNRF
7 # Copyright 2007 by University of Queensland
8 #
9 # http://esscc.uq.edu.au
10 # Primary Business: Queensland, Australia
11 # Licensed under the Open Software License version 3.0
12 # http://www.opensource.org/licenses/osl-3.0.php
13 #
14 #######################################################
15 #
16
17 import os
18 Import('*')
19
20 local_env = clone_env(env_mpi)
21
22 if 'Clone' in dir(env): py_wrapper_local_env = env_mpi.Clone() # scons-0.98
23 else: py_wrapper_local_env = env_mpi.Copy() # scons-0.96
24
25 # Remove the sharedlibrary prefix on all platform - we don't want 'lib' mucking with our python modules
26 del py_wrapper_local_env['SHLIBPREFIX']
27
28 sources = """
29 Assemble_AverageElementData.c
30 Assemble_CopyElementData.c
31 Assemble_CopyNodalData.c
32 Assemble_LumpedSystem.c
33 Assemble_NodeCoordinates.c
34 Assemble_PDE.c
35 Assemble_PDE_Single2_1D.c
36 Assemble_PDE_Single2_2D.c
37 Assemble_PDE_Single2_3D.c
38 Assemble_PDE_Single2_C.c
39 Assemble_PDE_System2_1D.c
40 Assemble_PDE_System2_2D.c
41 Assemble_PDE_System2_3D.c
42 Assemble_PDE_System2_C.c
43 Assemble_addToSystemMatrix.c
44 Assemble_getAssembleParameters.c
45 Assemble_getSize.c
46 Assemble_gradient.c
47 Assemble_integrate.c
48 Assemble_interpolate.c
49 Assemble_jacobeans.c
50 Assemble_setNormal.c
51 ElementFile.c
52 ElementFile_allocTable.c
53 ElementFile_copyTable.c
54 ElementFile_createColoring.c
55 ElementFile_distributeByRankOfDOF.c
56 ElementFile_gather.c
57 ElementFile_jacobeans.c
58 ElementFile_markNodes.c
59 ElementFile_optimizeOrdering.c
60 ElementFile_relableNodes.c
61 ElementFile_scatter.c
62 ElementFile_setCoordinates.c
63 ElementFile_setNodeRange.c
64 ElementFile_setTags.c
65 Finley.c
66 IndexList.c
67 Mesh.c
68 Mesh_createNodeFileMappings.c
69 Mesh_distributeByRankOfDOF.c
70 Mesh_findMatchingFaces.c
71 Mesh_getPattern.c
72 Mesh_glueFaces.c
73 Mesh_hex20.c
74 Mesh_hex8.c
75 Mesh_joinFaces.c
76 Mesh_markNodes.c
77 Mesh_merge.c
78 Mesh_optimizeDOFDistribution.c
79 Mesh_optimizeDOFLabeling.c
80 Mesh_prepare.c
81 Mesh_print.c
82 Mesh_read.c
83 Mesh_readGmsh.c
84 Mesh_rec4.c
85 Mesh_rec8.c
86 Mesh_relableElementNodes.c
87 Mesh_resolveNodeIds.c
88 Mesh_saveDX.c
89 Mesh_saveVTK.c
90 Mesh_setCoordinates.c
91 Mesh_tagmaps.c
92 Mesh_write.c
93 NodeFile.c
94 NodeFile_allocTable.c
95 NodeFile_copyTable.c
96 NodeFile_createDenseLabelings.c
97 NodeFile_gather.c
98 NodeFile_scatter.c
99 NodeFile_setCoordinates.c
100 NodeFile_setIdRange.c
101 NodeFile_setTags.c
102 NodeMapping.c
103 Quadrature.c
104 ReferenceElements.c
105 ShapeFunctions.c
106 TagMap.c
107 Util.c
108 CPPAdapter/FinleAdapterException.cpp
109 CPPAdapter/FinleyError.cpp
110 CPPAdapter/MeshAdapter.cpp
111 CPPAdapter/MeshAdapterFactory.cpp
112 CPPAdapter/SystemMatrixAdapter.cpp
113 CPPAdapter/TransportProblemAdapter.cpp
114 """.split()
115 headers = """
116 Assemble.h
117 ElementFile.h
118 Finley.h
119 FinleyVersion.h
120 IndexList.h
121 Mesh.h
122 NodeFile.h
123 NodeMapping.h
124 Quadrature.h
125 RectangularMesh.h
126 ReferenceElements.h
127 ShapeFunctions.h
128 TagMap.h
129 Util.h
130 vtkCellType.h
131 """.split()
132 cppadapter_headers = """
133 CPPAdapter/FinleyAdapterException.h
134 CPPAdapter/FinleyError.h
135 CPPAdapter/MeshAdapter.h
136 CPPAdapter/MeshAdapterFactory.h
137 CPPAdapter/SystemMatrixAdapter.h
138 CPPAdapter/TransportProblemAdapter.h
139 CPPAdapter/system_dep.h
140 """.split()
141
142 local_env.Append(LIBS = ['escript', 'esysUtils', 'paso'] + env['sys_libs'] )
143 py_wrapper_local_env.Append(LIBS = ['finley', 'escript', 'esysUtils', 'paso'] + env['sys_libs'] )
144
145 lib = local_env.SharedLibrary('finley', sources)
146 env.Alias('target_finley_so', lib)
147
148 py_wrapper_lib = py_wrapper_local_env.SharedLibrary('finleycpp', 'CPPAdapter/finleycpp.cpp')
149 env.Alias('target_finleycpp_so', py_wrapper_lib)
150
151 include_path = Dir('finley', local_env['incinstall'])
152 cppadapter_include_path = Dir('CppAdapter', include_path)
153
154 tmp1 = local_env.Install(include_path, headers )
155 tmp2 = local_env.Install(cppadapter_include_path, cppadapter_headers )
156 env.Alias('target_install_finley_headers', [tmp1, tmp2])
157
158 tmp3 = local_env.Install(local_env['libinstall'], lib)
159 env.Alias('target_install_finley_so', tmp3)
160
161 #windows specific mod
162 if os.name == 'nt':
163 tmp4 = py_wrapper_local_env.Install(local_env['pyinstall']+'/finley', ['finleycpp.pyd', 'finleycpp.lib', 'finleycpp.exp'])
164 else:
165 tmp4 = py_wrapper_local_env.InstallAs(local_env['pyinstall']+'/finley/finleycpp.so', py_wrapper_lib)
166 env.Alias('target_install_finleycpp_so', tmp4)
167
168 # export the lib target since tests will depend on it
169 # the lib target is a list of file nodes (why? win32 produces more than one output file: .lib, .dll, .pdb)
170 # FIXME: This list handling produces the desired result but can this be done directly with scons File nodes?
171 dep_lib = [local_env['libinstall']+'/'+str(x) for x in lib]
172 Export('dep_lib')
173
174 # Call the python sconscript
175 env.SConscript(dirs = ['#/finley/py_src'], build_dir='py', duplicate=0)
176
177 # Call the unit tests SConscript
178 local_env.SConscript(dirs = ['#/finley/test'], build_dir='#/build/$PLATFORM/finley/test', duplicate=0)
179

  ViewVC Help
Powered by ViewVC 1.1.26