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

Contents of /trunk/dudley/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6124 - (show annotations)
Tue Apr 5 03:23:12 2016 UTC (3 years ago) by caltinay
File size: 3592 byte(s)
Fixing python module build on OS X. Added PythonModule builder so we do this generically now.
1
2 ##############################################################################
3 #
4 # Copyright (c) 2003-2016 by The University of Queensland
5 # http://www.uq.edu.au
6 #
7 # Primary Business: Queensland, Australia
8 # Licensed under the Apache License, version 2.0
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 # Development 2012-2013 by School of Earth Sciences
13 # Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 #
15 ##############################################################################
16
17 Import('*')
18
19 module_name = 'dudley'
20
21 sources = """
22 Assemble_AverageElementData.cpp
23 Assemble_CopyElementData.cpp
24 Assemble_CopyNodalData.cpp
25 Assemble_LumpedSystem.cpp
26 Assemble_NodeCoordinates.cpp
27 Assemble_PDE.cpp
28 Assemble_PDE_Points.cpp
29 Assemble_PDE_Single_2D.cpp
30 Assemble_PDE_Single_3D.cpp
31 Assemble_PDE_System_2D.cpp
32 Assemble_PDE_System_3D.cpp
33 Assemble_addToSystemMatrix.cpp
34 Assemble_getAssembleParameters.cpp
35 Assemble_getNormal.cpp
36 Assemble_getSize.cpp
37 Assemble_integrate.cpp
38 Assemble_interpolate.cpp
39 ElementFile.cpp
40 ElementFile_createColoring.cpp
41 ElementFile_distributeByRankOfDOF.cpp
42 ElementFile_jacobians.cpp
43 IndexList.cpp
44 Mesh.cpp
45 Mesh_createTrilinosGraph.cpp
46 Mesh_distributeByRankOfDOF.cpp
47 Mesh_getPattern.cpp
48 Mesh_optimizeDOFDistribution.cpp
49 Mesh_optimizeDOFLabeling.cpp
50 Mesh_prepare.cpp
51 Mesh_print.cpp
52 Mesh_read.cpp
53 Mesh_readGmsh.cpp
54 Mesh_resolveNodeIds.cpp
55 Mesh_tet4.cpp
56 Mesh_tri3.cpp
57 Mesh_write.cpp
58 NodeFile.cpp
59 NodeFile_createDenseLabelings.cpp
60 NodeFile_createMappings.cpp
61 NodeFile_gather.cpp
62 ShapeTable.cpp
63 Util.cpp
64 CPPAdapter/MeshAdapter.cpp
65 CPPAdapter/MeshAdapterFactory.cpp
66 """.split()
67 unroll_sources= """
68 Assemble_gradient.cpp
69 Assemble_jacobians.cpp
70 """.split()
71
72 headers = """
73 Assemble.h
74 Dudley.h
75 DudleyException.h
76 DudleyVersion.h
77 ElementFile.h
78 ElementType.h
79 IndexList.h
80 Mesh.h
81 NodeFile.h
82 NodeMapping.h
83 TriangularMesh.h
84 ShapeTable.h
85 Util.h
86 """.split()
87 cppadapter_headers = """
88 CPPAdapter/MeshAdapter.h
89 CPPAdapter/MeshAdapterFactory.h
90 CPPAdapter/system_dep.h
91 """.split()
92
93 local_env = env.Clone()
94
95 unroll_env = env.Clone()
96 unroll_env.Append(CCFLAGS = env['dudley_assemble_flags'])
97 un = [ unroll_env.SharedObject(x) for x in unroll_sources]
98
99 if IS_WINDOWS :
100 local_env.Append(CPPDEFINES = ['DUDLEY_EXPORTS'])
101
102 # collect dependencies for other modules
103 dudleylibs = ['escript']
104
105 if env['paso']:
106 dudleylibs.append('paso')
107
108 if env['trilinos']:
109 dudleylibs += env['trilinoswrap_libs']
110
111 local_env.PrependUnique(LIBS = dudleylibs)
112
113 env['dudley_libs'] = [module_name] + dudleylibs
114
115 include_path = Dir(module_name, local_env['incinstall'])
116 cppadapter_include_path = Dir('CppAdapter', include_path)
117 hdr_inst = local_env.Install(include_path, headers)
118 hdr_inst += local_env.Install(cppadapter_include_path, cppadapter_headers)
119
120 lib = local_env.SharedLibrary(module_name, sources+un)
121 lib_inst = local_env.Install(local_env['libinstall'], lib)
122
123 ### Python wrapper ###
124 py_env = env.Clone()
125 py_env.Prepend(LIBS = env['dudley_libs'])
126 py_lib_name = module_name + 'cpp'
127 py_lib = py_env.PythonModule(py_lib_name, 'CPPAdapter/dudleycpp.cpp')
128
129 mod_path = Dir(module_name, local_env['pyinstall'])
130 mod_inst = py_env.Install(mod_path, py_lib)
131
132 build = env.Alias('build_dudley', [hdr_inst, lib, py_lib])
133 env.Alias('install_dudley', [build, lib_inst, mod_inst])
134

  ViewVC Help
Powered by ViewVC 1.1.26