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

Diff of /trunk/escript/src/SConscript

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

trunk/escript/src/Data/SConscript revision 352 by jgs, Wed Dec 14 02:21:37 2005 UTC trunk/escript/src/SConscript revision 1872 by jfenwick, Mon Oct 13 00:18:55 2008 UTC
# Line 1  Line 1 
1  libinstall = None  ########################################################
2    #
3    # Copyright (c) 2003-2008 by University of Queensland
4    # Earth Systems Science Computational Center (ESSCC)
5    # http://www.uq.edu.au/esscc
6    #
7    # Primary Business: Queensland, Australia
8    # Licensed under the Open Software License version 3.0
9    # http://www.opensource.org/licenses/osl-3.0.php
10    #
11    ########################################################
12    
 Import('*')  
13    
14  import os  import os
15  import string  Import('*')
16    
17    local_env = clone_env(env_mpi)
18    py_wrapper_local_env = clone_env(env_mpi)
19    
20    # Remove the sharedlibrary prefix on all platform - we don't want 'lib' mucking with our python modules
21    del py_wrapper_local_env['SHLIBPREFIX']
22    
23  libname = 'escriptcpp'  sources = """
24        AbstractContinuousDomain.cpp
25        AbstractDomain.cpp
26        AbstractSystemMatrix.cpp
27        AbstractTransportProblem.cpp
28        Data.cpp
29        DataAbstract.cpp
30        DataBlocks2D.cpp
31        DataC.cpp
32        DataConstant.cpp
33        DataEmpty.cpp
34        DataException.cpp
35        DataExpanded.cpp
36        DataFactory.cpp
37        DataMaths.cpp
38        DataTagged.cpp
39        DataTypes.cpp
40        DataVector.cpp
41        DomainException.cpp
42        FunctionSpace.cpp
43        FunctionSpaceException.cpp
44        FunctionSpaceFactory.cpp
45        NullDomain.cpp
46        SystemMatrixException.cpp
47        Taipan.cpp
48        TransportProblemException.cpp
49        Utils.cpp
50        blocktimer.c
51    """.split()
52    headers = """
53        AbstractContinuousDomain.h
54        AbstractDomain.h
55        AbstractSystemMatrix.h
56        AbstractTransportProblem.h
57        BinaryOp.h
58        Data.h
59        DataAbstract.h
60        DataAlgorithm.h
61        DataBlocks2D.h
62        DataC.h
63        DataConstant.h
64        DataEmpty.h
65        DataException.h
66        DataExpanded.h
67        DataFactory.h
68        DataMaths.h
69        DataTagged.h
70        DataTypes.h
71        DataVector.h
72        DomainException.h
73        FunctionSpace.h
74        FunctionSpaceException.h
75        FunctionSpaceFactory.h
76        LocalOps.h
77        NullDomain.h
78        Pointers.h
79        SystemMatrixException.h
80        Taipan.h
81        TransportProblemException.h
82        UnaryFuncs.h
83        UnaryOp.h
84        UtilC.h
85        Utils.h
86        blocktimer.h
87        esysmpi.h
88        system_dep.h
89    """.split()
90    
91    local_env.Append(LIBS = [ 'esysUtils'] + env['sys_libs'] )
92    py_wrapper_local_env.Append(LIBS = [ 'escript', 'esysUtils'] + env['sys_libs'])
93    
94    module_name = 'escript'
95    py_wrapper_name = module_name + 'cpp'
96    
97    lib = local_env.SharedLibrary(module_name, sources)
98    env.Alias('target_escript_so', lib)
99    
100    py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'escriptcpp.cpp')
101    env.Alias('target_escriptcpp_so', py_wrapper_lib)
102    
103    include_path = Dir('escript', local_env['incinstall'])
104    
105    tmp1 = local_env.Install(include_path, headers )
106    env.Alias('target_install_escript_headers', [tmp1])
107    
108    tmp3 = local_env.Install(local_env['libinstall'], lib)
109    env.Alias('target_install_escript_so', tmp3)
110    
111    #windows specific mod
112    tmp_inst = os.path.join(local_env['pyinstall'],module_name)
113    if os.name == 'nt':
114      wrapper_postfix = '.pyd'
115    else:
116      wrapper_postfix = '.so'
117    
118    share_name = os.path.join(tmp_inst,py_wrapper_name+wrapper_postfix)
119    
120    tmp4 = py_wrapper_local_env.InstallAs(target=share_name,
121                                          source=py_wrapper_lib[0])
122    
123    env.Alias('target_install_escriptcpp_so', tmp4)
124    
125    # export the lib target since tests will depend on it
126    # the lib target is a list of file nodes (why? win32 produces more than one output file: .lib, .dll, .pdb)
127    # FIXME: This list handling produces the desired result but can this be done directly with scons File nodes?
128    dep_lib = [local_env['libinstall']+'/'+str(x) for x in lib]
129    Export('dep_lib')
130    
131  escript_path = str(esysroot) + '/escript/inc'  # Call the python sconscript
132  esysUtils_path = str(esysroot) + '/esysUtils/inc'  env.SConscript(dirs = ['#/escript/py_src'], build_dir='py', duplicate=0)
133    
134  esysUtils_lib_path = str(esysroot) + '/esysUtils/lib'  # Call the unit tests SConscript
135    local_env.SConscript(dirs = ['#/escript/test'], build_dir='#/build/$PLATFORM/escript/test', duplicate=0)
136    
 esysUtils_lib = str(esysUtils_lib_path) + '/libesysUtils.a'  
   
 cpp_path = [escript_path,  
             esysUtils_path,  
             python_path,  
             boost_path]  
   
 sources = ['AbstractContinuousDomain.cpp',  
            'AbstractDomain.cpp',  
            'AbstractSystemMatrix.cpp',  
            'DataAbstract.cpp',  
            'DataArray.cpp',  
            'DataArrayView.cpp',  
            'DataBlocks2D.cpp',  
            'DataCached.cpp',  
            'DataC.cpp',  
            'DataConstant.cpp',  
            'Data.cpp',  
            'DataEmpty.cpp',  
            'DataExpanded.cpp',  
            'DataFactory.cpp',  
            'DataProf.cpp',  
            'DataTagged.cpp',  
            'DataVariable.cpp',  
            'DataVector.cpp',  
            'FunctionSpace.cpp',  
            'FunctionSpaceFactory.cpp',  
            'NullDomain.cpp',  
            'Taipan.cpp',  
            'escriptcpp.cpp']  
   
 lib_path = [esysUtils_lib_path,  
             boost_lib_path]  
   
 libs = ['esysUtils',  
         str(boost_lib)]  
   
 libs.extend(sys_libs)  
   
 escript_env = Environment(ENV = os.environ)  
   
 escript_env.Replace(CXX = cxx)  
 escript_env.Replace(SHOBJSUFFIX = '.lo')  
 escript_env.Replace(CXXFLAGS = cxx_flags)  
 escript_env.Replace(CPPPATH = cpp_path)  
 escript_env.Replace(LIBPATH = lib_path)  
 escript_env.Replace(LIBS = libs)  
   
 escript_lib = escript_env.SharedLibrary(libname, sources)  
   
 Depends(escript_lib, esysUtils_lib)  
   
 Default(escript_env.Install(libdir, escript_lib))  
 Default(escript_env.Install(libdir2, escript_lib))  
 if libinstall != None:  
   Default(escript_env.Install(libinstall, escript_lib))  

Legend:
Removed from v.352  
changed lines
  Added in v.1872

  ViewVC Help
Powered by ViewVC 1.1.26