/[escript]/branches/refine/buckley/src/SConscript
ViewVC logotype

Annotation of /branches/refine/buckley/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3658 - (hide annotations)
Fri Nov 11 06:55:48 2011 UTC (10 years ago) by jfenwick
Original Path: branches/refine/refine/src/SConscript
File size: 2548 byte(s)
the refine domain is hooked into scons but doesn't do anything useful yet.

1 jfenwick 3658
2    
3     ########################################################
4     #
5     # Copyright (c) 2003-2010 by University of Queensland
6     # Earth Systems Science Computational Center (ESSCC)
7     # http://www.uq.edu.au/esscc
8     #
9     # Primary Business: Queensland, Australia
10     # Licensed under the Open Software License version 3.0
11     # http://www.opensource.org/licenses/osl-3.0.php
12     #
13     ########################################################
14    
15    
16     import os
17     Import('*')
18    
19     local_env = env.Clone()
20     py_wrapper_local_env = env.Clone()
21     local_unroll_env = env.Clone()
22     local_unroll_env.Append(CFLAGS = env['refine_assemble_flags'])
23    
24    
25     # Remove the sharedlibrary prefix on all platform - we don't want 'lib' mucking with our python modules
26     del py_wrapper_local_env['SHLIBPREFIX']
27    
28     sources = """
29     OctTree.cc
30     RDomain.cc
31     RDomainException.cc
32     """.split()
33     unroll_sources= """
34     OctCell.cc
35     LeafInfo.cc
36     """.split()
37    
38    
39     headers = """
40     FaceConsts.h
41     OctTree.h
42     RDomain.h
43     LeafInfo.h
44     OctCell.h
45     RDomainException.h
46     system_dep.h
47     """.split()
48    
49     local_env.Prepend(LIBS = ['escript', 'esysUtils', 'paso'])
50    
51     if IS_WINDOWS :
52     local_env.Append(CPPDEFINES = ['REFINE_EXPORTS'])
53    
54     module_name = 'refine'
55    
56     un = [ local_unroll_env.SharedObject(x) for x in unroll_sources]
57    
58     lib = local_env.SharedLibrary(module_name, sources+un)
59     env.Alias('build_refine_lib', lib)
60    
61     include_path = Dir('refine', local_env['incinstall'])
62    
63     hdr_inst1 = local_env.Install(include_path, headers )
64     env.Alias('install_refine_headers', hdr_inst1)
65    
66     lib_inst = local_env.Install(local_env['libinstall'], lib)
67     env.Alias('install_refine_lib', lib_inst)
68    
69     ### Python wrapper ###
70     py_wrapper_local_env.Prepend(LIBS = ['refine', 'escript', 'esysUtils', 'paso'])
71     py_wrapper_name = module_name + 'cpp'
72     py_wrapper_lib = py_wrapper_local_env.SharedLibrary(py_wrapper_name, 'refinecpp.cpp')
73     env.Alias('build_refinecpp_lib', py_wrapper_lib)
74    
75     tmp_inst = os.path.join(local_env['pyinstall'], module_name)
76     if IS_WINDOWS:
77     wrapper_ext = '.pyd'
78     else:
79     wrapper_ext = '.so'
80    
81     share_name = os.path.join(tmp_inst, py_wrapper_name+wrapper_ext)
82     mod_inst = py_wrapper_local_env.InstallAs(target=share_name,
83     source=py_wrapper_lib[0])
84     env.Alias('install_refinecpp_lib', mod_inst)
85    
86     # configure python module
87     local_env.SConscript(dirs = ['#/refine/py_src'], variant_dir='py', duplicate=0)
88    
89     # configure unit tests
90     local_env.SConscript(dirs = ['#/refine/test'], variant_dir='$BUILD_DIR/$PLATFORM/refine/test', duplicate=0, exports=['py_wrapper_lib'])
91    

  ViewVC Help
Powered by ViewVC 1.1.26