/[escript]/branches/trilinos_from_5897/escriptcore/src/SConscript
ViewVC logotype

Contents of /branches/trilinos_from_5897/escriptcore/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5963 - (show annotations)
Mon Feb 22 06:59:27 2016 UTC (3 years, 3 months ago) by caltinay
File size: 4641 byte(s)
sync and fix.

1 ##############################################################################
2 #
3 # Copyright (c) 2003-2016 by The 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 AbstractReducer.cpp
31 AbstractSystemMatrix.cpp
32 AbstractTransportProblem.cpp
33 Data.cpp
34 DataAbstract.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 DataVectorAlt.cpp
48 DataVectorTaipan.cpp
49 DomainException.cpp
50 EscriptParams.cpp
51 ExceptionTranslators.cpp
52 FunctionSpace.cpp
53 FunctionSpaceException.cpp
54 FunctionSpaceFactory.cpp
55 LapackInverseHelper.cpp
56 LocalOps.cpp
57 NonReducedVariable.cpp
58 NullDomain.cpp
59 MPIDataReducer.cpp
60 MPIScalarReducer.cpp
61 Random.cpp
62 SplitWorld.cpp
63 SplitWorldException.cpp
64 SubWorld.cpp
65 SystemMatrixException.cpp
66 Taipan.cpp
67 TestDomain.cpp
68 TransportProblemException.cpp
69 Utils.cpp
70 WrappedArray.cpp
71 SolverOptions.cpp
72 SolverOptionsException.cpp
73 """.split()
74
75 headers = """
76 AbstractContinuousDomain.h
77 AbstractDomain.h
78 AbstractReducer.h
79 AbstractSystemMatrix.h
80 AbstractTransportProblem.h
81 BinaryOp.h
82 Data.h
83 DataAbstract.h
84 DataAlgorithm.h
85 DataC.h
86 DataConstant.h
87 DataEmpty.h
88 DataException.h
89 DataExpanded.h
90 DataFactory.h
91 DataLazy.h
92 DataMaths.h
93 DataReady.h
94 DataTagged.h
95 DataTypes.h
96 DataVector.h
97 DataVectorAlt.h
98 DataVectorTaipan.h
99 Dodgy.h
100 DomainException.h
101 EscriptParams.h
102 ExceptionTranslators.h
103 FunctionSpace.h
104 FunctionSpaceException.h
105 FunctionSpaceFactory.h
106 LapackInverseHelper.h
107 LocalOps.h
108 NonReducedVariable.h
109 NullDomain.h
110 MPIDataReducer.h
111 MPIScalarReducer.h
112 Pointers.h
113 Random.h
114 SplitWorld.h
115 SplitWorldException.h
116 SubWorld.h
117 SystemMatrixException.h
118 Taipan.h
119 TestDomain.h
120 TransportProblemException.h
121 UnaryFuncs.h
122 UnaryOp.h
123 UtilC.h
124 Utils.h
125 WrappedArray.h
126 system_dep.h
127 SolverOptions.h
128 SolverOptionsException.h
129 """.split()
130
131 dodgy_sources = """
132 Dodgy.cpp
133 """.split()
134
135 local_env.Prepend(LIBS = ['esysUtils'])
136 local_dodgy.Prepend(LIBS = ['esysUtils'])
137 if IS_WINDOWS:
138 local_env.Append(CPPDEFINES = ['ESCRIPT_EXPORTS'])
139 local_dodgy.Append(CPPDEFINES = ['ESCRIPT_EXPORTS'])
140
141 module_name = 'escript'
142
143 # specify to build shared object
144 if local_env['iknowwhatimdoing']:
145 nonped=[local_dodgy.SharedObject(x) for x in dodgy_sources]
146 else:
147 nonped=[]
148
149 lib = local_env.SharedLibrary(module_name, sources+nonped)
150 env.Alias('build_escript_lib', lib)
151
152 include_path = Dir('escript', local_env['incinstall'])
153 hdr_inst = local_env.Install(include_path, headers)
154 env.Alias('install_escript_headers', hdr_inst)
155
156 lib_inst = local_env.Install(local_env['libinstall'], lib)
157 env.Alias('install_escript_lib', lib_inst)
158
159 ### Python wrapper ###
160 py_wrapper_local_env.Prepend(LIBS = ['escript', 'esysUtils'])
161 py_wrapper_name = module_name + 'cpp'
162 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'escriptcpp.cpp')
163 env.Alias('build_escriptcpp_lib', py_wrapper_lib)
164
165 tmp_inst = os.path.join(local_env['pyinstall'], 'escriptcore')
166 if IS_WINDOWS:
167 wrapper_ext = '.pyd'
168 else:
169 wrapper_ext = '.so'
170
171 share_name = os.path.join(tmp_inst, py_wrapper_name+wrapper_ext)
172 mod_inst = py_wrapper_local_env.InstallAs(target=share_name,
173 source=py_wrapper_lib[0])
174 env.Alias('install_escriptcpp_lib', mod_inst)
175
176 # configure python module
177 local_env.SConscript(dirs = ['#/escriptcore/py_src'], variant_dir='py', duplicate=0)
178
179 # configure unit tests
180 local_env.SConscript(dirs = ['#/escriptcore/test'], variant_dir='test', duplicate=0, exports=['py_wrapper_lib'])
181

  ViewVC Help
Powered by ViewVC 1.1.26