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

Contents of /trunk/weipa/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3078 - (show annotations)
Tue Aug 3 03:12:16 2010 UTC (9 years, 11 months ago) by jfenwick
File size: 3769 byte(s)
Switched the build_dir keyword param to variant_dir.
Should fix issue 525.


1 ########################################################
2 #
3 # Copyright (c) 2003-2010 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
13
14 import os
15 Import('*')
16
17 local_env = clone_env(env_mpi)
18 py_wrapper_local_env = clone_env(env_mpi)
19
20 # Remove the shared library prefix on all platforms - we don't want 'lib'
21 # mucking with our python modules
22 del py_wrapper_local_env['SHLIBPREFIX']
23
24 sources = """
25 DataVar.cpp
26 ElementData.cpp
27 EscriptDataset.cpp
28 FileSavers.cpp
29 FinleyMesh.cpp
30 NodeData.cpp
31 """.split()
32
33 headers = """
34 DataVar.h
35 ElementData.h
36 EscriptDataset.h
37 FileSavers.h
38 FinleyMesh.h
39 NodeData.h
40 weipa.h
41 """.split()
42
43 local_env.AppendUnique(LIBS = ['esysUtils', 'finley', 'escript'] + env['sys_libs'])
44 if local_env['usesilo']:
45 local_env.Append(CPPDEFINES = ['USE_SILO'])
46 local_env.AppendUnique(LIBS = [env['silo_libs']])
47
48 if IS_WINDOWS_PLATFORM :
49 local_env.Append(CPPDEFINES = ['WEIPA_EXPORTS'])
50
51 module_name = 'weipa'
52
53 lib = local_env.SharedLibrary(module_name, sources)
54 env.Alias('target_weipa_so', lib)
55
56 include_path = Dir('weipa', local_env['incinstall'])
57
58 tmp = local_env.Install(include_path, headers)
59 env.Alias('target_install_weipa_headers', [tmp])
60
61 tmp = local_env.Install(local_env['libinstall'], lib)
62 env.Alias('target_install_weipa_so', tmp)
63
64 ### Python wrapper ###
65 py_wrapper_local_env.Append(LIBS = ['weipa'] + env['sys_libs'])
66 py_wrapper_name = module_name + 'cpp'
67 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'weipacpp.cpp')
68 env.Alias('target_weipacpp_so', py_wrapper_lib)
69
70 tmp_inst = os.path.join(local_env['pyinstall'], 'weipa')
71 #windows specific mod
72 if os.name == 'nt':
73 wrapper_postfix = '.pyd'
74 else:
75 wrapper_postfix = '.so'
76
77 share_name = os.path.join(tmp_inst, py_wrapper_name + wrapper_postfix)
78 tmp3 = py_wrapper_local_env.InstallAs(target=share_name,
79 source=py_wrapper_lib[0])
80 env.Alias('target_install_weipacpp_so', tmp3)
81
82 # export the lib target since tests will depend on it
83 # the lib target is a list of file nodes (why? win32 produces more than one
84 # output file: .lib, .dll, .pdb)
85 # FIXME: This list handling produces the desired result but can this be done
86 # directly with scons File nodes?
87 dep_lib = [local_env['libinstall']+'/'+str(x) for x in lib]
88 Export('dep_lib')
89
90 ######################
91 ### Plugin library ###
92 ######################
93 # This is disabled on Windows since Scons complains about compiling the same
94 # files in the same build directory twice. The plugin is currently only for
95 # Linux anyway. Correct fix is probably a second SConscript file with different
96 # build_dir setting.
97 if not IS_WINDOWS_PLATFORM:
98 visitplugin_env = clone_env(env_mpi)
99 plugin_sources = """
100 DataVar.cpp
101 ElementData.cpp
102 EscriptDataset.cpp
103 FinleyMesh.cpp
104 NodeData.cpp
105 """.split()
106
107 visitplugin_env.AppendUnique(LIBS = ['esysUtils' ] + env['sys_libs'])
108 visitplugin_env.Append(CPPDEFINES = ['VISIT_PLUGIN'])
109
110 plugin_lib = visitplugin_env.StaticLibrary('escriptreader', plugin_sources)
111 env.Alias('target_escriptreader_a', plugin_lib)
112
113 tmp = local_env.Install(local_env['libinstall'], plugin_lib)
114 env.Alias('target_install_escriptreader_a', tmp)
115
116
117 # Call the python SConscript
118 CallSConscript(env,dirs = ['#/weipa/py_src'], variant_dir='py', duplicate=0)
119
120 # Call the unit tests SConscript
121 #CallSConscript(local_env,dirs = ['#/weipa/test'], variant_dir='#/build/$PLATFORM/weipa/test', duplicate=0)
122

  ViewVC Help
Powered by ViewVC 1.1.26