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

Diff of /trunk/finley/src/SConscript

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

trunk/finley/src/finley/SConscript revision 288 by jgs, Fri Dec 2 01:55:04 2005 UTC trunk/finley/src/SConscript revision 1133 by gross, Tue May 8 07:19:33 2007 UTC
# Line 1  Line 1 
1  libinstall = None  #          Copyright 2006 by ACcESS MNRF
2    #
3    #              http://www.access.edu.au
4    #       Primary Business: Queensland, Australia
5    #  Licensed under the Open Software License version 3.0
6    #     http://www.opensource.org/licenses/osl-3.0.php
7    #
8    import os
9  Import('*')  Import('*')
10    
11  import os  local_env=env.Copy()
12  import string  py_wrapper_local_env=env.Copy()
13    # Remove the sharedlibrary prefix on all platform - we don't want 'lib' mucking with our python modules
14    del py_wrapper_local_env['SHLIBPREFIX']
15    
16    lib_name = 'finley'
17    py_wrapper_name = lib_name+'cpp'
18    py_wrapper_source = 'CPPAdapter/'+py_wrapper_name+'.cpp' # FIXME: In need of a source tree refactor
19    py_wrapper_lib_name = py_wrapper_name
20    
21    src_dir = local_env.Dir('.').srcnode().abspath
22    filenames = [ x for x in os.listdir(src_dir) if os.path.splitext(x)[1] in [".h", ".c", ".cpp"] ]
23    
24    sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]
25    headers = [x for x in filenames if os.path.splitext(x)[1] in ['.h']]
26    
27    
28    # finleycpp has additional source in the CPPAdapter sub-directory. Append these to the list
29    cppadapter_filenames = [ 'CPPAdapter/'+x for x in os.listdir(src_dir+'/CPPAdapter')  if os.path.splitext(x)[1] in [".h", ".c", ".cpp"] ]
30    sources += [ x for x in cppadapter_filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]
31    cppadapter_headers = [x for x in cppadapter_filenames if os.path.splitext(x)[1] in ['.h']]
32    
33    sources.remove(py_wrapper_source) # FIXME: should probably refactor the source tree so the python wrapper isn't colocated with c++ sources
34    local_env.Append(LIBS = boost_libs +  python_libs + sys_libs + ['escript', 'esysUtils', 'paso'])
35    py_wrapper_local_env.Append(LIBS = boost_libs + python_libs + sys_libs + [lib_name, 'escript', 'esysUtils', 'paso'])
36    
37    if mkl_libs:
38       local_env.Append(CPPDEFINES=['MKL',])
39       local_env.Append(LIBS = mkl_libs)
40    if scsl_libs:
41       local_env.Append(CPPDEFINES=['SCSL',])
42       local_env.Append(LIBS = scsl_libs)
43    if umf_libs and amd_libs:
44       local_env.Append(CPPDEFINES=['UMFPACK',])
45       local_env.Append(LIBS = umf_libs)
46       local_env.Append(LIBS = amd_libs)
47    
48    if blas_libs:
49       local_env.Append(LIBS = blas_libs)
50    
51    if papi_libs:
52       local_env.Append(CPPDEFINES=['PAPI',])
53       local_env.Append(LIBS = papi_libs)
54    
55    local_env.Append(CPPDEFINES = 'FINLEY_EXPORTS')
56    
57    lib = local_env.SharedLibrary(lib_name, sources)
58    py_wrapper_lib = py_wrapper_local_env.SharedLibrary( py_wrapper_lib_name, py_wrapper_source)
59    
60    include_path = Dir(lib_name, incinstall)
61    cppadapter_include_path = Dir('CppAdapter', include_path)
62    
63    local_env.Install(include_path, headers )
64    local_env.Install(cppadapter_include_path, cppadapter_headers )
65    local_env.Install(libinstall, lib)
66    py_wrapper_local_env.Install(pyinstall+'/finley', py_wrapper_lib)
67    
68    # export the lib target since tests will depend on it
69    # the lib target is a list of file nodes (why? win32 produces more than one output file: .lib, .dll, .pdb)
70    # FIXME: This list handling produces the desired result but can this be done directly with scons File nodes?
71    dep_lib = [libinstall+'/'+str(x) for x in lib]
72    Export('dep_lib')
73    
74    # add source files to release
75    release_srcfiles = [ env.File(x) for x in filenames + cppadapter_filenames ] + [env.File("SConscript"), ]
76    env.Zip(src_zipfile, release_srcfiles)
77    try:
78      env.Tar(src_tarfile, release_srcfiles)
79    except AttributeError:
80      pass
81    # Call the python sconscript
82    env.SConscript(dirs = ['#/finley/py_src'], build_dir='py', duplicate=0)
83    
84  libname = 'finleycpp'  # Call the unit tests SConscript
85    local_env.SConscript(dirs = ['#/finley/test'], build_dir='#/build/$PLATFORM/finley/test', duplicate=0)
86    
 finley_path = str(esysroot) + '/finley/src/finley'  
 finley_cppadapter_path = str(esysroot) + '/finley/src/finley/CPPAdapter'  
 paso_path = str(esysroot) + '/paso/inc'  
 escript_path = str(esysroot) + '/escript/inc'  
 esysUtils_path = str(esysroot) + '/esysUtils/inc'  
   
 esys_lib_path = str(esysroot) + '/lib'  
 mmio_lib_path = str(esysroot) + '/tools/mmio/lib'  
 esysUtils_lib_path = str(esysroot) + '/esysUtils/lib'  
   
 esysUtils_lib = str(esysUtils_lib_path) + '/libesysUtils.a'  
 escript_lib = str(esys_lib_path) + '/libescriptcpp.so'  
 paso_lib = str(esys_lib_path) + '/libpaso.a'  
 mmio_lib = str(mmio_lib_path) + '/libmmio.a'  
   
 cpp_path = [finley_path,  
             finley_cppadapter_path,  
             paso_path,  
             escript_path,  
             esysUtils_path,  
             python_path,  
             boost_path]  
   
 sources = ['Assemble_addToSystemMatrix.c',  
            'Assemble_CopyElementData.c',  
            'Assemble_CopyNodalData.c',  
            'Assemble_getAssembleParameters.c',  
            'Assemble_getSize.c',  
            'Assemble_gradient.c',  
            'Assemble_handelShapeMissMatch.c',  
            'Assemble_integrate.c',  
            'Assemble_interpolate.c',  
            'Assemble_NodeCoordinates.c',  
            'Assemble_PDE.c',  
            'Assemble_PDEMatrix_Single2.c',  
            'Assemble_PDEMatrix_System2.c',  
            'Assemble_PDE_RHS.c',  
            'Assemble_RHSMatrix_Single.c',  
            'Assemble_RHSMatrix_System.c',  
            'Assemble_RobinCondition.c',  
            'Assemble_RobinCondition_RHS.c',  
            'Assemble_setNormal.c',  
            'ElementFile_allocTable.c',  
            'ElementFile.c',  
            'ElementFile_copyTable.c',  
            'ElementFile_gather.c',  
            'ElementFile_improveColoring.c',  
            'ElementFile_markNodes.c',  
            'ElementFile_optimizeDistribution.c',  
            'ElementFile_prepare.c',  
            'ElementFile_relableNodes.c',  
            'ElementFile_scatter.c',  
            'ElementFile_setNodeRange.c',  
            'Finley.c',  
            'IndexList.c',  
            'Mesh.c',  
            'Mesh_findMatchingFaces.c',  
            'Mesh_getPattern.c',  
            'Mesh_glueFaces.c',  
            'Mesh_hex20.c',  
            'Mesh_hex8.c',  
            'Mesh_joinFaces.c',  
            'Mesh_line2.c',  
            'Mesh_line3.c',  
            'Mesh_markNodes.c',  
            'Mesh_merge.c',  
            'Mesh_prepare.c',  
            'Mesh_prepareNodes.c',  
            'Mesh_print.c',  
            'Mesh_read.c',  
            'Mesh_rec4.c',  
            'Mesh_rec8.c',  
            'Mesh_relabelElementNodes.c',  
            'Mesh_resolveNodeIds.c',  
            'Mesh_saveDX.c',  
            'Mesh_saveVTK.c',  
            'Mesh_write.c',  
            'NodeFile_allocTable.c',  
            'NodeFile.c',  
            'NodeFile_copyTable.c',  
            'NodeFile_gatter.c',  
            'NodeFile_scatter.c',  
            'NodeFile_setCoordinates.c',  
            'NodeFile_setIdRange.c',  
            'Quadrature.c',  
            'ReferenceElements.c',  
            'ShapeFunctions.c',  
            'Util.c',  
            'CPPAdapter/FinleyError.cpp',  
            'CPPAdapter/MeshAdapter.cpp',  
            'CPPAdapter/MeshAdapterFactory.cpp',  
            'CPPAdapter/SystemMatrixAdapter.cpp',  
            'CPPAdapter/finleycpp.cpp']  
   
 lib_path = [esys_lib_path,  
             mmio_lib_path,  
             esysUtils_lib_path,  
             boost_lib_path]  
   
 libs = ['escriptcpp',  
         'esysUtils',  
         'paso',  
         'mmio',  
         str(boost_lib),  
         'dl',  
         'util']  
   
 libs.extend(sys_libs)  
 libs.extend(solver_libs)  
   
 finley_env = Environment(ENV = os.environ)  
   
 finley_env.Replace(CC = cc)  
 finley_env.Replace(CXX = cxx)  
 finley_env.Replace(CCFLAGS = cc_flags)  
 finley_env.Replace(CXXFLAGS = cxx_flags)  
 finley_env.Replace(SHOBJSUFFIX = '.lo')  
 finley_env.Replace(CPPPATH = cpp_path)  
 finley_env.Replace(LIBPATH = lib_path)  
 finley_env.Replace(LIBS = libs)  
   
 finley_lib = finley_env.SharedLibrary(libname, sources)  
   
 Depends(finley_lib, esysUtils_lib)  
 Depends(finley_lib, escript_lib)  
 Depends(finley_lib, paso_lib)  
 Depends(finley_lib, mmio_lib)  
   
 finley_env.Install(libdir, finley_lib)  
 finley_env.Install(libdir2, finley_lib)  
 if libinstall != None:  
   finley_env.Install(libinstall, finley_lib)  

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

  ViewVC Help
Powered by ViewVC 1.1.26