/[escript]/release/3.4.2/pasowrap/src/SConscript
ViewVC logotype

Contents of /release/3.4.2/pasowrap/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4919 - (show annotations)
Wed Apr 30 06:25:55 2014 UTC (6 years, 1 month ago) by jfenwick
File size: 2632 byte(s)
Because we've got to!

1 ##############################################################################
2 #
3 # Copyright (c) 2003-2014 by University of Queensland
4 # http://www.uq.edu.au
5 #
6 # Primary Business: Queensland, Australia
7 # Licensed under the Open Software License version 3.0
8 # http://www.opensource.org/licenses/osl-3.0.php
9 #
10 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
11 # Development 2012-2013 by School of Earth Sciences
12 # Development from 2014 by Centre for Geoscience Computing (GeoComp)
13 #
14 ##############################################################################
15
16 import os
17 Import('*')
18
19 local_env = env.Clone()
20 local_dodgy = dodgy_env.Clone()
21 py_wrapper_local_env = env.Clone()
22
23 # Remove the sharedlibrary prefix on all platform - we don't want 'lib'
24 # mucking with our python modules
25 del py_wrapper_local_env['SHLIBPREFIX']
26
27 sources = """
28 PasoException.cpp
29 SystemMatrixAdapter.cpp
30 TransportProblemAdapter.cpp
31 """.split()
32
33 headers = """
34 PasoException.h
35 SystemMatrixAdapter.h
36 TransportProblemAdapter.h
37 system_dep.h
38 """.split()
39
40 local_env.Prepend(LIBS = ['escript', 'paso', 'esysUtils'])
41 if IS_WINDOWS:
42 local_env.Append(CPPDEFINES = ['PASOWRAP_EXPORTS'])
43
44 module_name = 'pasowrap'
45
46 # specify to build shared object
47
48 lib = local_env.SharedLibrary(module_name, sources)
49 env.Alias('build_pasowrap_lib', lib)
50
51 include_path = Dir('pasowrap', local_env['incinstall'])
52 hdr_inst = local_env.Install(include_path, headers)
53 env.Alias('install_pasowrap_headers', hdr_inst)
54
55 lib_inst = local_env.Install(local_env['libinstall'], lib)
56 env.Alias('install_pasowrap_lib', lib_inst)
57
58 ### Python wrapper ###
59 if not env['build_shared']:
60 py_wrapper_local_env.Prepend(LIBS = ['pasowrap', 'escript', 'esysUtils'])
61 else:
62 py_wrapper_local_env.Prepend(LIBS = ['pasowrap', 'escript', 'paso', 'esysUtils'])
63 py_wrapper_name = module_name + 'cpp'
64 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'pasowrapcpp.cpp')
65 env.Alias('build_pasowrapcpp_lib', py_wrapper_lib)
66
67 tmp_inst = os.path.join(local_env['pyinstall'], module_name)
68 if IS_WINDOWS:
69 wrapper_ext = '.pyd'
70 else:
71 wrapper_ext = '.so'
72
73 share_name = os.path.join(tmp_inst, py_wrapper_name+wrapper_ext)
74 mod_inst = py_wrapper_local_env.InstallAs(target=share_name,
75 source=py_wrapper_lib[0])
76 env.Alias('install_pasowrapcpp_lib', mod_inst)
77
78 # configure python module
79 local_env.SConscript(dirs = ['#/pasowrap/py_src'], variant_dir='py', duplicate=0)
80
81 # configure unit tests
82 #local_env.SConscript(dirs = ['#/pasowrap/test'], variant_dir='test', duplicate=0, exports=['py_wrapper_lib'])
83

  ViewVC Help
Powered by ViewVC 1.1.26