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

Contents of /trunk/escriptcore/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4821 - (show annotations)
Tue Apr 1 04:58:33 2014 UTC (5 years, 4 months ago) by sshaw
File size: 4203 byte(s)
moved SolverOptions to c++, split into SolverOptions for the options and SolverBuddy as the state as a precursor to per-pde solving... does break some use cases (e.g. pde.getSolverOptions().DIRECT will now fail, new value access is with SolverOptions.DIRECT), examples and documentation updated to match
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 AbstractContinuousDomain.cpp
29 AbstractDomain.cpp
30 AbstractSystemMatrix.cpp
31 AbstractTransportProblem.cpp
32 Data.cpp
33 DataAbstract.cpp
34 DataBlocks2D.cpp
35 DataC.cpp
36 DataConstant.cpp
37 DataEmpty.cpp
38 DataException.cpp
39 DataExpanded.cpp
40 DataFactory.cpp
41 DataLazy.cpp
42 DataMaths.cpp
43 DataReady.cpp
44 DataTagged.cpp
45 DataTypes.cpp
46 DataVector.cpp
47 DomainException.cpp
48 EscriptParams.cpp
49 FunctionSpace.cpp
50 FunctionSpaceException.cpp
51 FunctionSpaceFactory.cpp
52 LapackInverseHelper.cpp
53 NullDomain.cpp
54 SystemMatrixException.cpp
55 Taipan.cpp
56 TestDomain.cpp
57 TransportProblemException.cpp
58 Utils.cpp
59 WrappedArray.cpp
60 SolverOptions.cpp
61 SolverOptionsException.cpp
62 """.split()
63 # blocktimer.c
64 headers = """
65 AbstractContinuousDomain.h
66 AbstractDomain.h
67 AbstractSystemMatrix.h
68 AbstractTransportProblem.h
69 BinaryOp.h
70 Data.h
71 DataAbstract.h
72 DataAlgorithm.h
73 DataBlocks2D.h
74 DataC.h
75 DataConstant.h
76 DataEmpty.h
77 DataException.h
78 DataExpanded.h
79 DataFactory.h
80 DataLazy.h
81 DataMaths.h
82 DataReady.h
83 DataTagged.h
84 DataTypes.h
85 DataVector.h
86 Dodgy.h
87 DomainException.h
88 EscriptParams.h
89 FunctionSpace.h
90 FunctionSpaceException.h
91 FunctionSpaceFactory.h
92 LapackInverseHelper.h
93 LocalOps.h
94 NullDomain.h
95 Pointers.h
96 SystemMatrixException.h
97 Taipan.h
98 TestDomain.h
99 TransportProblemException.h
100 UnaryFuncs.h
101 UnaryOp.h
102 UtilC.h
103 Utils.h
104 WrappedArray.h
105 system_dep.h
106 SolverOptions.h
107 SolverOptionsException.h
108 """.split()
109 # blocktimer.h
110
111 dodgy_sources = """
112 Dodgy.cpp
113 """.split()
114
115 local_env.Prepend(LIBS = ['esysUtils'])
116 local_dodgy.Prepend(LIBS = ['esysUtils'])
117 if IS_WINDOWS:
118 local_env.Append(CPPDEFINES = ['ESCRIPT_EXPORTS'])
119 local_dodgy.Append(CPPDEFINES = ['ESCRIPT_EXPORTS'])
120
121 module_name = 'escript'
122
123 # specify to build shared object
124 if local_env['iknowwhatimdoing']:
125 nonped=[local_dodgy.SharedObject(x) for x in dodgy_sources]
126 else:
127 nonped=[]
128
129 lib = local_env.SharedLibrary(module_name, sources+nonped)
130 env.Alias('build_escript_lib', lib)
131
132 include_path = Dir('escript', local_env['incinstall'])
133 hdr_inst = local_env.Install(include_path, headers)
134 env.Alias('install_escript_headers', hdr_inst)
135
136 lib_inst = local_env.Install(local_env['libinstall'], lib)
137 env.Alias('install_escript_lib', lib_inst)
138
139 ### Python wrapper ###
140 py_wrapper_local_env.Prepend(LIBS = ['escript', 'esysUtils'])
141 py_wrapper_name = module_name + 'cpp'
142 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'escriptcpp.cpp')
143 env.Alias('build_escriptcpp_lib', py_wrapper_lib)
144
145 tmp_inst = os.path.join(local_env['pyinstall'], 'escriptcore')
146 if IS_WINDOWS:
147 wrapper_ext = '.pyd'
148 else:
149 wrapper_ext = '.so'
150
151 share_name = os.path.join(tmp_inst, py_wrapper_name+wrapper_ext)
152 mod_inst = py_wrapper_local_env.InstallAs(target=share_name,
153 source=py_wrapper_lib[0])
154 env.Alias('install_escriptcpp_lib', mod_inst)
155
156 # configure python module
157 local_env.SConscript(dirs = ['#/escriptcore/py_src'], variant_dir='py', duplicate=0)
158
159 # configure unit tests
160 local_env.SConscript(dirs = ['#/escriptcore/test'], variant_dir='test', duplicate=0, exports=['py_wrapper_lib'])
161

  ViewVC Help
Powered by ViewVC 1.1.26