/[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 1133 by gross, Tue May 8 07:19:33 2007 UTC revision 2881 by jfenwick, Thu Jan 28 02:03:15 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_1D.c
33  sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]      Assemble_PDE_Single2_2D.c
34  headers = [x for x in filenames if os.path.splitext(x)[1] in ['.h']]      Assemble_PDE_Single2_3D.c
35        Assemble_PDE_Single2_C.c
36        Assemble_PDE_System2_1D.c
37  # finleycpp has additional source in the CPPAdapter sub-directory. Append these to the list      Assemble_PDE_System2_2D.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_PDE_System2_3D.c
39  sources += [ x for x in cppadapter_filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]      Assemble_PDE_System2_C.c
40  cppadapter_headers = [x for x in cppadapter_filenames if os.path.splitext(x)[1] in ['.h']]      Assemble_addToSystemMatrix.c
41        Assemble_getAssembleParameters.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_getSize.c
43  local_env.Append(LIBS = boost_libs +  python_libs + sys_libs + ['escript', 'esysUtils', 'paso'])      Assemble_gradient.c
44  py_wrapper_local_env.Append(LIBS = boost_libs + python_libs + sys_libs + [lib_name, 'escript', 'esysUtils', 'paso'])      Assemble_integrate.c
45        Assemble_interpolate.c
46  if mkl_libs:      Assemble_jacobeans.c
47     local_env.Append(CPPDEFINES=['MKL',])      Assemble_setNormal.c
48     local_env.Append(LIBS = mkl_libs)      ElementFile.c
49  if scsl_libs:      ElementFile_allocTable.c
50     local_env.Append(CPPDEFINES=['SCSL',])      ElementFile_copyTable.c
51     local_env.Append(LIBS = scsl_libs)      ElementFile_createColoring.c
52  if umf_libs and amd_libs:      ElementFile_distributeByRankOfDOF.c
53     local_env.Append(CPPDEFINES=['UMFPACK',])      ElementFile_gather.c
54     local_env.Append(LIBS = umf_libs)      ElementFile_jacobeans.c
55     local_env.Append(LIBS = amd_libs)      ElementFile_markNodes.c
56        ElementFile_optimizeOrdering.c
57  if blas_libs:      ElementFile_relableNodes.c
58     local_env.Append(LIBS = blas_libs)      ElementFile_scatter.c
59        ElementFile_setCoordinates.c
60  if papi_libs:      ElementFile_setNodeRange.c
61     local_env.Append(CPPDEFINES=['PAPI',])      ElementFile_setTags.c
62     local_env.Append(LIBS = papi_libs)      Finley.c
63        IndexList.c
64        Mesh.c
65        Mesh_createNodeFileMappings.c
66        Mesh_distributeByRankOfDOF.c
67        Mesh_findMatchingFaces.c
68        Mesh_getPattern.c
69        Mesh_glueFaces.c
70        Mesh_hex20.c
71        Mesh_hex8.c
72        Mesh_joinFaces.c
73        Mesh_markNodes.c
74        Mesh_merge.c
75        Mesh_optimizeDOFDistribution.c
76        Mesh_optimizeDOFLabeling.c
77        Mesh_prepare.c
78        Mesh_print.c
79        Mesh_read.c
80        Mesh_readGmsh.c
81        Mesh_rec4.c
82        Mesh_rec8.c
83        Mesh_relableElementNodes.c
84        Mesh_resolveNodeIds.c
85        Mesh_saveDX.c
86        Mesh_saveVTK.c
87        Mesh_setCoordinates.c
88        Mesh_tagmaps.c
89        Mesh_write.c
90        NodeFile.c
91        NodeFile_allocTable.c
92        NodeFile_copyTable.c
93        NodeFile_createDenseLabelings.c
94        NodeFile_gather.c
95        NodeFile_scatter.c
96        NodeFile_setCoordinates.c
97        NodeFile_setIdRange.c
98        NodeFile_setTags.c
99        NodeMapping.c
100        Quadrature.c
101        ReferenceElements.c
102        ShapeFunctions.c
103        TagMap.c
104        Util.c
105        ReferenceElementSets.c
106        CPPAdapter/FinleyAdapterException.cpp
107        CPPAdapter/FinleyError.cpp
108        CPPAdapter/MeshAdapter.cpp
109        CPPAdapter/MeshAdapterFactory.cpp
110        CPPAdapter/SystemMatrixAdapter.cpp
111        CPPAdapter/TransportProblemAdapter.cpp
112    """.split()
113    headers = """
114        Assemble.h
115        ElementFile.h
116        Finley.h
117        FinleyVersion.h
118        IndexList.h
119        Mesh.h
120        NodeFile.h
121        NodeMapping.h
122        Quadrature.h
123        RectangularMesh.h
124        ReferenceElements.h
125        ShapeFunctions.h
126        TagMap.h
127        Util.h
128        ReferenceElementSets.h
129        vtkCellType.h
130    """.split()
131    cppadapter_headers = """
132        CPPAdapter/FinleyAdapterException.h
133        CPPAdapter/FinleyError.h
134        CPPAdapter/MeshAdapter.h
135        CPPAdapter/MeshAdapterFactory.h
136        CPPAdapter/SystemMatrixAdapter.h
137        CPPAdapter/TransportProblemAdapter.h
138        CPPAdapter/system_dep.h
139    """.split()
140    
141    local_env.Append(LIBS = ['escript', 'esysUtils', 'paso'] + env['sys_libs'] )
142    
143    if IS_WINDOWS_PLATFORM :
144      local_env.Append(CPPDEFINES = ['FINLEY_EXPORTS'])
145    
146    py_wrapper_local_env.Append(LIBS = ['finley', 'escript', 'esysUtils', 'paso'] + env['sys_libs'] )
147    
148    module_name = 'finley'
149    py_wrapper_name = module_name + 'cpp'
150    
151  local_env.Append(CPPDEFINES = 'FINLEY_EXPORTS')  lib = local_env.SharedLibrary(module_name, sources)
152    env.Alias('target_finley_so', lib)
153    
154  lib = local_env.SharedLibrary(lib_name, sources)  py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'CPPAdapter/finleycpp.cpp')
155  py_wrapper_lib = py_wrapper_local_env.SharedLibrary( py_wrapper_lib_name, py_wrapper_source)  env.Alias('target_finleycpp_so', py_wrapper_lib)
156    
157  include_path = Dir(lib_name, incinstall)  include_path = Dir('finley', local_env['incinstall'])
158  cppadapter_include_path = Dir('CppAdapter', include_path)  cppadapter_include_path = Dir('CppAdapter', include_path)
159    
160  local_env.Install(include_path, headers )  tmp1 = local_env.Install(include_path, headers )
161  local_env.Install(cppadapter_include_path, cppadapter_headers )  tmp2 = local_env.Install(cppadapter_include_path, cppadapter_headers )
162  local_env.Install(libinstall, lib)  env.Alias('target_install_finley_headers', [tmp1, tmp2])
163  py_wrapper_local_env.Install(pyinstall+'/finley', py_wrapper_lib)  
164    tmp3 = local_env.Install(local_env['libinstall'], lib)
165    env.Alias('target_install_finley_so', tmp3)
166    
167    #windows specific mod
168    tmp_inst = os.path.join(local_env['pyinstall'],module_name)
169    if os.name == 'nt':
170      wrapper_postfix = '.pyd'
171    else:
172      wrapper_postfix = '.so'
173    
174    share_name = os.path.join(tmp_inst,py_wrapper_name+wrapper_postfix)
175    
176    tmp4 = py_wrapper_local_env.InstallAs(target=share_name,
177                                          source=py_wrapper_lib[0])
178    
179    env.Alias('target_install_finleycpp_so', tmp4)
180    
181  # export the lib target since tests will depend on it  # export the lib target since tests will depend on it
182  # 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)
183  # 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?
184  dep_lib = [libinstall+'/'+str(x) for x in lib]  dep_lib = [local_env['libinstall']+'/'+str(x) for x in lib]
185  Export('dep_lib')  Export('dep_lib')
186    
 # 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  
187  # Call the python sconscript  # Call the python sconscript
188  env.SConscript(dirs = ['#/finley/py_src'], build_dir='py', duplicate=0)  env.SConscript(dirs = ['#/finley/py_src'], build_dir='py', duplicate=0)
189    

Legend:
Removed from v.1133  
changed lines
  Added in v.2881

  ViewVC Help
Powered by ViewVC 1.1.26