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

Contents of /trunk/escript/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2078 - (show annotations)
Thu Nov 20 16:10:10 2008 UTC (10 years, 11 months ago) by phornby
File size: 3649 byte(s)
Two changes.

1. Move blocktimer from escript to esysUtils.
2. Make it possible to link to paso as a DLL or .so.

Should have no effect on 'nix's

In respect of 1., blocktimer had begun to spring up everywhere, so
for the moment I thought it best to move it to the only other library that
pops up all over the place.

In respect of 2., paso needed to be a DLL in order to use the windows intelc /fast
option, which does aggressive multi-file optimisations. Even in its current form, it either
vectorises or parallelises  hundreds more loops in the esys system than appear in the pragmas.

In achieving 2. I have not been too delicate in adding

PASO_DLL_API

declarations to the .h files in paso/src. Only toward the end of the process of
the conversion, when the number of linker errors dropped below 20, say, did I choosy about what
functions in a header I declared PASO_DLL_API. As a result, there are likely to be many routines
declared as external functions symbols that are in fact internal to the paso DLL. 
Why is this an issue?  It prevents the intelc compiler from getting aggressive on the paso module.
With pain there is sometimes gain. At least all the DLL rules in windows give good
(non-microsoft) compiler writers a chance to really shine.

So, if you should see a PASO_DLL_API on a function in a paso header file,
and think to yourself, "that function is only called in paso, why export it?", then feel free to
delete the PASO_DLL_API export declaration.

Here's hoping for no breakage.....
1 ########################################################
2 #
3 # Copyright (c) 2003-2008 by University of Queensland
4 # Earth Systems Science Computational Center (ESSCC)
5 # http://www.uq.edu.au/esscc
6 #
7 # 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 #
11 ########################################################
12
13
14 import os
15 Import('*')
16
17 local_env = clone_env(env_mpi)
18 py_wrapper_local_env = clone_env(env_mpi)
19
20 # 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
23 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 DataLazy.cpp
38 DataMaths.cpp
39 DataReady.cpp
40 DataTagged.cpp
41 DataTypes.cpp
42 DataVector.cpp
43 DomainException.cpp
44 EscriptParams.cpp
45 FunctionSpace.cpp
46 FunctionSpaceException.cpp
47 FunctionSpaceFactory.cpp
48 NullDomain.cpp
49 SystemMatrixException.cpp
50 Taipan.cpp
51 TransportProblemException.cpp
52 Utils.cpp
53 """.split()
54 # blocktimer.c
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 DataLazy.h
72 DataMaths.h
73 DataReady.h
74 DataTagged.h
75 DataTypes.h
76 DataVector.h
77 DomainException.h
78 EscriptParams.h
79 FunctionSpace.h
80 FunctionSpaceException.h
81 FunctionSpaceFactory.h
82 LocalOps.h
83 NullDomain.h
84 Pointers.h
85 SystemMatrixException.h
86 Taipan.h
87 TransportProblemException.h
88 UnaryFuncs.h
89 UnaryOp.h
90 UtilC.h
91 Utils.h
92 esysmpi.h
93 system_dep.h
94 """.split()
95 # blocktimer.h
96
97 local_env.Append(LIBS = [ 'esysUtils'] + env['sys_libs'] )
98
99 if IS_WINDOWS_PLATFORM :
100 local_env.Append(CPPDEFINES = ['ESCRIPT_EXPORTS'])
101
102 py_wrapper_local_env.Append(LIBS = [ 'escript', 'esysUtils'] + env['sys_libs'])
103
104 module_name = 'escript'
105 py_wrapper_name = module_name + 'cpp'
106
107 lib = local_env.SharedLibrary(module_name, sources)
108 env.Alias('target_escript_so', lib)
109
110 py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'escriptcpp.cpp')
111 env.Alias('target_escriptcpp_so', py_wrapper_lib)
112
113 include_path = Dir('escript', local_env['incinstall'])
114
115 tmp1 = local_env.Install(include_path, headers )
116 env.Alias('target_install_escript_headers', [tmp1])
117
118 tmp3 = local_env.Install(local_env['libinstall'], lib)
119 env.Alias('target_install_escript_so', tmp3)
120
121 #windows specific mod
122 tmp_inst = os.path.join(local_env['pyinstall'],module_name)
123 if os.name == 'nt':
124 wrapper_postfix = '.pyd'
125 else:
126 wrapper_postfix = '.so'
127
128 share_name = os.path.join(tmp_inst,py_wrapper_name+wrapper_postfix)
129
130 tmp4 = py_wrapper_local_env.InstallAs(target=share_name,
131 source=py_wrapper_lib[0])
132
133 env.Alias('target_install_escriptcpp_so', tmp4)
134
135 # export the lib target since tests will depend on it
136 # the lib target is a list of file nodes (why? win32 produces more than one output file: .lib, .dll, .pdb)
137 # FIXME: This list handling produces the desired result but can this be done directly with scons File nodes?
138 dep_lib = [local_env['libinstall']+'/'+str(x) for x in lib]
139 Export('dep_lib')
140
141 # Call the python sconscript
142 env.SConscript(dirs = ['#/escript/py_src'], build_dir='py', duplicate=0)
143
144 # Call the unit tests SConscript
145 local_env.SConscript(dirs = ['#/escript/test'], build_dir='#/build/$PLATFORM/escript/test', duplicate=0)
146

  ViewVC Help
Powered by ViewVC 1.1.26