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

Annotation of /trunk/escript/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2031 - (hide annotations)
Wed Nov 12 08:02:33 2008 UTC (10 years, 11 months ago) by phornby
File size: 3702 byte(s)
Need finer control than INTERFACE_STATIC_LIB could exert. Now there is a
XXX_STATIC_LIB for each lib.


1 ksteube 1811 ########################################################
2 ksteube 1705 #
3 ksteube 1811 # Copyright (c) 2003-2008 by University of Queensland
4     # 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     py_wrapper_local_env = clone_env(env_mpi)
19    
20 robwdcock 682 # Remove the sharedlibrary prefix on all platform - we don't want 'lib' mucking with our python modules
21     del py_wrapper_local_env['SHLIBPREFIX']
22 jgs 181
23 ksteube 1705 sources = """
24     AbstractContinuousDomain.cpp
25     AbstractDomain.cpp
26     AbstractSystemMatrix.cpp
27     AbstractTransportProblem.cpp
28     Data.cpp
29     DataAbstract.cpp
30     DataBlocks2D.cpp
31     DataC.cpp
32     DataConstant.cpp
33     DataEmpty.cpp
34     DataException.cpp
35     DataExpanded.cpp
36     DataFactory.cpp
37 jfenwick 2005 DataLazy.cpp
38 jfenwick 1796 DataMaths.cpp
39 jfenwick 2005 DataReady.cpp
40 ksteube 1705 DataTagged.cpp
41 jfenwick 1796 DataTypes.cpp
42 ksteube 1705 DataVector.cpp
43     DomainException.cpp
44 jfenwick 1897 EscriptParams.cpp
45 ksteube 1705 FunctionSpace.cpp
46     FunctionSpaceException.cpp
47     FunctionSpaceFactory.cpp
48     NullDomain.cpp
49     SystemMatrixException.cpp
50     Taipan.cpp
51     TransportProblemException.cpp
52     Utils.cpp
53     blocktimer.c
54     """.split()
55     headers = """
56     AbstractContinuousDomain.h
57     AbstractDomain.h
58     AbstractSystemMatrix.h
59     AbstractTransportProblem.h
60     BinaryOp.h
61     Data.h
62     DataAbstract.h
63     DataAlgorithm.h
64     DataBlocks2D.h
65     DataC.h
66     DataConstant.h
67     DataEmpty.h
68     DataException.h
69     DataExpanded.h
70     DataFactory.h
71 jfenwick 2005 DataLazy.h
72 jfenwick 1796 DataMaths.h
73 jfenwick 2005 DataReady.h
74 ksteube 1705 DataTagged.h
75 jfenwick 1796 DataTypes.h
76 ksteube 1705 DataVector.h
77     DomainException.h
78 jfenwick 1897 EscriptParams.h
79 ksteube 1705 FunctionSpace.h
80     FunctionSpaceException.h
81     FunctionSpaceFactory.h
82     LocalOps.h
83     NullDomain.h
84 jfenwick 1872 Pointers.h
85 ksteube 1705 SystemMatrixException.h
86     Taipan.h
87     TransportProblemException.h
88     UnaryFuncs.h
89     UnaryOp.h
90     UtilC.h
91     Utils.h
92     blocktimer.h
93     esysmpi.h
94     system_dep.h
95     """.split()
96 jgs 277
97 ksteube 1705 local_env.Append(LIBS = [ 'esysUtils'] + env['sys_libs'] )
98 phornby 2027
99     if IS_WINDOWS_PLATFORM :
100 phornby 2031 local_env.Append(CPPDEFINES = ['ESCRIPT_EXPORTS',
101     'ESYSUTILS_STATIC_LIB'])
102 phornby 2027
103 ksteube 1705 py_wrapper_local_env.Append(LIBS = [ 'escript', 'esysUtils'] + env['sys_libs'])
104 jgs 181
105 phornby 1847 module_name = 'escript'
106     py_wrapper_name = module_name + 'cpp'
107 phornby 1840
108 phornby 1847 lib = local_env.SharedLibrary(module_name, sources)
109 ksteube 1705 env.Alias('target_escript_so', lib)
110 gross 700
111 phornby 1847 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'escriptcpp.cpp')
112 ksteube 1705 env.Alias('target_escriptcpp_so', py_wrapper_lib)
113 jgs 277
114 ksteube 1705 include_path = Dir('escript', local_env['incinstall'])
115 jgs 190
116 ksteube 1705 tmp1 = local_env.Install(include_path, headers )
117     env.Alias('target_install_escript_headers', [tmp1])
118 ksteube 1312
119 ksteube 1705 tmp3 = local_env.Install(local_env['libinstall'], lib)
120     env.Alias('target_install_escript_so', tmp3)
121 woo409 757
122 trankine 1428 #windows specific mod
123 phornby 1847 tmp_inst = os.path.join(local_env['pyinstall'],module_name)
124 trankine 1428 if os.name == 'nt':
125 phornby 1840 wrapper_postfix = '.pyd'
126 ksteube 1705 else:
127 phornby 1840 wrapper_postfix = '.so'
128    
129 phornby 1847 share_name = os.path.join(tmp_inst,py_wrapper_name+wrapper_postfix)
130 phornby 1840
131 phornby 1847 tmp4 = py_wrapper_local_env.InstallAs(target=share_name,
132     source=py_wrapper_lib[0])
133 phornby 1840
134 ksteube 1705 env.Alias('target_install_escriptcpp_so', tmp4)
135 trankine 1428
136 robwdcock 682 # export the lib target since tests will depend on it
137     # the lib target is a list of file nodes (why? win32 produces more than one output file: .lib, .dll, .pdb)
138     # FIXME: This list handling produces the desired result but can this be done directly with scons File nodes?
139 ksteube 1705 dep_lib = [local_env['libinstall']+'/'+str(x) for x in lib]
140 robwdcock 682 Export('dep_lib')
141 jgs 277
142 robwdcock 682 # Call the python sconscript
143     env.SConscript(dirs = ['#/escript/py_src'], build_dir='py', duplicate=0)
144 jgs 277
145 robwdcock 682 # Call the unit tests SConscript
146     local_env.SConscript(dirs = ['#/escript/test'], build_dir='#/build/$PLATFORM/escript/test', duplicate=0)
147 ksteube 1705

  ViewVC Help
Powered by ViewVC 1.1.26