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

Diff of /trunk/finley/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.3258  
changed lines
  Added in v.3259

  ViewVC Help
Powered by ViewVC 1.1.26