/[escript]/branches/domexper/dudley/src/SConscript
ViewVC logotype

Diff of /branches/domexper/dudley/src/SConscript

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

trunk/finley/src/SConscript revision 1139 by ksteube, Mon May 14 05:12:53 2007 UTC branches/domexper/dudley/src/SConscript revision 3184 by jfenwick, Wed Sep 15 00:23:42 2010 UTC
# Line 1  Line 1 
1  #          Copyright 2006 by ACcESS MNRF  
2    
3    ########################################################
4    #
5    # Copyright (c) 2003-2010 by University of Queensland
6    # Earth Systems Science Computational Center (ESSCC)
7    # http://www.uq.edu.au/esscc
8  #  #
9  #              http://www.access.edu.au  # Primary Business: Queensland, Australia
10  #       Primary Business: Queensland, Australia  # Licensed under the Open Software License version 3.0
11  #  Licensed under the Open Software License version 3.0  # http://www.opensource.org/licenses/osl-3.0.php
 #     http://www.opensource.org/licenses/osl-3.0.php  
12  #  #
13    ########################################################
14    
15    
16  import os  import os
17  Import('*')  Import('*')
18    
19  local_env=env.Copy()  local_env = clone_env(env_mpi)
20  py_wrapper_local_env=env.Copy()  py_wrapper_local_env = clone_env(env_mpi)
21    
22  # 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' mucking with our python modules
23  del py_wrapper_local_env['SHLIBPREFIX']  del py_wrapper_local_env['SHLIBPREFIX']
24    
25  lib_name = 'finley'  sources = """
26  py_wrapper_name = lib_name+'cpp'      Assemble_AverageElementData.c
27  py_wrapper_source = 'CPPAdapter/'+py_wrapper_name+'.cpp' # FIXME: In need of a source tree refactor      Assemble_CopyElementData.c
28  py_wrapper_lib_name = py_wrapper_name      Assemble_CopyNodalData.c
29        Assemble_LumpedSystem.c
30  src_dir = local_env.Dir('.').srcnode().abspath      Assemble_NodeCoordinates.c
31  filenames = [ x for x in os.listdir(src_dir) if os.path.splitext(x)[1] in [".h", ".c", ".cpp"] ]      Assemble_PDE.c
32        Assemble_PDE_Single2_2D.c
33  sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]      Assemble_PDE_Single2_3D.c
34  headers = [x for x in filenames if os.path.splitext(x)[1] in ['.h']]      Assemble_PDE_System2_2D.c
35        Assemble_PDE_System2_3D.c
36        Assemble_addToSystemMatrix.c
37  # finleycpp has additional source in the CPPAdapter sub-directory. Append these to the list      Assemble_getAssembleParameters.c
38  cppadapter_filenames = [ 'CPPAdapter/'+x for x in os.listdir(src_dir+'/CPPAdapter')  if os.path.splitext(x)[1] in [".h", ".c", ".cpp"] ]      Assemble_getSize.c
39  sources += [ x for x in cppadapter_filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]      Assemble_gradient.c
40  cppadapter_headers = [x for x in cppadapter_filenames if os.path.splitext(x)[1] in ['.h']]      Assemble_integrate.c
41        Assemble_interpolate.c
42  sources.remove(py_wrapper_source) # FIXME: should probably refactor the source tree so the python wrapper isn't colocated with c++ sources      Assemble_jacobeans.c
43  local_env.Append(LIBS = [boost_libs] +  python_libs + sys_libs + ['escript', 'esysUtils', 'paso'])      Assemble_setNormal.c
44  py_wrapper_local_env.Append(LIBS = [boost_libs] + python_libs + sys_libs + [lib_name, 'escript', 'esysUtils', 'paso'])      ElementFile.c
45        ElementFile_allocTable.c
46  if mkl_libs:      ElementFile_copyTable.c
47     local_env.Append(CPPDEFINES=['MKL',])      ElementFile_createColoring.c
48     local_env.Append(LIBS = mkl_libs)      ElementFile_distributeByRankOfDOF.c
49  if scsl_libs:      ElementFile_gather.c
50     local_env.Append(CPPDEFINES=['SCSL',])      ElementFile_jacobeans.c
51     local_env.Append(LIBS = scsl_libs)      ElementFile_markNodes.c
52  if umf_libs and amd_libs:      ElementFile_optimizeOrdering.c
53     local_env.Append(CPPDEFINES=['UMFPACK',])      ElementFile_relableNodes.c
54     local_env.Append(LIBS = umf_libs)      ElementFile_scatter.c
55     local_env.Append(LIBS = amd_libs)      ElementFile_setCoordinates.c
56        ElementFile_setNodeRange.c
57  if blas_libs:      ElementFile_setTags.c
58     local_env.Append(LIBS = blas_libs)      Dudley.c
59        IndexList.c
60  if papi_libs:      Mesh.c
61     local_env.Append(CPPDEFINES=['PAPI',])      Mesh_createNodeFileMappings.c
62     local_env.Append(LIBS = papi_libs)      Mesh_distributeByRankOfDOF.c
63        Mesh_findMatchingFaces.c
64        Mesh_getPattern.c
65        Mesh_glueFaces.c
66        Mesh_joinFaces.c
67        Mesh_markNodes.c
68        Mesh_merge.c
69        Mesh_optimizeDOFDistribution.c
70        Mesh_optimizeDOFLabeling.c
71        Mesh_prepare.c
72        Mesh_print.c
73        Mesh_read.c
74        Mesh_readGmsh.c
75        Mesh_relableElementNodes.c
76        Mesh_resolveNodeIds.c
77        Mesh_saveDX.c
78        Mesh_saveVTK.c
79        Mesh_setCoordinates.c
80        Mesh_tagmaps.c
81        Mesh_tet4.c
82        Mesh_tri3.c
83        Mesh_write.c
84        NodeFile.c
85        NodeFile_allocTable.c
86        NodeFile_copyTable.c
87        NodeFile_createDenseLabelings.c
88        NodeFile_gather.c
89        NodeFile_scatter.c
90        NodeFile_setCoordinates.c
91        NodeFile_setIdRange.c
92        NodeFile_setTags.c
93        NodeMapping.c
94        Quadrature.c
95        ReferenceElements.c
96        ShapeFunctions.c
97        TagMap.c
98        Util.c
99        ReferenceElementSets.c
100        CPPAdapter/DudleyAdapterException.cpp
101        CPPAdapter/DudleyError.cpp
102        CPPAdapter/MeshAdapter.cpp
103        CPPAdapter/MeshAdapterFactory.cpp
104        CPPAdapter/SystemMatrixAdapter.cpp
105        CPPAdapter/TransportProblemAdapter.cpp
106    """.split()
107    headers = """
108        Assemble.h
109        ElementFile.h
110        Dudley.h
111        DudleyVersion.h
112        IndexList.h
113        Mesh.h
114        NodeFile.h
115        NodeMapping.h
116        Quadrature.h
117        TriangularMesh.h
118        ReferenceElements.h
119        ShapeFunctions.h
120        ShapeTable.h
121        TagMap.h
122        Util.h
123        ReferenceElementSets.h
124        vtkCellType.h
125    """.split()
126    cppadapter_headers = """
127        CPPAdapter/DudleyAdapterException.h
128        CPPAdapter/DudleyError.h
129        CPPAdapter/MeshAdapter.h
130        CPPAdapter/MeshAdapterFactory.h
131        CPPAdapter/SystemMatrixAdapter.h
132        CPPAdapter/TransportProblemAdapter.h
133        CPPAdapter/system_dep.h
134    """.split()
135    
136    local_env.Append(LIBS = ['escript', 'esysUtils', 'paso'] + env['sys_libs'] )
137    
138    if IS_WINDOWS_PLATFORM :
139      local_env.Append(CPPDEFINES = ['DUDLEY_EXPORTS'])
140    
141    py_wrapper_local_env.Append(LIBS = ['dudley', 'escript', 'esysUtils', 'paso'] + env['sys_libs'] )
142    
143    module_name = 'dudley'
144    py_wrapper_name = module_name + 'cpp'
145    
146  local_env.Append(CPPDEFINES = 'FINLEY_EXPORTS')  lib = local_env.SharedLibrary(module_name, sources)
147    env.Alias('target_dudley_so', lib)
148    
149  lib = local_env.SharedLibrary(lib_name, sources)  py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'CPPAdapter/dudleycpp.cpp')
150  py_wrapper_lib = py_wrapper_local_env.SharedLibrary( py_wrapper_lib_name, py_wrapper_source)  env.Alias('target_dudleycpp_so', py_wrapper_lib)
151    
152  include_path = Dir(lib_name, incinstall)  include_path = Dir('dudley', local_env['incinstall'])
153  cppadapter_include_path = Dir('CppAdapter', include_path)  cppadapter_include_path = Dir('CppAdapter', include_path)
154    
155  local_env.Install(include_path, headers )  tmp1 = local_env.Install(include_path, headers )
156  local_env.Install(cppadapter_include_path, cppadapter_headers )  tmp2 = local_env.Install(cppadapter_include_path, cppadapter_headers )
157  local_env.Install(libinstall, lib)  env.Alias('target_install_dudley_headers', [tmp1, tmp2])
158  py_wrapper_local_env.Install(pyinstall+'/finley', py_wrapper_lib)  
159    tmp3 = local_env.Install(local_env['libinstall'], lib)
160    env.Alias('target_install_dudley_so', tmp3)
161    
162    #windows specific mod
163    tmp_inst = os.path.join(local_env['pyinstall'],module_name)
164    if os.name == 'nt':
165      wrapper_postfix = '.pyd'
166    else:
167      wrapper_postfix = '.so'
168    
169    share_name = os.path.join(tmp_inst,py_wrapper_name+wrapper_postfix)
170    
171    tmp4 = py_wrapper_local_env.InstallAs(target=share_name,
172                                          source=py_wrapper_lib[0])
173    
174    env.Alias('target_install_dudleycpp_so', tmp4)
175    
176  # export the lib target since tests will depend on it  # export the lib target since tests will depend on it
177  # the lib target is a list of file nodes (why? win32 produces more than one output file: .lib, .dll, .pdb)  # the lib target is a list of file nodes (why? win32 produces more than one output file: .lib, .dll, .pdb)
178  # FIXME: This list handling produces the desired result but can this be done directly with scons File nodes?  # FIXME: This list handling produces the desired result but can this be done directly with scons File nodes?
179  dep_lib = [libinstall+'/'+str(x) for x in lib]  dep_lib = [local_env['libinstall']+'/'+str(x) for x in lib]
180  Export('dep_lib')  Export('dep_lib')
181    
 # add source files to release  
 release_srcfiles = [ env.File(x) for x in filenames + cppadapter_filenames ] + [env.File("SConscript"), ]  
 env.Zip(src_zipfile, release_srcfiles)  
 try:  
   env.Tar(src_tarfile, release_srcfiles)  
 except AttributeError:  
   pass  
182  # Call the python sconscript  # Call the python sconscript
183  env.SConscript(dirs = ['#/finley/py_src'], build_dir='py', duplicate=0)  CallSConscript(env,dirs = ['#/dudley/py_src'], variant_dir='py', duplicate=0)
184    
185  # Call the unit tests SConscript  # Call the unit tests SConscript
186  local_env.SConscript(dirs = ['#/finley/test'], build_dir='#/build/$PLATFORM/finley/test', duplicate=0)  CallSConscript(local_env,dirs = ['#/dudley/test'], variant_dir='#/build/$PLATFORM/dudley/test', duplicate=0)
187    

Legend:
Removed from v.1139  
changed lines
  Added in v.3184

  ViewVC Help
Powered by ViewVC 1.1.26