/[escript]/branches/domexper/doc/SConscript
ViewVC logotype

Annotation of /branches/domexper/doc/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2949 - (hide annotations)
Thu Feb 25 05:23:11 2010 UTC (9 years, 3 months ago) by gross
Original Path: trunk/doc/SConscript
File size: 5810 byte(s)
renaming examples part 1
1 ksteube 1811
2     ########################################################
3 cochrane 369 #
4 jfenwick 2881 # Copyright (c) 2003-2010 by University of Queensland
5 ksteube 1811 # Earth Systems Science Computational Center (ESSCC)
6     # http://www.uq.edu.au/esscc
7 elspeth 643 #
8 ksteube 1811 # Primary Business: Queensland, Australia
9     # Licensed under the Open Software License version 3.0
10     # http://www.opensource.org/licenses/osl-3.0.php
11 ksteube 1705 #
12 ksteube 1811 ########################################################
13 cochrane 369
14 ksteube 1811
15 gross 707 import os
16     Import('*')
17 jfenwick 2648
18 jfenwick 2697 #_deps is for files which end in .py and are required for
19     # testing but should not be invoked directly themselves
20 gross 2948 example_deps = ['cookbook/cblib.py',
21     'cookbook/heatrefraction_mesher001.py',
22 jfenwick 2667 'cookbook/heatrefraction_mesher002.py',
23     'cookbook/heatrefraction001.py',
24 jfenwick 2697 'cookbook/heatrefraction002.py',
25 jfenwick 2667 ]
26 jfenwick 2648
27 gross 2502 #
28     # these are the release examples in example sub directory:
29     #
30     example_files_allow_mpi = [
31     'geotutorial/steadystate_variablek.py',
32     'geotutorial/steadystate.py',
33     'geotutorial/forward_euler.py',
34     'geotutorial/myfirstscript.py',
35     'geotutorial/backward_euler.py',
36     'usersguide/lit_driven_cavity.py',
37     'usersguide/mount.py',
38     'usersguide/heatedblock.py',
39     'usersguide/helmholtz.py',
40     'usersguide/fluid.py',
41     'usersguide/poisson.py',
42     'usersguide/diffusion.py',
43 gross 2655 'usersguide/poisson_vtk.py',
44 jfenwick 2677 'usersguide/slip.py',
45 gross 2683 'usersguide/int_save.py',
46 gross 2502 ]
47 cochrane 369
48 gross 2574 example_files_no_mpi = [
49     ]
50 gross 2502
51 jfenwick 2667 haveGMSH=(os.system("gmsh -version")/256==0) #Do we have gmsh installed?
52     haveMPL=False #Do we have matplotlib?
53     haveGD=False #Does the matplotlib have griddata?
54 jfenwick 2674
55     mplmagicversion='0.98.5'
56    
57 jfenwick 2578 try:
58 jfenwick 2667 import matplotlib
59     haveMPL=True
60 jfenwick 2674 mplversion=matplotlib.__version__
61 jfenwick 2648 from matplotlib.mlab import griddata
62 jfenwick 2667 haveGD=True
63 jfenwick 2578 except ImportError:
64 jfenwick 2667 pass
65 jfenwick 2578
66 jfenwick 2667 if not haveMPL:
67     print "matplotlib not found skipping some tests"
68     else:
69 jfenwick 2674 if mplversion<mplmagicversion:
70     print "matplotlib found but version too early. Some tests skipped."
71 jfenwick 2667
72     if not haveGMSH:
73     print "gmsh not found"
74    
75 gross 2949 example_files_allow_mpi.append('cookbook/example01a.py')
76 gross 2931 example_files_allow_mpi.append('cookbook/twodheatdiffvtk.py')
77 jfenwick 2667 example_files_no_mpi.append('cookbook/wavesolver2d001.py')
78     example_files_no_mpi.append('cookbook/wavesolver2d002.py')
79    
80    
81     if haveMPL:
82 gross 2949 example_files_no_mpi.append('cookbook/example01b.py')
83     example_files_no_mpi.append('cookbook/example01c.py')
84     example_files_no_mpi.append('cookbook/example02.py')
85 jfenwick 2674 if mplversion>=mplmagicversion:
86 jfenwick 2667 example_files_no_mpi.append('cookbook/twodheatdiff001.py')
87     example_files_no_mpi.append('usersguide/poisson_matplotlib.py')
88     example_files_allow_mpi.append('usersguide/wave.py')
89     if haveGMSH:
90     example_files_no_mpi.append('cookbook/run_heatrefraction.py')
91 gross 2683 if haveGMSH:
92 jfenwick 2776 example_files_no_mpi.append('usersguide/trapezoid.py')
93     example_files_no_mpi.append('usersguide/quad.py')
94     example_files_no_mpi.append('usersguide/brick.py')
95     example_files_no_mpi.append('usersguide/refine.py')
96 gross 2948 example_files_no_mpi.append('cookbook/simple_mesher001.py')
97     example_files_no_mpi.append('cookbook/simple_solver001.py')
98     example_files_no_mpi.append('cookbook/twodheatdiff001.py')
99 jfenwick 2667
100     # we want to make sure these are still added to the examples bundle even if we can't run them
101     if not haveGMSH:
102     example_deps.append('cookbook/run_heatrefraction.py')
103 gross 2683 example_deps.append('usersguide/trapezoid.py')
104     example_deps.append('usersguide/quad.py')
105     example_deps.append('usersguide/brick.py')
106     example_deps.append('usersguide/refine.py')
107 gross 2948 example_deps.append('cookbook/simple_mesher001.py')
108     example_deps.append('cookbook/simple_solver001.py')
109     example_deps.append('cookbook/twodheatdiff001.py')
110 jfenwick 2667 if not haveGD:
111     example_deps.append('cookbook/twodheatdiff001.py')
112     example_deps.append('usersguide/poisson_matplotlib.py')
113     example_deps.append('usersguide/wave.py')
114     if not haveMPL:
115 gross 2949 example_deps.append('cookbook/example01b.py')
116     example_deps.append('cookbook/example01c.py')
117     example_deps.append('cookbook/example02.py')
118 jfenwick 2667
119    
120 jfenwick 2648 example_files= example_files_allow_mpi + example_files_no_mpi + example_deps
121 gross 2502
122 jfenwick 2503
123     ex2=[ os.path.join("examples",str(x)) for x in example_files]
124    
125 gross 2502 #==========================================================================================
126    
127 ksteube 1705 local_env = clone_env(env)
128 jfenwick 2402 src_dir = local_env.Dir('.').srcnode().abspath
129 gross 2502 release_dir=local_env.Dir('#/release/doc/').srcnode().abspath
130 ksteube 1215
131 jfenwick 2923 dir_cmd = "cd "+src_dir+" && "
132    
133     tmp1 = local_env.Command("#/release/doc/escript_examples.zip", None,
134     dir_cmd+"zip "+os.path.join(release_dir,"escript_examples.zip ") +" ".join(ex2),
135     #chdir=src_dir
136     )
137 ksteube 2091 env.Alias('examples_zipfile', tmp1)
138 ksteube 1215
139 ksteube 1705
140 jfenwick 2405 #Need to use explicit tar rather than the tar builder due to problems getting it not to put
141     #unwanted path components in the tar file
142     #--transform on tar is not supported on savanna
143 jfenwick 2923 tmp2 = local_env.Command("#/release/doc/escript_examples.tar.gz", None, dir_cmd+"tar -czf "+os.path.join(release_dir,"escript_examples.tar.gz ")+" ".join(ex2),
144     # chdir=src_dir
145     )
146 jfenwick 2405 env.Alias('examples_tarfile',tmp2)
147    
148     #env=Environment(TARFLAGS = "-c -z",chdir=src_dir)
149     #if 'Tar' in dir(env): env.Tar('#/release/doc/escript_examples.tar.gz', example_files,chdir=src_dir)
150     #env.Alias('examples_tarfile', '#release/doc/escript_examples.tar.gz')
151    
152 jfenwick 2667 local_env.SConscript(dirs = ['#/doc/cookbook'], build_dir='#/build/$PLATFORM/doc/cookbook', duplicate=1)
153 gross 707 local_env.SConscript(dirs = ['#/doc/user'], build_dir='#/build/$PLATFORM/doc/user', duplicate=1)
154 elspeth 712 local_env.SConscript(dirs = ['#/doc/epydoc'], build_dir='#/build/$PLATFORM/doc/epydoc', duplicate=1)
155 ksteube 1215 local_env.SConscript(dirs = ['#/doc/doxygen'], build_dir='#/build/$PLATFORM/doc/doxygen', duplicate=1)
156 jfenwick 2287 local_env.SConscript(dirs = ['#/doc/install'], build_dir='#/build/$PLATFORM/doc/install', duplicate=1)
157 jfenwick 2648 local_env.SConscript(dirs = ['#/doc/examples'], build_dir='#/build/$PLATFORM/doc/examples', duplicate=1, exports=[ 'example_files_allow_mpi' , 'example_files_no_mpi', 'example_deps' ])
158 ksteube 1705
159 jfenwick 2402

  ViewVC Help
Powered by ViewVC 1.1.26