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

Annotation of /trunk/escript/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3982 - (hide annotations)
Fri Sep 21 03:23:22 2012 UTC (6 years, 11 months ago) by jfenwick
File size: 4052 byte(s)
More edits + removing pyvisi from trunk

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

  ViewVC Help
Powered by ViewVC 1.1.26