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

Diff of /trunk/escript/src/SConscript

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

revision 3258 by jfenwick, Tue Aug 3 03:12:16 2010 UTC revision 3259 by jfenwick, Mon Oct 11 01:48:14 2010 UTC
# Line 10  Line 10 
10  #  #
11  ########################################################  ########################################################
12    
   
13  import os  import os
14  Import('*')  Import('*')
15    
16  local_env = clone_env(env_mpi)  local_env = env.Clone()
17  local_dodgy = clone_env(dodgy_env)  local_dodgy = dodgy_env.Clone()
18  py_wrapper_local_env = clone_env(env_mpi)  py_wrapper_local_env = env.Clone()
19    
20  # 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'
21    # mucking with our python modules
22  del py_wrapper_local_env['SHLIBPREFIX']  del py_wrapper_local_env['SHLIBPREFIX']
23    
24  sources = """  sources = """
25      AbstractContinuousDomain.cpp      AbstractContinuousDomain.cpp
26      AbstractDomain.cpp      AbstractDomain.cpp
27      AbstractSystemMatrix.cpp      AbstractSystemMatrix.cpp
28      AbstractTransportProblem.cpp      AbstractTransportProblem.cpp
29      Data.cpp      Data.cpp
30      DataAbstract.cpp      DataAbstract.cpp
31      DataBlocks2D.cpp      DataBlocks2D.cpp
32      DataC.cpp      DataC.cpp
33      DataConstant.cpp      DataConstant.cpp
34      DataEmpty.cpp      DataEmpty.cpp
35      DataException.cpp      DataException.cpp
36      DataExpanded.cpp      DataExpanded.cpp
37      DataFactory.cpp      DataFactory.cpp
38      DataLazy.cpp      DataLazy.cpp
39      DataMaths.cpp      DataMaths.cpp
40      DataReady.cpp      DataReady.cpp
41      DataTagged.cpp      DataTagged.cpp
42      DataTypes.cpp      DataTypes.cpp
43      DataVector.cpp      DataVector.cpp
44      DomainException.cpp      DomainException.cpp
45      EscriptParams.cpp      EscriptParams.cpp
46      FunctionSpace.cpp      FunctionSpace.cpp
47      FunctionSpaceException.cpp      FunctionSpaceException.cpp
48      FunctionSpaceFactory.cpp      FunctionSpaceFactory.cpp
49      LapackInverseHelper.cpp      LapackInverseHelper.cpp
50      NullDomain.cpp      NullDomain.cpp
51      SystemMatrixException.cpp      SystemMatrixException.cpp
52      Taipan.cpp      Taipan.cpp
53      TestDomain.cpp      TestDomain.cpp
54      TransportProblemException.cpp      TransportProblemException.cpp
55      Utils.cpp      Utils.cpp
56      WrappedArray.cpp      WrappedArray.cpp
57  """.split()  """.split()
58      # blocktimer.c      # blocktimer.c
59  headers = """  headers = """
60      AbstractContinuousDomain.h      AbstractContinuousDomain.h
61      AbstractDomain.h      AbstractDomain.h
62      AbstractSystemMatrix.h      AbstractSystemMatrix.h
63      AbstractTransportProblem.h      AbstractTransportProblem.h
64      BinaryOp.h      BinaryOp.h
65      Data.h      Data.h
66      DataAbstract.h      DataAbstract.h
67      DataAlgorithm.h      DataAlgorithm.h
68      DataBlocks2D.h      DataBlocks2D.h
69      DataC.h      DataC.h
70      DataConstant.h      DataConstant.h
71      DataEmpty.h      DataEmpty.h
72      DataException.h      DataException.h
73      DataExpanded.h      DataExpanded.h
74      DataFactory.h      DataFactory.h
75      DataLazy.h      DataLazy.h
76      DataMaths.h      DataMaths.h
77      DataReady.h      DataReady.h
78      DataTagged.h      DataTagged.h
79      DataTypes.h      DataTypes.h
80      DataVector.h      DataVector.h
81      Dodgy.h      Dodgy.h
82      DomainException.h      DomainException.h
83      EscriptParams.h      EscriptParams.h
84      FunctionSpace.h      FunctionSpace.h
85      FunctionSpaceException.h      FunctionSpaceException.h
86      FunctionSpaceFactory.h      FunctionSpaceFactory.h
87      LapackInverseHelper.h      LapackInverseHelper.h
88      LocalOps.h      LocalOps.h
89      NullDomain.h      NullDomain.h
90      Pointers.h      Pointers.h
91      SystemMatrixException.h      SystemMatrixException.h
92      Taipan.h      Taipan.h
93      TestDomain.h      TestDomain.h
94      TransportProblemException.h      TransportProblemException.h
95      UnaryFuncs.h      UnaryFuncs.h
96      UnaryOp.h      UnaryOp.h
97      UtilC.h      UtilC.h
98      Utils.h      Utils.h
99      WrappedArray.h      WrappedArray.h
100      esysmpi.h      system_dep.h
     system_dep.h  
101  """.split()  """.split()
102      # blocktimer.h      # blocktimer.h
103    
104  dodgy_sources = """  dodgy_sources = """
105      Dodgy.cpp      Dodgy.cpp
106  """.split()  """.split()
107    
108  local_env.Append(LIBS = [ 'esysUtils'] + env['sys_libs'] )  local_env.Append(LIBS = ['esysUtils'])
109  local_dodgy.Append(LIBS = [ 'esysUtils'] + env['sys_libs'] )  local_dodgy.Append(LIBS = ['esysUtils'])
110    if IS_WINDOWS:
111  if IS_WINDOWS_PLATFORM :      local_env.Append(CPPDEFINES = ['ESCRIPT_EXPORTS'])
112    local_env.Append(CPPDEFINES = ['ESCRIPT_EXPORTS'])      local_dodgy.Append(CPPDEFINES = ['ESCRIPT_EXPORTS'])
   local_dodgy.Append(CPPDEFINES = ['ESCRIPT_EXPORTS'])  
   
 py_wrapper_local_env.Append(LIBS = [ 'escript', 'esysUtils'] + env['sys_libs'])  
113    
114  module_name = 'escript'  module_name = 'escript'
 py_wrapper_name = module_name + 'cpp'  
115    
116  #Specify to build shared object  # specify to build shared object
117  if local_env['iknowwhatimdoing']:  if local_env['iknowwhatimdoing']:
118     nonped=[local_dodgy.SharedObject(x) for x in dodgy_sources]      nonped=[local_dodgy.SharedObject(x) for x in dodgy_sources]
119  else:  else:
120     nonped=[]      nonped=[]
121    
122  lib = local_env.SharedLibrary(module_name, sources+nonped)  lib = local_env.SharedLibrary(module_name, sources+nonped)
123  env.Alias('target_escript_so', lib)  env.Alias('build_escript_lib', lib)
   
 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'escriptcpp.cpp')  
 env.Alias('target_escriptcpp_so', py_wrapper_lib)  
124    
125  include_path = Dir('escript', local_env['incinstall'])  include_path = Dir('escript', local_env['incinstall'])
126    hdr_inst = local_env.Install(include_path, headers)
127    env.Alias('install_escript_headers', hdr_inst)
128    
129  tmp1 = local_env.Install(include_path, headers )  lib_inst = local_env.Install(local_env['libinstall'], lib)
130  env.Alias('target_install_escript_headers', [tmp1])  env.Alias('install_escript_lib', lib_inst)
131    
132  tmp3 = local_env.Install(local_env['libinstall'], lib)  ### Python wrapper ###
133  env.Alias('target_install_escript_so', tmp3)  py_wrapper_local_env.Append(LIBS = ['escript', 'esysUtils'])
134    py_wrapper_name = module_name + 'cpp'
135    py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'escriptcpp.cpp')
136    env.Alias('build_escriptcpp_lib', py_wrapper_lib)
137    
138  #windows specific mod  tmp_inst = os.path.join(local_env['pyinstall'], module_name)
139  tmp_inst = os.path.join(local_env['pyinstall'],module_name)  if IS_WINDOWS:
140  if os.name == 'nt':      wrapper_ext = '.pyd'
   wrapper_postfix = '.pyd'  
141  else:  else:
142    wrapper_postfix = '.so'      wrapper_ext = '.so'
   
 share_name = os.path.join(tmp_inst,py_wrapper_name+wrapper_postfix)  
   
 tmp4 = py_wrapper_local_env.InstallAs(target=share_name,  
                                       source=py_wrapper_lib[0])  
   
 env.Alias('target_install_escriptcpp_so', tmp4)  
143    
144  # export the lib target since tests will depend on it  share_name = os.path.join(tmp_inst, py_wrapper_name+wrapper_ext)
145  # the lib target is a list of file nodes (why? win32 produces more than one output file: .lib, .dll, .pdb)  mod_inst = py_wrapper_local_env.InstallAs(target=share_name,
146  # FIXME: This list handling produces the desired result but can this be done directly with scons File nodes?                                            source=py_wrapper_lib[0])
147  dep_lib = [local_env['libinstall']+'/'+str(x) for x in lib]  env.Alias('install_escriptcpp_lib', mod_inst)
 Export('dep_lib')  
148    
149  # Call the python sconscript  # configure python module
150  CallSConscript(env,dirs = ['#/escript/py_src'], variant_dir='py', duplicate=0)  local_env.SConscript(dirs = ['#/escript/py_src'], variant_dir='py', duplicate=0)
151    
152  # Call the unit tests SConscript  # configure unit tests
153  CallSConscript(local_env,dirs = ['#/escript/test'], variant_dir='#/build/$PLATFORM/escript/test', duplicate=0)  local_env.SConscript(dirs = ['#/escript/test'], variant_dir='#/build/$PLATFORM/escript/test', duplicate=0, exports=['py_wrapper_lib'])
154    

Legend:
Removed from v.3258  
changed lines
  Added in v.3259

  ViewVC Help
Powered by ViewVC 1.1.26