/[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 1699 - (show annotations)
Thu Aug 14 02:38:23 2008 UTC (14 years, 7 months ago) by ksteube
File size: 3439 byte(s)
Fixed InstallAs target for Windows (removed escriptcpp.pyd since this
file is not created).
Added new config variable cc_extra to add some C/C++ options without
having to change everything.

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 local_env = clone_env(env_mpi)
21
22 if 'Clone' in dir(env): py_wrapper_local_env = env_mpi.Clone() # scons-0.98
23 else: py_wrapper_local_env = env_mpi.Copy() # scons-0.96
24
25 # Remove the sharedlibrary prefix on all platform - we don't want 'lib' mucking with our python modules
26 del py_wrapper_local_env['SHLIBPREFIX']
27
28 sources = """
29 AbstractContinuousDomain.cpp
30 AbstractDomain.cpp
31 AbstractSystemMatrix.cpp
32 AbstractTransportProblem.cpp
33 Data.cpp
34 DataAbstract.cpp
35 DataArrayView.cpp
36 DataBlocks2D.cpp
37 DataC.cpp
38 DataConstant.cpp
39 DataEmpty.cpp
40 DataException.cpp
41 DataExpanded.cpp
42 DataFactory.cpp
43 DataTagged.cpp
44 DataVector.cpp
45 DomainException.cpp
46 FunctionSpace.cpp
47 FunctionSpaceException.cpp
48 FunctionSpaceFactory.cpp
49 NullDomain.cpp
50 SystemMatrixException.cpp
51 Taipan.cpp
52 TransportProblemException.cpp
53 Utils.cpp
54 blocktimer.c
55 """.split()
56 headers = """
57 AbstractContinuousDomain.h
58 AbstractDomain.h
59 AbstractSystemMatrix.h
60 AbstractTransportProblem.h
61 BinaryOp.h
62 Data.h
63 DataAbstract.h
64 DataAlgorithm.h
65 DataArrayView.h
66 DataBlocks2D.h
67 DataC.h
68 DataConstant.h
69 DataEmpty.h
70 DataException.h
71 DataExpanded.h
72 DataFactory.h
73 DataTagged.h
74 DataVector.h
75 DomainException.h
76 FunctionSpace.h
77 FunctionSpaceException.h
78 FunctionSpaceFactory.h
79 LocalOps.h
80 NullDomain.h
81 SystemMatrixException.h
82 Taipan.h
83 TransportProblemException.h
84 UnaryFuncs.h
85 UnaryOp.h
86 UtilC.h
87 Utils.h
88 blocktimer.h
89 esysmpi.h
90 system_dep.h
91 """.split()
92
93 local_env.Append(LIBS = [ 'esysUtils'] + env['sys_libs'] )
94 py_wrapper_local_env.Append(LIBS = [ 'escript', 'esysUtils'] + env['sys_libs'])
95
96 lib = local_env.SharedLibrary('escript', sources)
97 env.Alias('target_escript_so', lib)
98
99 py_wrapper_lib = py_wrapper_local_env.SharedLibrary('escriptcpp', 'escriptcpp.cpp')
100 env.Alias('target_escriptcpp_so', py_wrapper_lib)
101
102 include_path = Dir('escript', local_env['incinstall'])
103
104 tmp1 = local_env.Install(include_path, headers )
105 env.Alias('target_install_escript_headers', [tmp1])
106
107 tmp3 = local_env.Install(local_env['libinstall'], lib)
108 env.Alias('target_install_escript_so', tmp3)
109
110 #windows specific mod
111 if os.name == 'nt':
112 tmp4 = py_wrapper_local_env.Install(local_env['pyinstall']+'/escript', ['escriptcpp.pyd', 'escriptcpp.lib', 'escriptcpp.exp'])
113 else:
114 tmp4 = py_wrapper_local_env.InstallAs(local_env['pyinstall']+'/escript/escriptcpp.so', py_wrapper_lib)
115 env.Alias('target_install_escriptcpp_so', tmp4)
116
117 # export the lib target since tests will depend on it
118 # the lib target is a list of file nodes (why? win32 produces more than one output file: .lib, .dll, .pdb)
119 # FIXME: This list handling produces the desired result but can this be done directly with scons File nodes?
120 dep_lib = [local_env['libinstall']+'/'+str(x) for x in lib]
121 Export('dep_lib')
122
123 # Call the python sconscript
124 env.SConscript(dirs = ['#/escript/py_src'], build_dir='py', duplicate=0)
125
126 # Call the unit tests SConscript
127 local_env.SConscript(dirs = ['#/escript/test'], build_dir='#/build/$PLATFORM/escript/test', duplicate=0)
128

  ViewVC Help
Powered by ViewVC 1.1.26