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

Contents of /branches/split/escriptcore/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.26