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

Diff of /branches/arrayview_from_1695_trunk/escript/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 
1    #
2    # $Id$
3    #
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
12    #     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 = 'escript'  sources = """
27  py_wrapper_name = lib_name+'cpp'      AbstractContinuousDomain.cpp
28  py_wrapper_source = py_wrapper_name+'.cpp'      AbstractDomain.cpp
29  py_wrapper_lib_name = py_wrapper_name      AbstractSystemMatrix.cpp
30        AbstractTransportProblem.cpp
31  # get the relevant file names:      Data.cpp
32  src_dir = local_env.Dir('.').srcnode().abspath      DataAbstract.cpp
33  filenames = [ x for x in os.listdir(src_dir) if os.path.splitext(x)[1] in [".h", ".c", ".cpp"] ]      DataBlocks2D.cpp
34        DataC.cpp
35  sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]      DataConstant.cpp
36  headers = [x for x in filenames if os.path.splitext(x)[1] in ['.h']]      DataEmpty.cpp
37        DataException.cpp
38  # Filter out sources that should not be in the list automatically      DataExpanded.cpp
39  sources.remove(py_wrapper_source) # FIXME: should probably refactor the source tree so the python wrapper isn't colocated with c++ sources      DataFactory.cpp
40        DataMaths.cpp
41  local_env.Append(LIBS = [boost_lib] + [ 'esysUtils'] + sys_libs + netCDF_libs + mpi_libs + [python_lib])      DataTagged.cpp
42  py_wrapper_local_env.Append(LIBS = [boost_lib] + [ lib_name, 'esysUtils'] + sys_libs + netCDF_libs + [python_lib])      DataTypes.cpp
43  if useNetCDF == 'yes':      DataVector.cpp
44      local_env.Append(LIBS = netCDF_libs)      DomainException.cpp
45      local_env.Append(CPPDEFINES = [ 'USE_NETCDF' ])      FunctionSpace.cpp
46      py_wrapper_local_env.Append(LIBS = netCDF_libs)      FunctionSpaceException.cpp
47      py_wrapper_local_env.Append(CPPDEFINES = [ 'USE_NETCDF' ])      FunctionSpaceFactory.cpp
48        NullDomain.cpp
49  if papi_instrument_solver:      SystemMatrixException.cpp
50     local_env.Append(CPPDEFINES=['PAPI',])      Taipan.cpp
51  if papi_libs:      TransportProblemException.cpp
52     local_env.Append(LIBS = papi_libs)      Utils.cpp
53     local_env.Append(CPPDEFINES=['BLOCKPAPI',])      blocktimer.c
54    """.split()
55  local_env.Append(CPPDEFINES = [ 'ESCRIPT_EXPORTS'] )  headers = """
56        AbstractContinuousDomain.h
57  lib = local_env.SharedLibrary(lib_name, sources)      AbstractDomain.h
58  py_wrapper_lib = py_wrapper_local_env.SharedLibrary( py_wrapper_lib_name, py_wrapper_source)      AbstractSystemMatrix.h
59        AbstractTransportProblem.h
60  include_path = Dir(lib_name, incinstall)      BinaryOp.h
61        Data.h
62  local_env.Install(include_path, headers )      DataAbstract.h
63  local_env.Install(libinstall, lib)      DataAlgorithm.h
64  py_wrapper_local_env.InstallAs(pyinstall+'/escript/escriptcpp.so', py_wrapper_lib)      DataBlocks2D.h
65        DataC.h
66        DataConstant.h
67        DataEmpty.h
68        DataException.h
69        DataExpanded.h
70        DataFactory.h
71        DataMaths.h
72        DataTagged.h
73        DataTypes.h
74        DataVector.h
75        DomainException.h
76        FunctionSpace.h
77        FunctionSpaceException.h
78        FunctionSpaceFactory.h
79        LocalOps.h
80        NullDomain.h
81        SystemMatrixException.h
82        Taipan.h
83        TransportProblemException.h
84        UnaryFuncs.h
85        UnaryOp.h
86        UtilC.h
87        Utils.h
88        blocktimer.h
89        esysmpi.h
90        system_dep.h
91    """.split()
92    
93    local_env.Append(LIBS = [ 'esysUtils'] + env['sys_libs'] )
94    py_wrapper_local_env.Append(LIBS = [ 'escript', 'esysUtils'] + env['sys_libs'])
95    
96    lib = local_env.SharedLibrary('escript', sources)
97    env.Alias('target_escript_so', lib)
98    
99    py_wrapper_lib = py_wrapper_local_env.SharedLibrary('escriptcpp', 'escriptcpp.cpp')
100    env.Alias('target_escriptcpp_so', py_wrapper_lib)
101    
102    include_path = Dir('escript', local_env['incinstall'])
103    
104    tmp1 = local_env.Install(include_path, headers )
105    env.Alias('target_install_escript_headers', [tmp1])
106    
107    tmp3 = local_env.Install(local_env['libinstall'], lib)
108    env.Alias('target_install_escript_so', tmp3)
109    
110  #windows specific mod  #windows specific mod
111  if os.name == 'nt':  if os.name == 'nt':
112     py_wrapper_local_env.InstallAs(target = [ pyinstall+'/escript/'+py_wrapper_lib_name+'.pyd', \    tmp4 = py_wrapper_local_env.Install(local_env['pyinstall']+'/escript', ['escriptcpp.pyd', 'escriptcpp.lib', 'escriptcpp.exp'])
113                                               pyinstall+'/escript/'+py_wrapper_lib_name+'.lib', \  else:
114                                               pyinstall+'/escript/'+py_wrapper_lib_name+'.exp' ], \    tmp4 = py_wrapper_local_env.InstallAs(local_env['pyinstall']+'/escript/escriptcpp.so', py_wrapper_lib)
115                                 source = py_wrapper_lib )  env.Alias('target_install_escriptcpp_so', tmp4)
116    
117  # export the lib target since tests will depend on it  # export the lib target since tests will depend on it
118  # 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)
119  # 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?
120  dep_lib = [libinstall+'/'+str(x) for x in lib]  dep_lib = [local_env['libinstall']+'/'+str(x) for x in lib]
121  Export('dep_lib')  Export('dep_lib')
122    
   
   
 # add source files to release  
 release_srcfiles = [ env.File(x) for x in filenames ] + [env.File("SConscript"), ]  
 env.Zip(src_zipfile, release_srcfiles)  
 env.Tar(src_tarfile, release_srcfiles)  
   
123  # Call the python sconscript  # Call the python sconscript
124  env.SConscript(dirs = ['#/escript/py_src'], build_dir='py', duplicate=0)  env.SConscript(dirs = ['#/escript/py_src'], build_dir='py', duplicate=0)
125    
126  # Call the unit tests SConscript  # Call the unit tests SConscript
127  local_env.SConscript(dirs = ['#/escript/test'], build_dir='#/build/$PLATFORM/escript/test', duplicate=0)  local_env.SConscript(dirs = ['#/escript/test'], build_dir='#/build/$PLATFORM/escript/test', duplicate=0)
128    

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

  ViewVC Help
Powered by ViewVC 1.1.26