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

Annotation of /trunk/speckley/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6124 - (hide annotations)
Tue Apr 5 03:23:12 2016 UTC (3 years, 1 month ago) by caltinay
File size: 2496 byte(s)
Fixing python module build on OS X. Added PythonModule builder so we do this generically now.
1 sshaw 5123
2     ##############################################################################
3     #
4 jfenwick 5863 # Copyright (c) 2003-2016 by The University of Queensland
5 sshaw 5123 # http://www.uq.edu.au
6     #
7     # Primary Business: Queensland, Australia
8 jfenwick 6112 # Licensed under the Apache License, version 2.0
9     # http://www.apache.org/licenses/LICENSE-2.0
10 sshaw 5123 #
11     # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12     # Development 2012-2013 by School of Earth Sciences
13     # Development from 2014 by Centre for Geoscience Computing (GeoComp)
14     #
15     ##############################################################################
16    
17     Import('*')
18    
19 caltinay 6119 module_name = 'speckley'
20 sshaw 5123
21     sources = """
22     AbstractAssembler.cpp
23     Brick.cpp
24     BrickGradients.cpp
25     BrickIntegrals.cpp
26 sshaw 5478 BrickReductions.cpp
27 sshaw 5226 DefaultAssembler2D.cpp
28     DefaultAssembler3D.cpp
29     domainhelpers.cpp
30 sshaw 5123 Rectangle.cpp
31     RectangleGradients.cpp
32     RectangleIntegrals.cpp
33 sshaw 5478 RectangleReductions.cpp
34 sshaw 5123 SpeckleyDomain.cpp
35 sshaw 5574 WaveAssembler2D.cpp
36     WaveAssembler3D.cpp
37 sshaw 5123 """.split()
38    
39     headers = """
40     AbstractAssembler.h
41     Brick.h
42 sshaw 5226 DefaultAssembler2D.h
43     DefaultAssembler3D.h
44     domainhelpers.h
45 sshaw 5191 lagrange_functions.h
46 sshaw 5123 Rectangle.h
47     Speckley.h
48     SpeckleyDomain.h
49     SpeckleyException.h
50     system_dep.h
51 sshaw 5574 WaveAssembler2D.h
52     WaveAssembler3D.h
53 sshaw 5123 """.split()
54    
55 caltinay 6119 local_env = env.Clone()
56 sshaw 5226
57 caltinay 6119 if IS_WINDOWS:
58     local_env.Append(CPPDEFINES = ['Speckley_EXPORTS'])
59    
60     # collect dependencies for other modules
61     speckleylibs = ['escript']
62    
63 sshaw 5226 if 'ripley' in env['domains']:
64     local_env.Append(CPPDEFINES = ['USE_RIPLEY'])
65 caltinay 6119 speckleylibs += env['ripley_libs']
66 sshaw 5226 sources += ['CrossDomainCoupler.cpp']
67     headers += ['CrossDomainCoupler.h']
68    
69 caltinay 6119 if env['silo']:
70 sshaw 5123 local_env.Append(CPPDEFINES = ['USE_SILO'])
71 caltinay 6119 speckleylibs += env['silo_libs']
72 sshaw 5123
73 caltinay 6119 local_env.PrependUnique(LIBS = speckleylibs)
74 sshaw 5123
75 caltinay 6119 env['speckley_libs'] = [module_name] + speckleylibs
76 sshaw 5123
77 caltinay 6119 include_path = Dir(module_name, local_env['incinstall'])
78 sshaw 5123 hdr_inst = local_env.Install(include_path, headers)
79    
80 caltinay 6119 lib = local_env.SharedLibrary(module_name, sources)
81 sshaw 5123 lib_inst = local_env.Install(local_env['libinstall'], lib)
82    
83     ### Python wrapper ###
84 caltinay 6119 py_env = local_env.Clone()
85     py_env.Prepend(LIBS = [module_name])
86     py_lib_name = module_name + 'cpp'
87 caltinay 6124 py_lib = py_env.PythonModule(py_lib_name, 'speckleycpp.cpp')
88 sshaw 5123
89 caltinay 6119 mod_path = Dir(module_name, local_env['pyinstall'])
90     mod_inst = py_env.Install(mod_path, py_lib)
91 sshaw 5123
92 caltinay 6119 build = env.Alias('build_speckley', [hdr_inst, lib, py_lib])
93     env.Alias('install_speckley', [build, lib_inst, mod_inst])
94 sshaw 5123

  ViewVC Help
Powered by ViewVC 1.1.26