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

Contents of /trunk/ripley/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5148 - (show annotations)
Mon Sep 15 01:25:23 2014 UTC (4 years, 11 months ago) by caltinay
File size: 3568 byte(s)
Merging ripley diagonal storage + CUDA support into trunk.
Options file version has been incremented due to new options
'cuda' and 'nvccflags'.

1
2 ##############################################################################
3 #
4 # Copyright (c) 2003-2014 by University of Queensland
5 # http://www.uq.edu.au
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 # 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 os
18 Import('*')
19
20 local_env = env.Clone()
21 py_wrapper_local_env = env.Clone()
22 local_unroll_env = env.Clone()
23
24
25 # Remove the shared library prefix on all platforms - we don't want 'lib'
26 # mucking with our python modules
27 del py_wrapper_local_env['SHLIBPREFIX']
28
29 sources = """
30 blocktools.cpp
31 blocktools2.cpp
32 Brick.cpp
33 DefaultAssembler2D.cpp
34 DefaultAssembler3D.cpp
35 domainhelpers.cpp
36 LameAssembler2D.cpp
37 LameAssembler3D.cpp
38 Rectangle.cpp
39 RipleyDomain.cpp
40 RipleyException.cpp
41 WaveAssembler2D.cpp
42 WaveAssembler3D.cpp
43 """.split()
44
45 headers = """
46 AbstractAssembler.h
47 blocktools.h
48 Brick.h
49 DefaultAssembler2D.h
50 DefaultAssembler3D.h
51 domainhelpers.h
52 LameAssembler2D.h
53 LameAssembler3D.h
54 Rectangle.h
55 Ripley.h
56 RipleyDomain.h
57 RipleyException.h
58 RipleySystemMatrix.h
59 system_dep.h
60 WaveAssembler2D.h
61 WaveAssembler3D.h
62 """.split()
63
64 local_env.Prepend(LIBS = ['pasowrap', 'escript', 'paso', 'esysUtils'])
65 if local_env['silo']:
66 local_env.Append(CPPDEFINES = ['USE_SILO'])
67 local_env.AppendUnique(LIBS = env['silo_libs'])
68
69 if env['openmp']:
70 local_env.Append(CPPDEFINES = ['THRUST_HOST_SYSTEM=THRUST_HOST_SYSTEM_OMP'])
71
72 if local_env['cuda']:
73 sources.append('RipleySystemMatrix.cu')
74 local_env['NVCCFLAGS'] += ' -w'
75 local_env['SHNVCCFLAGS'] += ' -w'
76 local_env.Append(CPPDEFINES = ['USE_CUDA', 'THRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CUDA'])
77 local_env.Append(LIBS = ['cudart'])
78 else:
79 local_env.Append(CPPDEFINES = ['THRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CPP'])
80 sources.append('RipleySystemMatrix.cpp')
81
82 if IS_WINDOWS:
83 local_env.Append(CPPDEFINES = ['RIPLEY_EXPORTS'])
84
85 module_name = 'ripley'
86
87 lib = local_env.SharedLibrary(module_name, sources)
88 env.Alias('build_ripley_lib', lib)
89
90 include_path = Dir('ripley', local_env['incinstall'])
91
92 hdr_inst = local_env.Install(include_path, headers)
93 env.Alias('install_ripley_headers', hdr_inst)
94
95 lib_inst = local_env.Install(local_env['libinstall'], lib)
96 env.Alias('install_ripley_lib', lib_inst)
97
98 ### Python wrapper ###
99 py_wrapper_local_env.Prepend(LIBS = ['ripley', 'pasowrap', 'escript', 'paso', 'esysUtils'])
100 py_wrapper_name = module_name + 'cpp'
101 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'ripleycpp.cpp')
102 env.Alias('build_ripleycpp_lib', py_wrapper_lib)
103
104 tmp_inst = os.path.join(local_env['pyinstall'], module_name)
105 if IS_WINDOWS:
106 wrapper_ext = '.pyd'
107 else:
108 wrapper_ext = '.so'
109
110 share_name = os.path.join(tmp_inst, py_wrapper_name+wrapper_ext)
111 mod_inst = py_wrapper_local_env.InstallAs(target=share_name,
112 source=py_wrapper_lib[0])
113 env.Alias('install_ripleycpp_lib', mod_inst)
114
115 # configure python module
116 local_env.SConscript(dirs = ['#/ripley/py_src'], variant_dir='py', duplicate=0)
117
118 # configure unit tests
119 local_env.SConscript(dirs = ['#/ripley/test'], variant_dir='test', duplicate=0, exports=['py_wrapper_lib'])
120

  ViewVC Help
Powered by ViewVC 1.1.26