/[escript]/branches/scons-dev/escript/src/SConscript
ViewVC logotype

Contents of /branches/scons-dev/escript/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1658 - (show annotations)
Thu Jul 17 04:10:35 2008 UTC (14 years, 2 months ago) by ksteube
File size: 3976 byte(s)
Improved handling of scons 0.98 versus 0.96

1 #
2 # $Id$
3 #
4 #######################################################
5 #
6 # Copyright 2003-2007 by ACceSS MNRF
7 # Copyright 2007 by University of Queensland
8 #
9 # http://esscc.uq.edu.au
10 # Primary Business: Queensland, Australia
11 # Licensed under the Open Software License version 3.0
12 # http://www.opensource.org/licenses/osl-3.0.php
13 #
14 #######################################################
15 #
16
17 import os
18 Import('*')
19
20 if 'Clone' in dir(env): local_env = env_mpi.Clone() # scons-0.98
21 else: local_env = env_mpi.Copy() # scons-0.96
22
23 if 'Clone' in dir(env): py_wrapper_local_env = env_mpi.Clone() # scons-0.98
24 else: py_wrapper_local_env = env_mpi.Copy() # scons-0.96
25
26 # Remove the sharedlibrary prefix on all platform - we don't want 'lib' mucking with our python modules
27 del py_wrapper_local_env['SHLIBPREFIX']
28
29 sources = """
30 AbstractContinuousDomain.cpp
31 AbstractDomain.cpp
32 AbstractSystemMatrix.cpp
33 AbstractTransportProblem.cpp
34 Data.cpp
35 DataAbstract.cpp
36 DataArrayView.cpp
37 DataBlocks2D.cpp
38 DataC.cpp
39 DataConstant.cpp
40 DataEmpty.cpp
41 DataException.cpp
42 DataExpanded.cpp
43 DataFactory.cpp
44 DataTagged.cpp
45 DataVector.cpp
46 DomainException.cpp
47 FunctionSpace.cpp
48 FunctionSpaceException.cpp
49 FunctionSpaceFactory.cpp
50 NullDomain.cpp
51 SystemMatrixException.cpp
52 Taipan.cpp
53 TransportProblemException.cpp
54 Utils.cpp
55 blocktimer.c
56 """.split()
57 headers = """
58 AbstractContinuousDomain.h
59 AbstractDomain.h
60 AbstractSystemMatrix.h
61 AbstractTransportProblem.h
62 BinaryOp.h
63 Data.h
64 DataAbstract.h
65 DataAlgorithm.h
66 DataArrayView.h
67 DataBlocks2D.h
68 DataC.h
69 DataConstant.h
70 DataEmpty.h
71 DataException.h
72 DataExpanded.h
73 DataFactory.h
74 DataTagged.h
75 DataVector.h
76 DomainException.h
77 FunctionSpace.h
78 FunctionSpaceException.h
79 FunctionSpaceFactory.h
80 LocalOps.h
81 NullDomain.h
82 SystemMatrixException.h
83 Taipan.h
84 TransportProblemException.h
85 UnaryFuncs.h
86 UnaryOp.h
87 UtilC.h
88 Utils.h
89 blocktimer.h
90 esysmpi.h
91 system_dep.h
92 """.split()
93
94 local_env.Append(LIBS = [ 'esysUtils'] + env['sys_libs'] )
95 py_wrapper_local_env.Append(LIBS = [ 'escript', 'esysUtils'] + env['sys_libs'])
96
97 if local_env['papi_instrument_solver']:
98 local_env.Append(CPPDEFINES=['PAPI',])
99 if local_env['papi_libs']:
100 local_env.Append(LIBS = local_env['papi_libs'])
101 local_env.Append(CPPDEFINES=['BLOCKPAPI',])
102
103 local_env.Append(CPPDEFINES = [ 'ESCRIPT_EXPORTS'] )
104
105 lib = local_env.SharedLibrary('escript', sources)
106 env.Alias('target_escript_so', lib)
107
108 py_wrapper_lib = py_wrapper_local_env.SharedLibrary('escriptcpp', 'escriptcpp.cpp')
109 env.Alias('target_escriptcpp_so', py_wrapper_lib)
110
111 include_path = Dir('escript', local_env['incinstall'])
112
113 tmp1 = local_env.Install(include_path, headers )
114 env.Alias('target_install_escript_headers', [tmp1])
115
116 tmp3 = local_env.Install(local_env['libinstall'], lib)
117 env.Alias('target_install_escript_so', tmp3)
118
119 tmp4 = py_wrapper_local_env.Install(local_env['pyinstall']+'/escript', py_wrapper_lib)
120 env.Alias('target_install_escriptcpp_so', tmp4)
121
122 #windows specific mod
123 if os.name == 'nt':
124 py_wrapper_local_env.InstallAs(target = [ local_env['pyinstall']+'/escript/escriptcpp.pyd', \
125 local_env['pyinstall']+'/escript/escriptcpp.lib', \
126 local_env['pyinstall']+'/escript/escriptcpp.exp' ], \
127 source = py_wrapper_lib)
128
129 # export the lib target since tests will depend on it
130 # the lib target is a list of file nodes (why? win32 produces more than one output file: .lib, .dll, .pdb)
131 # FIXME: This list handling produces the desired result but can this be done directly with scons File nodes?
132 dep_lib = [local_env['libinstall']+'/'+str(x) for x in lib]
133 Export('dep_lib')
134
135 # Call the python sconscript
136 env.SConscript(dirs = ['#/escript/py_src'], build_dir='py', duplicate=0)
137
138 # Call the unit tests SConscript
139 local_env.SConscript(dirs = ['#/escript/test'], build_dir='#/build/$PLATFORM/escript/test', duplicate=0)
140

  ViewVC Help
Powered by ViewVC 1.1.26