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

Annotation of /trunk/escript/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3259 - (hide annotations)
Mon Oct 11 01:48:14 2010 UTC (9 years ago) by jfenwick
File size: 3927 byte(s)
Merging dudley and scons updates from branches

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 gross 700 import os
14 jgs 181 Import('*')
15    
16 jfenwick 3259 local_env = env.Clone()
17     local_dodgy = dodgy_env.Clone()
18     py_wrapper_local_env = env.Clone()
19 ksteube 1705
20 jfenwick 3259 # Remove the sharedlibrary prefix on all platform - we don't want 'lib'
21     # mucking with our python modules
22 robwdcock 682 del py_wrapper_local_env['SHLIBPREFIX']
23 jgs 181
24 ksteube 1705 sources = """
25 jfenwick 3259 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 ksteube 1705 """.split()
58 jfenwick 3259 # blocktimer.c
59 ksteube 1705 headers = """
60 jfenwick 3259 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 ksteube 1705 """.split()
102 jfenwick 3259 # blocktimer.h
103 jgs 277
104 jfenwick 2827 dodgy_sources = """
105 jfenwick 3259 Dodgy.cpp
106 jfenwick 2827 """.split()
107    
108 jfenwick 3259 local_env.Append(LIBS = ['esysUtils'])
109     local_dodgy.Append(LIBS = ['esysUtils'])
110     if IS_WINDOWS:
111     local_env.Append(CPPDEFINES = ['ESCRIPT_EXPORTS'])
112     local_dodgy.Append(CPPDEFINES = ['ESCRIPT_EXPORTS'])
113 phornby 2027
114 phornby 1847 module_name = 'escript'
115 phornby 1840
116 jfenwick 3259 # specify to build shared object
117 jfenwick 2827 if local_env['iknowwhatimdoing']:
118 jfenwick 3259 nonped=[local_dodgy.SharedObject(x) for x in dodgy_sources]
119 jfenwick 2827 else:
120 jfenwick 3259 nonped=[]
121 jfenwick 2827
122     lib = local_env.SharedLibrary(module_name, sources+nonped)
123 jfenwick 3259 env.Alias('build_escript_lib', lib)
124 gross 700
125 ksteube 1705 include_path = Dir('escript', local_env['incinstall'])
126 jfenwick 3259 hdr_inst = local_env.Install(include_path, headers)
127     env.Alias('install_escript_headers', hdr_inst)
128 jgs 190
129 jfenwick 3259 lib_inst = local_env.Install(local_env['libinstall'], lib)
130     env.Alias('install_escript_lib', lib_inst)
131 ksteube 1312
132 jfenwick 3259 ### Python wrapper ###
133     py_wrapper_local_env.Append(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 woo409 757
138 jfenwick 3259 tmp_inst = os.path.join(local_env['pyinstall'], module_name)
139     if IS_WINDOWS:
140     wrapper_ext = '.pyd'
141 ksteube 1705 else:
142 jfenwick 3259 wrapper_ext = '.so'
143 phornby 1840
144 jfenwick 3259 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 phornby 1840
149 jfenwick 3259 # configure python module
150     local_env.SConscript(dirs = ['#/escript/py_src'], variant_dir='py', duplicate=0)
151 phornby 1840
152 jfenwick 3259 # configure unit tests
153     local_env.SConscript(dirs = ['#/escript/test'], variant_dir='#/build/$PLATFORM/escript/test', duplicate=0, exports=['py_wrapper_lib'])
154 trankine 1428

  ViewVC Help
Powered by ViewVC 1.1.26