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

Contents of /trunk/escriptcore/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6145 - (show annotations)
Wed Apr 6 06:28:57 2016 UTC (2 years, 6 months ago) by caltinay
File size: 3851 byte(s)
now refraining from adding all libraries to all targets. So we don't link
unnecessary libraries, e.g. escript does not need parmetis etc...

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 Apache License, version 2.0
8 # http://www.apache.org/licenses/LICENSE-2.0
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('*')
17
18 module_name = 'escript'
19
20 sources = """
21 AbstractContinuousDomain.cpp
22 AbstractDomain.cpp
23 AbstractReducer.cpp
24 AbstractSystemMatrix.cpp
25 AbstractTransportProblem.cpp
26 ArrayOps.cpp
27 BinaryDataReadyOps.cpp
28 Data.cpp
29 DataAbstract.cpp
30 DataConstant.cpp
31 DataEmpty.cpp
32 DataExpanded.cpp
33 DataFactory.cpp
34 DataLazy.cpp
35 DataReady.cpp
36 DataTagged.cpp
37 DataTypes.cpp
38 DataVector.cpp
39 DataVectorAlt.cpp
40 DataVectorOps.cpp
41 DataVectorTaipan.cpp
42 EscriptParams.cpp
43 EsysMPI.cpp
44 ExceptionTranslators.cpp
45 FunctionSpace.cpp
46 FunctionSpaceFactory.cpp
47 LapackInverseHelper.cpp
48 MPIDataReducer.cpp
49 MPIScalarReducer.cpp
50 NonReducedVariable.cpp
51 NullDomain.cpp
52 pyerr.cpp
53 Random.cpp
54 SolverOptions.cpp
55 SplitWorld.cpp
56 SubWorld.cpp
57 Taipan.cpp
58 TestDomain.cpp
59 Utils.cpp
60 WrappedArray.cpp
61 """.split()
62
63 headers = """
64 AbstractContinuousDomain.h
65 AbstractDomain.h
66 AbstractReducer.h
67 AbstractSystemMatrix.h
68 AbstractTransportProblem.h
69 ArrayOps.h
70 Assert.h
71 BinaryDataReadyOps.h
72 Data.h
73 DataAbstract.h
74 DataConstant.h
75 DataEmpty.h
76 DataException.h
77 DataExpanded.h
78 DataFactory.h
79 DataLazy.h
80 DataReady.h
81 DataTagged.h
82 DataTypes.h
83 DataVector.h
84 DataVectorAlt.h
85 DataVectorOps.h
86 DataVectorTaipan.h
87 Dodgy.h
88 DomainException.h
89 EscriptParams.h
90 EsysException.h
91 EsysMPI.h
92 ExceptionTranslators.h
93 FileWriter.h
94 FunctionSpace.h
95 FunctionSpaceException.h
96 FunctionSpaceFactory.h
97 IndexList.h
98 LapackInverseHelper.h
99 NonReducedVariable.h
100 NullDomain.h
101 MPIDataReducer.h
102 MPIScalarReducer.h
103 Pointers.h
104 Random.h
105 SolverOptions.h
106 SplitWorld.h
107 SplitWorldException.h
108 SubWorld.h
109 SystemMatrixException.h
110 Taipan.h
111 TestDomain.h
112 TransportProblemException.h
113 Utils.h
114 WrappedArray.h
115 index.h
116 pyerr.h
117 system_dep.h
118 """.split()
119
120 dodgy_sources = """
121 Dodgy.cpp
122 """.split()
123
124 local_env = env.Clone()
125
126 # collect dependencies for other modules
127 escriptlibs = []
128
129 if env['uselapack']:
130 escriptlibs += env['lapack_libs']
131 if env['mkl']:
132 escriptlibs += env['mkl_libs']
133 if env['netcdf']:
134 escriptlibs += env['netcdf_libs']
135
136 local_env.PrependUnique(LIBS = escriptlibs)
137 env['escript_libs'] = [module_name] + escriptlibs
138
139 if IS_WINDOWS:
140 local_env.Append(CPPDEFINES = ['ESCRIPT_EXPORTS'])
141
142 # specify to build shared object
143 if local_env['iknowwhatimdoing']:
144 nonped = [local_env.SharedObject(x) for x in dodgy_sources]
145 else:
146 nonped = []
147
148 include_path = Dir(module_name, local_env['incinstall'])
149 hdr_inst = local_env.Install(include_path, headers)
150
151 lib = local_env.SharedLibrary(module_name, sources+nonped)
152 lib_inst = local_env.Install(local_env['libinstall'], lib)
153
154 ### Python wrapper ###
155 py_env = env.Clone()
156 py_env.Prepend(LIBS = [module_name])
157 py_lib_name = module_name + 'cpp'
158 py_lib = py_env.PythonModule(py_lib_name, 'escriptcpp.cpp')
159
160 mod_path = Dir('escriptcore', local_env['pyinstall'])
161 mod_inst = py_env.Install(mod_path, py_lib)
162
163 build = env.Alias('build_escript', [hdr_inst, lib, py_lib])
164 env.Alias('install_escript', [build, lib_inst, mod_inst])
165

  ViewVC Help
Powered by ViewVC 1.1.26