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

Diff of /trunk/weipa/src/SConscript

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

revision 3258 by caltinay, Sun Sep 5 22:49:51 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  py_wrapper_local_env = clone_env(env_mpi)  py_wrapper_local_env = env.Clone()
18    
19  # Remove the shared library prefix on all platforms - we don't want 'lib'  # Remove the shared library prefix on all platforms - we don't want 'lib'
20  # mucking with our python modules  # mucking with our python modules
# Line 45  headers = """ Line 44  headers = """
44      weipa.h      weipa.h
45  """.split()  """.split()
46    
47  if local_env['usevisit']:  if local_env['visit']:
48      sources.append(['VisItData.cpp'])      sources.append(['VisItData.cpp'])
49      headers.append(['VisItData.h'])      headers.append(['VisItData.h'])
50      local_env.Append(CPPDEFINES = ['USE_VISIT'])      local_env.Append(CPPDEFINES = ['USE_VISIT'])
51      local_env.AppendUnique(LIBS = ['simV2'])      local_env.AppendUnique(LIBS = ['simV2'])
52    
53  local_env.AppendUnique(LIBS = ['esysUtils', 'finley', 'escript'] + env['sys_libs'])  local_env.Append(LIBS = ['finley', 'dudley','escript', 'esysUtils'])
54  if local_env['usesilo']:  if local_env['silo']:
55    local_env.Append(CPPDEFINES = ['USE_SILO'])      local_env.Append(CPPDEFINES = ['USE_SILO'])
56    local_env.AppendUnique(LIBS = [env['silo_libs']])      local_env.AppendUnique(LIBS = env['silo_libs'])
57    
58  if IS_WINDOWS_PLATFORM :  if IS_WINDOWS:
59    local_env.Append(CPPDEFINES = ['WEIPA_EXPORTS'])      local_env.Append(CPPDEFINES = ['WEIPA_EXPORTS'])
60    
61  module_name = 'weipa'  module_name = 'weipa'
62    
63  lib = local_env.SharedLibrary(module_name, sources)  lib = local_env.SharedLibrary(module_name, sources)
64  env.Alias('target_weipa_so', lib)  env.Alias('build_weipa_lib', lib)
65    
66  include_path = Dir('weipa', local_env['incinstall'])  include_path = Dir('weipa', local_env['incinstall'])
67    
68  tmp = local_env.Install(include_path, headers)  hdr_inst = local_env.Install(include_path, headers)
69  env.Alias('target_install_weipa_headers', [tmp])  env.Alias('install_weipa_headers', hdr_inst)
70    
71  tmp = local_env.Install(local_env['libinstall'], lib)  lib_inst = local_env.Install(local_env['libinstall'], lib)
72  env.Alias('target_install_weipa_so', tmp)  env.Alias('install_weipa_lib', lib_inst)
73    
74  ### Python wrapper ###  ### Python wrapper ###
75  py_wrapper_local_env.Append(LIBS = ['weipa', 'escript'] + env['sys_libs'])  py_wrapper_local_env.Append(LIBS = ['weipa', 'dudley','finley', 'escript', 'esysUtils'])
76  py_wrapper_name = module_name + 'cpp'  py_wrapper_name = module_name + 'cpp'
77  py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'weipacpp.cpp')  py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'weipacpp.cpp')
78  env.Alias('target_weipacpp_so', py_wrapper_lib)  env.Alias('build_weipacpp_lib', py_wrapper_lib)
79    
80  tmp_inst = os.path.join(local_env['pyinstall'], 'weipa')  tmp_inst = os.path.join(local_env['pyinstall'], module_name)
81  #windows specific mod  if IS_WINDOWS:
82  if os.name == 'nt':      wrapper_ext = '.pyd'
   wrapper_postfix = '.pyd'  
83  else:  else:
84    wrapper_postfix = '.so'      wrapper_ext = '.so'
85    
86  share_name = os.path.join(tmp_inst, py_wrapper_name + wrapper_postfix)  share_name = os.path.join(tmp_inst, py_wrapper_name+wrapper_ext)
87  tmp3 = py_wrapper_local_env.InstallAs(target=share_name,  mod_inst = py_wrapper_local_env.InstallAs(target=share_name,
88                                        source=py_wrapper_lib[0])                                            source=py_wrapper_lib[0])
89  env.Alias('target_install_weipacpp_so', tmp3)  env.Alias('install_weipacpp_lib', mod_inst)
   
 # export the lib target since tests will depend on it  
 # the lib target is a list of file nodes (why? win32 produces more than one  
 # output file: .lib, .dll, .pdb)  
 # FIXME: This list handling produces the desired result but can this be done  
 # directly with scons File nodes?  
 dep_lib = [local_env['libinstall']+'/'+str(x) for x in lib]  
 Export('dep_lib')  
90    
91  ######################  ######################
92  ### Plugin library ###  ### Plugin library ###
# Line 105  Export('dep_lib') Line 95  Export('dep_lib')
95  # files in the same build directory twice. The plugin is currently only for  # files in the same build directory twice. The plugin is currently only for
96  # Linux anyway. Correct fix is probably a second SConscript file with different  # Linux anyway. Correct fix is probably a second SConscript file with different
97  # build_dir setting.  # build_dir setting.
98  if not IS_WINDOWS_PLATFORM:  if not IS_WINDOWS:
99      visitplugin_env = clone_env(env_mpi)      visitplugin_env = env.Clone()
100      plugin_sources = """      plugin_sources = """
101          DataVar.cpp          DataVar.cpp
102          EscriptDataset.cpp          EscriptDataset.cpp
# Line 115  if not IS_WINDOWS_PLATFORM: Line 105  if not IS_WINDOWS_PLATFORM:
105          FinleyNodes.cpp          FinleyNodes.cpp
106      """.split()      """.split()
107    
108      visitplugin_env.AppendUnique(LIBS = ['esysUtils' ] + env['sys_libs'])      visitplugin_env.Append(LIBS = ['esysUtils' ])
109      visitplugin_env.Append(CPPDEFINES = ['VISIT_PLUGIN'])      visitplugin_env.Append(CPPDEFINES = ['VISIT_PLUGIN'])
110    
111      plugin_lib = visitplugin_env.StaticLibrary('escriptreader', plugin_sources)      plugin_lib = visitplugin_env.StaticLibrary('escriptreader', plugin_sources)
112      env.Alias('target_escriptreader_a', plugin_lib)      env.Alias('build_escriptreader_lib', plugin_lib)
113    
114      tmp = local_env.Install(local_env['libinstall'], plugin_lib)      tmp = local_env.Install(local_env['libinstall'], plugin_lib)
115      env.Alias('target_install_escriptreader_a', tmp)      env.Alias('install_escriptreader_lib', tmp)
116    
117  # Call the python SConscript  # configure python module
118  CallSConscript(env,dirs = ['#/weipa/py_src'], variant_dir='py', duplicate=0)  local_env.SConscript(dirs = ['#/weipa/py_src'], variant_dir='py', duplicate=0, exports=['py_wrapper_lib'])
119    
120  # Call the unit tests SConscript  # configure unit tests
121  CallSConscript(local_env,dirs = ['#/weipa/test'], variant_dir='#/build/$PLATFORM/weipa/test', duplicate=0)  local_env.SConscript(dirs = ['#/weipa/test'], variant_dir='#/build/$PLATFORM/weipa/test', duplicate=0)
122    

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

  ViewVC Help
Powered by ViewVC 1.1.26