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

Contents of /trunk/escript/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3982 - (show annotations)
Fri Sep 21 03:23:22 2012 UTC (6 years, 11 months ago) by jfenwick
File size: 4052 byte(s)
More edits + removing pyvisi from trunk

1 ##############################################################################
2 #
3 # Copyright (c) 2003-2012 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 since 2012 by School of Earth Sciences
12 #
13 ##############################################################################
14
15 import os
16 Import('*')
17
18 local_env = env.Clone()
19 local_dodgy = dodgy_env.Clone()
20 py_wrapper_local_env = env.Clone()
21
22 # Remove the sharedlibrary prefix on all platform - we don't want 'lib'
23 # mucking with our python modules
24 del py_wrapper_local_env['SHLIBPREFIX']
25
26 sources = """
27 AbstractContinuousDomain.cpp
28 AbstractDomain.cpp
29 AbstractSystemMatrix.cpp
30 AbstractTransportProblem.cpp
31 Data.cpp
32 DataAbstract.cpp
33 DataBlocks2D.cpp
34 DataC.cpp
35 DataConstant.cpp
36 DataEmpty.cpp
37 DataException.cpp
38 DataExpanded.cpp
39 DataFactory.cpp
40 DataLazy.cpp
41 DataMaths.cpp
42 DataReady.cpp
43 DataTagged.cpp
44 DataTypes.cpp
45 DataVector.cpp
46 DomainException.cpp
47 EscriptParams.cpp
48 FunctionSpace.cpp
49 FunctionSpaceException.cpp
50 FunctionSpaceFactory.cpp
51 LapackInverseHelper.cpp
52 NullDomain.cpp
53 SystemMatrixException.cpp
54 Taipan.cpp
55 TestDomain.cpp
56 TransportProblemException.cpp
57 Utils.cpp
58 WrappedArray.cpp
59 """.split()
60 # blocktimer.c
61 headers = """
62 AbstractContinuousDomain.h
63 AbstractDomain.h
64 AbstractSystemMatrix.h
65 AbstractTransportProblem.h
66 BinaryOp.h
67 Data.h
68 DataAbstract.h
69 DataAlgorithm.h
70 DataBlocks2D.h
71 DataC.h
72 DataConstant.h
73 DataEmpty.h
74 DataException.h
75 DataExpanded.h
76 DataFactory.h
77 DataLazy.h
78 DataMaths.h
79 DataReady.h
80 DataTagged.h
81 DataTypes.h
82 DataVector.h
83 Dodgy.h
84 DomainException.h
85 EscriptParams.h
86 FunctionSpace.h
87 FunctionSpaceException.h
88 FunctionSpaceFactory.h
89 LapackInverseHelper.h
90 LocalOps.h
91 NullDomain.h
92 Pointers.h
93 SystemMatrixException.h
94 Taipan.h
95 TestDomain.h
96 TransportProblemException.h
97 UnaryFuncs.h
98 UnaryOp.h
99 UtilC.h
100 Utils.h
101 WrappedArray.h
102 system_dep.h
103 """.split()
104 # blocktimer.h
105
106 dodgy_sources = """
107 Dodgy.cpp
108 """.split()
109
110 local_env.Prepend(LIBS = ['esysUtils'])
111 local_dodgy.Prepend(LIBS = ['esysUtils'])
112 if IS_WINDOWS:
113 local_env.Append(CPPDEFINES = ['ESCRIPT_EXPORTS'])
114 local_dodgy.Append(CPPDEFINES = ['ESCRIPT_EXPORTS'])
115
116 module_name = 'escript'
117
118 # specify to build shared object
119 if local_env['iknowwhatimdoing']:
120 nonped=[local_dodgy.SharedObject(x) for x in dodgy_sources]
121 else:
122 nonped=[]
123
124 lib = local_env.SharedLibrary(module_name, sources+nonped)
125 env.Alias('build_escript_lib', lib)
126
127 include_path = Dir('escript', local_env['incinstall'])
128 hdr_inst = local_env.Install(include_path, headers)
129 env.Alias('install_escript_headers', hdr_inst)
130
131 lib_inst = local_env.Install(local_env['libinstall'], lib)
132 env.Alias('install_escript_lib', lib_inst)
133
134 ### Python wrapper ###
135 py_wrapper_local_env.Prepend(LIBS = ['escript', 'esysUtils'])
136 py_wrapper_name = module_name + 'cpp'
137 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'escriptcpp.cpp')
138 env.Alias('build_escriptcpp_lib', py_wrapper_lib)
139
140 tmp_inst = os.path.join(local_env['pyinstall'], module_name)
141 if IS_WINDOWS:
142 wrapper_ext = '.pyd'
143 else:
144 wrapper_ext = '.so'
145
146 share_name = os.path.join(tmp_inst, py_wrapper_name+wrapper_ext)
147 mod_inst = py_wrapper_local_env.InstallAs(target=share_name,
148 source=py_wrapper_lib[0])
149 env.Alias('install_escriptcpp_lib', mod_inst)
150
151 # configure python module
152 local_env.SConscript(dirs = ['#/escript/py_src'], variant_dir='py', duplicate=0)
153
154 # configure unit tests
155 local_env.SConscript(dirs = ['#/escript/test'], variant_dir='$BUILD_DIR/$PLATFORM/escript/test', duplicate=0, exports=['py_wrapper_lib'])
156

  ViewVC Help
Powered by ViewVC 1.1.26