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

Annotation of /trunk/dataexporter/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2812 - (hide annotations)
Tue Dec 8 00:12:07 2009 UTC (9 years, 7 months ago) by caltinay
File size: 2872 byte(s)
Implemented saveSilo within a new dataexporter module. If Silo is not available
at compile time the function throws. Ultimately, saveVTK will be moved here as
well.

1 caltinay 2184 ########################################################
2     #
3 jfenwick 2548 # Copyright (c) 2003-2009 by University of Queensland
4 caltinay 2184 # 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 caltinay 2810 local_env = clone_env(env_mpi)
18 caltinay 2812 py_wrapper_local_env = clone_env(env_mpi)
19 caltinay 2810
20 caltinay 2812 # Remove the shared library prefix on all platforms - we don't want 'lib'
21     # mucking with our python modules
22     del py_wrapper_local_env['SHLIBPREFIX']
23    
24 caltinay 2184 sources = """
25 caltinay 2810 DataVar.cpp
26     ElementData.cpp
27     EscriptDataset.cpp
28 caltinay 2812 FileSavers.cpp
29 caltinay 2810 FinleyMesh.cpp
30     NodeData.cpp
31 caltinay 2184 """.split()
32 caltinay 2812
33 caltinay 2184 headers = """
34 caltinay 2810 DataVar.h
35     ElementData.h
36     EscriptDataset.h
37     escriptexport.h
38 caltinay 2812 FileSavers.h
39 caltinay 2810 FinleyMesh.h
40     NodeData.h
41 caltinay 2184 """.split()
42    
43 caltinay 2812 local_env.AppendUnique(LIBS = ['finley'] + env['sys_libs'])
44 caltinay 2811 if local_env['usesilo']:
45     local_env.AppendUnique(LIBS = [env['silo_libs']])
46 caltinay 2184
47 caltinay 2810 if IS_WINDOWS_PLATFORM :
48     local_env.Append(CPPDEFINES = ['ESCRIPTEXPORT_EXPORTS'])
49 caltinay 2184
50 caltinay 2810 module_name = 'escriptexport'
51 caltinay 2184
52 caltinay 2810 lib = local_env.SharedLibrary(module_name, sources)
53     env.Alias('target_escriptexport_so', lib)
54 caltinay 2184
55 caltinay 2810 include_path = Dir('escriptexport', local_env['incinstall'])
56    
57     tmp1 = local_env.Install(include_path, headers)
58     env.Alias('target_install_escriptexport_headers', [tmp1])
59    
60 caltinay 2812 tmp2 = local_env.Install(local_env['libinstall'], lib)
61     env.Alias('target_install_escriptexport_so', tmp2)
62 caltinay 2810
63 caltinay 2812 ### Python wrapper ###
64     py_wrapper_local_env.Append(LIBS = ['escriptexport'] + env['sys_libs'])
65     py_wrapper_name = module_name + 'cpp'
66     py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'escriptexportcpp.cpp')
67     env.Alias('target_escriptexportcpp_so', py_wrapper_lib)
68    
69     tmp_inst = os.path.join(local_env['pyinstall'], 'dataexporter')
70     #windows specific mod
71     if os.name == 'nt':
72     wrapper_postfix = '.pyd'
73     else:
74     wrapper_postfix = '.so'
75    
76     share_name = os.path.join(tmp_inst, py_wrapper_name + wrapper_postfix)
77     tmp3 = py_wrapper_local_env.InstallAs(target=share_name,
78     source=py_wrapper_lib[0])
79     env.Alias('target_install_escriptexportcpp_so', tmp3)
80    
81 caltinay 2810 # export the lib target since tests will depend on it
82     # the lib target is a list of file nodes (why? win32 produces more than one
83     # output file: .lib, .dll, .pdb)
84     # FIXME: This list handling produces the desired result but can this be done
85     # directly with scons File nodes?
86     dep_lib = [local_env['libinstall']+'/'+str(x) for x in lib]
87     Export('dep_lib')
88    
89 caltinay 2812 # Call the python SConscript
90     env.SConscript(dirs = ['#/dataexporter/py_src'], build_dir='py', duplicate=0)
91    
92 caltinay 2810 # Call the unit tests SConscript
93     #local_env.SConscript(dirs = ['#/dataexporter/test'], build_dir='#/build/$PLATFORM/dataexporter/test', duplicate=0)
94    

  ViewVC Help
Powered by ViewVC 1.1.26