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

Annotation of /trunk/escript/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2881 - (hide annotations)
Thu Jan 28 02:03:15 2010 UTC (9 years, 6 months ago) by jfenwick
File size: 4121 byte(s)
Don't panic.
Updating copyright stamps

1 ksteube 1811 ########################################################
2 ksteube 1705 #
3 jfenwick 2881 # Copyright (c) 2003-2010 by University of Queensland
4 ksteube 1811 # Earth Systems Science Computational Center (ESSCC)
5     # http://www.uq.edu.au/esscc
6 ksteube 1705 #
7 ksteube 1811 # 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 ksteube 1705 #
11 ksteube 1811 ########################################################
12 ksteube 1705
13 ksteube 1811
14 gross 700 import os
15 jgs 181 Import('*')
16    
17 ksteube 1705 local_env = clone_env(env_mpi)
18 jfenwick 2827 local_dodgy = clone_env(dodgy_env)
19 ksteube 1705 py_wrapper_local_env = clone_env(env_mpi)
20    
21 robwdcock 682 # Remove the sharedlibrary prefix on all platform - we don't want 'lib' mucking with our python modules
22     del py_wrapper_local_env['SHLIBPREFIX']
23 jgs 181
24 ksteube 1705 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 jfenwick 2005 DataLazy.cpp
39 jfenwick 1796 DataMaths.cpp
40 jfenwick 2005 DataReady.cpp
41 ksteube 1705 DataTagged.cpp
42 jfenwick 1796 DataTypes.cpp
43 ksteube 1705 DataVector.cpp
44     DomainException.cpp
45 jfenwick 1897 EscriptParams.cpp
46 ksteube 1705 FunctionSpace.cpp
47     FunctionSpaceException.cpp
48     FunctionSpaceFactory.cpp
49 jfenwick 2742 LapackInverseHelper.cpp
50 ksteube 1705 NullDomain.cpp
51     SystemMatrixException.cpp
52     Taipan.cpp
53 jfenwick 2482 TestDomain.cpp
54 ksteube 1705 TransportProblemException.cpp
55     Utils.cpp
56 jfenwick 2271 WrappedArray.cpp
57 ksteube 1705 """.split()
58 phornby 2078 # blocktimer.c
59 ksteube 1705 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 jfenwick 2005 DataLazy.h
76 jfenwick 1796 DataMaths.h
77 jfenwick 2005 DataReady.h
78 ksteube 1705 DataTagged.h
79 jfenwick 1796 DataTypes.h
80 ksteube 1705 DataVector.h
81 jfenwick 2827 Dodgy.h
82 ksteube 1705 DomainException.h
83 jfenwick 1897 EscriptParams.h
84 ksteube 1705 FunctionSpace.h
85     FunctionSpaceException.h
86     FunctionSpaceFactory.h
87 jfenwick 2742 LapackInverseHelper.h
88 ksteube 1705 LocalOps.h
89     NullDomain.h
90 jfenwick 1872 Pointers.h
91 ksteube 1705 SystemMatrixException.h
92     Taipan.h
93 jfenwick 2482 TestDomain.h
94 ksteube 1705 TransportProblemException.h
95     UnaryFuncs.h
96     UnaryOp.h
97     UtilC.h
98     Utils.h
99 jfenwick 2271 WrappedArray.h
100 ksteube 1705 esysmpi.h
101     system_dep.h
102     """.split()
103 phornby 2078 # blocktimer.h
104 jgs 277
105 jfenwick 2827 dodgy_sources = """
106     Dodgy.cpp
107     """.split()
108    
109 ksteube 1705 local_env.Append(LIBS = [ 'esysUtils'] + env['sys_libs'] )
110 jfenwick 2827 local_dodgy.Append(LIBS = [ 'esysUtils'] + env['sys_libs'] )
111 phornby 2027
112     if IS_WINDOWS_PLATFORM :
113 phornby 2041 local_env.Append(CPPDEFINES = ['ESCRIPT_EXPORTS'])
114 jfenwick 2827 local_dodgy.Append(CPPDEFINES = ['ESCRIPT_EXPORTS'])
115 phornby 2027
116 ksteube 1705 py_wrapper_local_env.Append(LIBS = [ 'escript', 'esysUtils'] + env['sys_libs'])
117 jgs 181
118 phornby 1847 module_name = 'escript'
119     py_wrapper_name = module_name + 'cpp'
120 phornby 1840
121 jfenwick 2827 #Specify to build shared object
122     if local_env['iknowwhatimdoing']:
123     nonped=[local_dodgy.SharedObject(x) for x in dodgy_sources]
124     else:
125     nonped=[]
126    
127     lib = local_env.SharedLibrary(module_name, sources+nonped)
128 ksteube 1705 env.Alias('target_escript_so', lib)
129 gross 700
130 phornby 1847 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'escriptcpp.cpp')
131 ksteube 1705 env.Alias('target_escriptcpp_so', py_wrapper_lib)
132 jgs 277
133 ksteube 1705 include_path = Dir('escript', local_env['incinstall'])
134 jgs 190
135 ksteube 1705 tmp1 = local_env.Install(include_path, headers )
136     env.Alias('target_install_escript_headers', [tmp1])
137 ksteube 1312
138 ksteube 1705 tmp3 = local_env.Install(local_env['libinstall'], lib)
139     env.Alias('target_install_escript_so', tmp3)
140 woo409 757
141 trankine 1428 #windows specific mod
142 phornby 1847 tmp_inst = os.path.join(local_env['pyinstall'],module_name)
143 trankine 1428 if os.name == 'nt':
144 phornby 1840 wrapper_postfix = '.pyd'
145 ksteube 1705 else:
146 phornby 1840 wrapper_postfix = '.so'
147    
148 phornby 1847 share_name = os.path.join(tmp_inst,py_wrapper_name+wrapper_postfix)
149 phornby 1840
150 phornby 1847 tmp4 = py_wrapper_local_env.InstallAs(target=share_name,
151     source=py_wrapper_lib[0])
152 phornby 1840
153 ksteube 1705 env.Alias('target_install_escriptcpp_so', tmp4)
154 trankine 1428
155 robwdcock 682 # export the lib target since tests will depend on it
156     # the lib target is a list of file nodes (why? win32 produces more than one output file: .lib, .dll, .pdb)
157     # FIXME: This list handling produces the desired result but can this be done directly with scons File nodes?
158 ksteube 1705 dep_lib = [local_env['libinstall']+'/'+str(x) for x in lib]
159 robwdcock 682 Export('dep_lib')
160 jgs 277
161 robwdcock 682 # Call the python sconscript
162     env.SConscript(dirs = ['#/escript/py_src'], build_dir='py', duplicate=0)
163 jgs 277
164 robwdcock 682 # Call the unit tests SConscript
165     local_env.SConscript(dirs = ['#/escript/test'], build_dir='#/build/$PLATFORM/escript/test', duplicate=0)
166 ksteube 1705

  ViewVC Help
Powered by ViewVC 1.1.26