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

Contents of /trunk/escript/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.26