/[escript]/branches/scons-dev/escript/src/SConscript
ViewVC logotype

Contents of /branches/scons-dev/escript/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1641 - (show annotations)
Tue Jul 15 00:23:45 2008 UTC (11 years, 10 months ago) by ksteube
File size: 3221 byte(s)
New SConstruct uses Configure() to determine which libraries/headers
are available.

Now using targets for each library instead of a target for the lib
directory...this gives better control over what gets built.

Source files are explicitly listed instead of discovered using glob.

This is not ready for use just yet.

1 import os
2 Import('*')
3
4 local_env=env_mpi.Copy()
5 py_wrapper_local_env=env_mpi.Copy()
6
7 # Remove the sharedlibrary prefix on all platform - we don't want 'lib' mucking with our python modules
8 del py_wrapper_local_env['SHLIBPREFIX']
9
10 sources = """
11 AbstractContinuousDomain.cpp
12 AbstractDomain.cpp
13 AbstractSystemMatrix.cpp
14 AbstractTransportProblem.cpp
15 Data.cpp
16 DataAbstract.cpp
17 DataArrayView.cpp
18 DataBlocks2D.cpp
19 DataC.cpp
20 DataConstant.cpp
21 DataEmpty.cpp
22 DataException.cpp
23 DataExpanded.cpp
24 DataFactory.cpp
25 DataTagged.cpp
26 DataVector.cpp
27 DomainException.cpp
28 FunctionSpace.cpp
29 FunctionSpaceException.cpp
30 FunctionSpaceFactory.cpp
31 NullDomain.cpp
32 SystemMatrixException.cpp
33 Taipan.cpp
34 TransportProblemException.cpp
35 Utils.cpp
36 blocktimer.c
37 """.split()
38 headers = """
39 AbstractContinuousDomain.h
40 AbstractDomain.h
41 AbstractSystemMatrix.h
42 AbstractTransportProblem.h
43 BinaryOp.h
44 Data.h
45 DataAbstract.h
46 DataAlgorithm.h
47 DataArrayView.h
48 DataBlocks2D.h
49 DataC.h
50 DataConstant.h
51 DataEmpty.h
52 DataException.h
53 DataExpanded.h
54 DataFactory.h
55 DataTagged.h
56 DataVector.h
57 DomainException.h
58 FunctionSpace.h
59 FunctionSpaceException.h
60 FunctionSpaceFactory.h
61 LocalOps.h
62 NullDomain.h
63 SystemMatrixException.h
64 Taipan.h
65 TransportProblemException.h
66 UnaryFuncs.h
67 UnaryOp.h
68 UtilC.h
69 Utils.h
70 blocktimer.h
71 esysmpi.h
72 system_dep.h
73 """.split()
74
75 local_env.Append(LIBS = [ 'esysUtils'] + sys_libs )
76 py_wrapper_local_env.Append(LIBS = [ 'escript', 'esysUtils'] + sys_libs)
77
78 if local_env['papi_instrument_solver']:
79 local_env.Append(CPPDEFINES=['PAPI',])
80 if local_env['papi_libs']:
81 local_env.Append(LIBS = local_env['papi_libs'])
82 local_env.Append(CPPDEFINES=['BLOCKPAPI',])
83
84 local_env.Append(CPPDEFINES = [ 'ESCRIPT_EXPORTS'] )
85
86 lib = local_env.SharedLibrary('escript', sources)
87 env.Alias('target_escript_so', lib)
88
89 py_wrapper_lib = py_wrapper_local_env.SharedLibrary('escriptcpp', 'escriptcpp.cpp')
90 env.Alias('target_escriptcpp_so', py_wrapper_lib)
91
92 include_path = Dir('escript', incinstall)
93
94 tmp1 = local_env.Install(include_path, headers )
95 env.Alias('target_install_escript_headers', [tmp1])
96
97 tmp3 = local_env.Install(libinstall, lib)
98 env.Alias('target_install_escript_so', tmp3)
99
100 tmp4 = py_wrapper_local_env.Install(pyinstall+'/escript', py_wrapper_lib)
101 env.Alias('target_install_escriptcpp_so', tmp4)
102
103 #windows specific mod
104 if os.name == 'nt':
105 py_wrapper_local_env.InstallAs(target = [ pyinstall+'/escript/escriptcpp.pyd', \
106 pyinstall+'/escript/escriptcpp.lib', \
107 pyinstall+'/escript/escriptcpp.exp' ], \
108 source = py_wrapper_lib)
109
110 # export the lib target since tests will depend on it
111 # the lib target is a list of file nodes (why? win32 produces more than one output file: .lib, .dll, .pdb)
112 # FIXME: This list handling produces the desired result but can this be done directly with scons File nodes?
113 dep_lib = [libinstall+'/'+str(x) for x in lib]
114 Export('dep_lib')
115
116 # Call the python sconscript
117 env.SConscript(dirs = ['#/escript/py_src'], build_dir='py', duplicate=0)
118
119 # Call the unit tests SConscript
120 local_env.SConscript(dirs = ['#/escript/test'], build_dir='#/build/$PLATFORM/escript/test', duplicate=0)
121

  ViewVC Help
Powered by ViewVC 1.1.26