/[escript]/branches/arrayview_from_1695_trunk/finley/src/SConscript
ViewVC logotype

Diff of /branches/arrayview_from_1695_trunk/finley/src/SConscript

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

revision 1780 by jfenwick, Mon Aug 11 03:33:40 2008 UTC revision 1781 by jfenwick, Thu Sep 11 05:03:14 2008 UTC
# Line 1  Line 1 
 #          Copyright 2006 by ACcESS MNRF  
1  #  #
2  #              http://www.access.edu.au  # $Id$
3  #       Primary Business: Queensland, Australia  #
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  #  Licensed under the Open Software License version 3.0
12  #     http://www.opensource.org/licenses/osl-3.0.php  #     http://www.opensource.org/licenses/osl-3.0.php
13  #  #
14    #######################################################
15    #
16    
17  import os  import os
18  Import('*')  Import('*')
19    
20  local_env=env.Copy()  local_env = clone_env(env_mpi)
21  py_wrapper_local_env=env.Copy()  py_wrapper_local_env = clone_env(env_mpi)
22    
23  # 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
24  del py_wrapper_local_env['SHLIBPREFIX']  del py_wrapper_local_env['SHLIBPREFIX']
25    
26  lib_name = 'finley'  sources = """
27  py_wrapper_name = lib_name+'cpp'      Assemble_AverageElementData.c
28  py_wrapper_source = 'CPPAdapter/'+py_wrapper_name+'.cpp' # FIXME: In need of a source tree refactor      Assemble_CopyElementData.c
29  py_wrapper_lib_name = py_wrapper_name      Assemble_CopyNodalData.c
30        Assemble_LumpedSystem.c
31  src_dir = local_env.Dir('.').srcnode().abspath      Assemble_NodeCoordinates.c
32  filenames = [ x for x in os.listdir(src_dir) if os.path.splitext(x)[1] in [".h", ".c", ".cpp"] ]      Assemble_PDE.c
33        Assemble_PDE_Single2_1D.c
34  sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]      Assemble_PDE_Single2_2D.c
35  headers = [x for x in filenames if os.path.splitext(x)[1] in ['.h']]      Assemble_PDE_Single2_3D.c
36        Assemble_PDE_Single2_C.c
37        Assemble_PDE_System2_1D.c
38  # finleycpp has additional source in the CPPAdapter sub-directory. Append these to the list      Assemble_PDE_System2_2D.c
39  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
40  sources += [ x for x in cppadapter_filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]      Assemble_PDE_System2_C.c
41  cppadapter_headers = [x for x in cppadapter_filenames if os.path.splitext(x)[1] in ['.h']]      Assemble_addToSystemMatrix.c
42        Assemble_getAssembleParameters.c
43  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
44  local_env.Append(LIBS = [boost_lib, python_lib, 'escript', 'esysUtils', 'paso'] + sys_libs + mpi_libs )      Assemble_gradient.c
45  py_wrapper_local_env.Append(LIBS = [boost_lib, python_lib, lib_name, 'escript', 'esysUtils', 'paso'] + sys_libs + mpi_libs )      Assemble_integrate.c
46        Assemble_interpolate.c
47  if mkl_libs:      Assemble_jacobeans.c
48     local_env.Append(CPPDEFINES=['MKL',])      Assemble_setNormal.c
49     local_env.Append(LIBS = mkl_libs)      ElementFile.c
50  if scsl_libs:      ElementFile_allocTable.c
51     local_env.Append(CPPDEFINES=['SCSL',])      ElementFile_copyTable.c
52     local_env.Append(LIBS = scsl_libs)      ElementFile_createColoring.c
53  if umf_libs:      ElementFile_distributeByRankOfDOF.c
54     local_env.Append(CPPDEFINES=['UMFPACK',])      ElementFile_gather.c
55     local_env.Append(LIBS = umf_libs)      ElementFile_jacobeans.c
56        ElementFile_markNodes.c
57  if blas_libs:      ElementFile_optimizeOrdering.c
58     local_env.Append(LIBS = blas_libs)      ElementFile_relableNodes.c
59        ElementFile_scatter.c
60  if papi_instrument_solver:      ElementFile_setCoordinates.c
61     local_env.Append(CPPDEFINES=['PAPI',])      ElementFile_setNodeRange.c
62  if papi_libs:      ElementFile_setTags.c
63     local_env.Append(LIBS = papi_libs)      Finley.c
64     local_env.Append(CPPDEFINES=['BLOCKPAPI',])      IndexList.c
65        Mesh.c
66  if trilinos_libs:      Mesh_createNodeFileMappings.c
67     local_env.Append(CPPDEFINES=['TRILINOS',])      Mesh_distributeByRankOfDOF.c
68     local_env.Append(LIBS = trilinos_libs)      Mesh_findMatchingFaces.c
69        Mesh_getPattern.c
70        Mesh_glueFaces.c
71        Mesh_hex20.c
72        Mesh_hex8.c
73        Mesh_joinFaces.c
74        Mesh_markNodes.c
75        Mesh_merge.c
76        Mesh_optimizeDOFDistribution.c
77        Mesh_optimizeDOFLabeling.c
78        Mesh_prepare.c
79        Mesh_print.c
80        Mesh_read.c
81        Mesh_readGmsh.c
82        Mesh_rec4.c
83        Mesh_rec8.c
84        Mesh_relableElementNodes.c
85        Mesh_resolveNodeIds.c
86        Mesh_saveDX.c
87        Mesh_saveVTK.c
88        Mesh_setCoordinates.c
89        Mesh_tagmaps.c
90        Mesh_write.c
91        NodeFile.c
92        NodeFile_allocTable.c
93        NodeFile_copyTable.c
94        NodeFile_createDenseLabelings.c
95        NodeFile_gather.c
96        NodeFile_scatter.c
97        NodeFile_setCoordinates.c
98        NodeFile_setIdRange.c
99        NodeFile_setTags.c
100        NodeMapping.c
101        Quadrature.c
102        ReferenceElements.c
103        ShapeFunctions.c
104        TagMap.c
105        Util.c
106        CPPAdapter/FinleAdapterException.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        vtkCellType.h
129    """.split()
130    cppadapter_headers = """
131        CPPAdapter/FinleyAdapterException.h
132        CPPAdapter/FinleyError.h
133        CPPAdapter/MeshAdapter.h
134        CPPAdapter/MeshAdapterFactory.h
135        CPPAdapter/SystemMatrixAdapter.h
136        CPPAdapter/TransportProblemAdapter.h
137        CPPAdapter/system_dep.h
138    """.split()
139    
140    local_env.Append(LIBS = ['escript', 'esysUtils', 'paso'] + env['sys_libs'] )
141    py_wrapper_local_env.Append(LIBS = ['finley', 'escript', 'esysUtils', 'paso'] + env['sys_libs'] )
142    
143  local_env.Append(CPPDEFINES = ['FINLEY_EXPORTS'])  lib = local_env.SharedLibrary('finley', sources)
144    env.Alias('target_finley_so', lib)
145    
146  lib = local_env.SharedLibrary(lib_name, sources)  py_wrapper_lib = py_wrapper_local_env.SharedLibrary('finleycpp', 'CPPAdapter/finleycpp.cpp')
147  py_wrapper_lib = py_wrapper_local_env.SharedLibrary( py_wrapper_lib_name, py_wrapper_source)  env.Alias('target_finleycpp_so', py_wrapper_lib)
148    
149  include_path = Dir(lib_name, incinstall)  include_path = Dir('finley', local_env['incinstall'])
150  cppadapter_include_path = Dir('CppAdapter', include_path)  cppadapter_include_path = Dir('CppAdapter', include_path)
151    
152  local_env.Install(include_path, headers )  tmp1 = local_env.Install(include_path, headers )
153  local_env.Install(cppadapter_include_path, cppadapter_headers )  tmp2 = local_env.Install(cppadapter_include_path, cppadapter_headers )
154  local_env.Install(libinstall, lib)  env.Alias('target_install_finley_headers', [tmp1, tmp2])
155  py_wrapper_local_env.InstallAs(pyinstall+'/finley/finleycpp.so', py_wrapper_lib)  
156    tmp3 = local_env.Install(local_env['libinstall'], lib)
157    env.Alias('target_install_finley_so', tmp3)
158    
159  #windows specific mod  #windows specific mod
160  if os.name == 'nt':  if os.name == 'nt':
161     py_wrapper_local_env.InstallAs(target = [ pyinstall+'/finley/'+py_wrapper_lib_name+'.pyd', \    tmp4 = py_wrapper_local_env.Install(local_env['pyinstall']+'/finley', ['finleycpp.pyd', 'finleycpp.lib', 'finleycpp.exp'])
162                                               pyinstall+'/finley/'+py_wrapper_lib_name+'.lib', \  else:
163                                               pyinstall+'/finley/'+py_wrapper_lib_name+'.exp' ], \    tmp4 = py_wrapper_local_env.InstallAs(local_env['pyinstall']+'/finley/finleycpp.so', py_wrapper_lib)
164                                    source = py_wrapper_lib )  env.Alias('target_install_finleycpp_so', tmp4)
   
165    
166  # export the lib target since tests will depend on it  # export the lib target since tests will depend on it
167  # 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)
168  # 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?
169  dep_lib = [libinstall+'/'+str(x) for x in lib]  dep_lib = [local_env['libinstall']+'/'+str(x) for x in lib]
170  Export('dep_lib')  Export('dep_lib')
171    
 # 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)  
 env.Tar(src_tarfile, release_srcfiles)  
   
172  # Call the python sconscript  # Call the python sconscript
173  env.SConscript(dirs = ['#/finley/py_src'], build_dir='py', duplicate=0)  env.SConscript(dirs = ['#/finley/py_src'], build_dir='py', duplicate=0)
174    

Legend:
Removed from v.1780  
changed lines
  Added in v.1781

  ViewVC Help
Powered by ViewVC 1.1.26