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

Contents of /trunk/ripley/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6124 - (show annotations)
Tue Apr 5 03:23:12 2016 UTC (3 years ago) by caltinay
File size: 2984 byte(s)
Fixing python module build on OS X. Added PythonModule builder so we do this generically now.
1
2 ##############################################################################
3 #
4 # Copyright (c) 2003-2016 by The University of Queensland
5 # http://www.uq.edu.au
6 #
7 # Primary Business: Queensland, Australia
8 # Licensed under the Apache License, version 2.0
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
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 module_name = 'ripley'
20
21 sources = """
22 blocktools.cpp
23 blocktools2.cpp
24 Brick.cpp
25 DefaultAssembler2D.cpp
26 DefaultAssembler3D.cpp
27 domainhelpers.cpp
28 LameAssembler2D.cpp
29 LameAssembler3D.cpp
30 MultiBrick.cpp
31 MultiRectangle.cpp
32 Rectangle.cpp
33 RipleyDomain.cpp
34 WaveAssembler2D.cpp
35 WaveAssembler3D.cpp
36 """.split()
37
38 headers = """
39 AbstractAssembler.h
40 blocktools.h
41 Brick.h
42 DefaultAssembler2D.h
43 DefaultAssembler3D.h
44 domainhelpers.h
45 LameAssembler2D.h
46 LameAssembler3D.h
47 MultiBrick.h
48 MultiRectangle.h
49 Rectangle.h
50 Ripley.h
51 RipleyDomain.h
52 RipleyException.h
53 RipleySystemMatrix.h
54 system_dep.h
55 WaveAssembler2D.h
56 WaveAssembler3D.h
57 """.split()
58
59 local_env = env.Clone()
60
61 if IS_WINDOWS:
62 local_env.Append(CPPDEFINES = ['RIPLEY_EXPORTS'])
63
64 # collect dependencies for other modules
65 ripleylibs = ['escript']
66
67 if env['paso']:
68 ripleylibs.append('paso')
69 if env['trilinos']:
70 ripleylibs += env['trilinoswrap_libs']
71
72 if env['silo']:
73 local_env.Append(CPPDEFINES = ['USE_SILO'])
74 ripleylibs += env['silo_libs']
75 if env['cuda']:
76 sources.append('RipleySystemMatrix.cu')
77 if env['openmp']:
78 local_env.Append(CPPDEFINES = ['THRUST_HOST_SYSTEM=THRUST_HOST_SYSTEM_OMP'])
79 local_env['NVCCFLAGS'] += ' -w'
80 local_env['SHNVCCFLAGS'] += ' -w'
81 local_env.Append(CPPDEFINES = ['USE_CUDA', 'THRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CUDA'])
82 #TODO: This needs a config option:
83 local_env.Append(CPPDEFINES = ['CUSP_USE_TEXTURE_MEMORY'])
84 ripleylibs.append('cudart')
85
86 local_env.PrependUnique(LIBS = ripleylibs)
87
88 env['ripley_libs'] = [module_name] + ripleylibs
89
90 include_path = Dir(module_name, local_env['incinstall'])
91 hdr_inst = local_env.Install(include_path, headers)
92
93 lib = local_env.SharedLibrary(module_name, sources)
94 lib_inst = local_env.Install(local_env['libinstall'], lib)
95
96 ### Python wrapper ###
97 py_env = local_env.Clone()
98 py_env.PrependUnique(LIBS = [module_name])
99 py_lib_name = module_name + 'cpp'
100 py_lib = py_env.PythonModule(py_lib_name, 'ripleycpp.cpp')
101
102 mod_path = Dir(module_name, local_env['pyinstall'])
103 mod_inst = py_env.Install(mod_path, py_lib)
104
105 build = env.Alias('build_ripley', [hdr_inst, lib, py_lib])
106 if env['cuda']:
107 env.Alias('build_ripley', 'install_cusp_headers')
108 env.Alias('install_ripley', ['build_ripley', lib_inst, mod_inst])
109

  ViewVC Help
Powered by ViewVC 1.1.26