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

Contents of /trunk/doc/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4110 - (show annotations)
Fri Dec 14 01:21:33 2012 UTC (6 years, 9 months ago) by jfenwick
File size: 7614 byte(s)
Fixed to use whatever python is leading the path.
Disabled epydoc

1
2 ##############################################################################
3 #
4 # Copyright (c) 2003-2012 by University of Queensland
5 # http://www.uq.edu.au
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 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 # Development since 2012 by School of Earth Sciences
13 #
14 ##############################################################################
15
16 import os
17 Import('*')
18
19 from subprocess import PIPE, Popen
20
21 haveMPL=False # do we have matplotlib?
22 haveGD=False # does matplotlib have griddata?
23
24 mplmagicversion='0.98.5'
25
26 # check for matplotlib
27 if env['pythoncmd']=='python':
28 try:
29 import matplotlib
30 haveMPL=True
31 mplversion=matplotlib.__version__
32 from matplotlib.mlab import griddata
33 haveGD=True
34 except ImportError:
35 pass
36 else:
37 # we need to fire up the external command
38 p=Popen([env['pythoncmd'], '-c', 'from __future__ import print_function;import matplotlib;print(matplotlib.__version__);from matplotlib.mlab import griddata;print("1")'], stdout=PIPE)
39 try:
40 mplversion=p.stdout.readline().strip()
41 haveMPL=True
42 hgd=p.stdout.readline().strip()
43 haveGD=True
44 except IOError:
45 pass
46 p.wait()
47
48 if not haveMPL:
49 print("matplotlib not found, skipping some tests")
50 else:
51 if mplversion<mplmagicversion:
52 print("matplotlib found, but version too early. Some tests skipped.")
53
54 example_files_allow_mpi = []
55 example_files_no_mpi = []
56 example_deps = []
57 skipped_tests = []
58
59 def sortOutExample(name, needsGMSH=False, needsMPL=False, needsMagicMPL=False, needsGD=False, allowsMPI=True):
60 if needsMagicMPL: needsMPL=True
61 if needsGD: needsMPL=True
62 if needsGMSH: allowsMPI=False
63
64 if needsGMSH and not env['gmsh']:
65 skipped_tests.append(name)
66 return
67
68 if (not needsGMSH or env['gmsh']) and (not needsMPL or haveMPL) and (not needsMagicMPL or mplversion>=mplmagicversion) and (not needsGD or haveGD):
69 if allowsMPI:
70 example_files_allow_mpi.append(name)
71 else:
72 example_files_no_mpi.append(name)
73 else:
74 example_deps.append(name)
75
76 # these are the release examples in example subdirectory:
77 #
78 #_deps is for files which end in .py and are required for
79 # testing but should not be invoked directly themselves
80
81 sortOutExample('usersguide/lid_driven_cavity.py')
82 sortOutExample('usersguide/mount.py')
83 sortOutExample('usersguide/heatedblock.py')
84 sortOutExample('usersguide/helmholtz.py')
85 sortOutExample('usersguide/fluid.py')
86 sortOutExample('usersguide/poisson.py')
87 sortOutExample('usersguide/diffusion.py')
88 sortOutExample('usersguide/poisson_vtk.py')
89 sortOutExample('usersguide/darcy.py')
90 sortOutExample('usersguide/slip.py')
91 sortOutExample('usersguide/int_save.py')
92 sortOutExample('usersguide/wave.py', needsMPL=True)
93 sortOutExample('usersguide/trapezoid.py', needsGMSH=True, allowsMPI=False)
94 sortOutExample('usersguide/quad.py', needsGMSH=True)
95 sortOutExample('usersguide/brick.py', needsGMSH=True)
96 sortOutExample('usersguide/refine.py', needsGMSH=True)
97 sortOutExample('usersguide/poisson_matplotlib.py', needsGD=True, allowsMPI=False)
98
99 sortOutExample('geotutorial/steadystate_variablek.py')
100 sortOutExample('geotutorial/steadystate.py')
101 sortOutExample('geotutorial/forward_euler.py')
102 sortOutExample('geotutorial/myfirstscript.py')
103 sortOutExample('geotutorial/backward_euler.py')
104
105 example_deps.append('cookbook/cblib.py')
106 sortOutExample('cookbook/example01a.py')
107 sortOutExample('cookbook/example01b.py', needsMPL=True)
108 sortOutExample('cookbook/example01c.py', needsMPL=True, allowsMPI=False)
109 sortOutExample('cookbook/example02.py', needsMPL=True, allowsMPI=False)
110 sortOutExample('cookbook/example03a.py', needsGD=True, allowsMPI=False)
111 sortOutExample('cookbook/example03b.py')
112 sortOutExample('cookbook/example04a.py', needsGMSH=True)
113 sortOutExample('cookbook/example04b.py', needsGMSH=True, needsGD=True)
114 sortOutExample('cookbook/example05a.py', needsGMSH=True, needsGD=True)
115 sortOutExample('cookbook/example05b.py', needsGMSH=True, needsGD=True)
116 sortOutExample('cookbook/example05c.py', needsGMSH=True, needsGD=True, needsMagicMPL=True)
117 sortOutExample('cookbook/example06.py', needsGMSH=True, needsGD=True, needsMagicMPL=True)
118 sortOutExample('cookbook/example07a.py', needsMagicMPL=True, allowsMPI=False)
119 sortOutExample('cookbook/example07b.py', needsMagicMPL=True, allowsMPI=False)
120 sortOutExample('cookbook/example08a.py', needsMagicMPL=True, allowsMPI=False)
121 sortOutExample('cookbook/example08b.py', needsMagicMPL=True, allowsMPI=False)
122 sortOutExample('cookbook/example08c.py', needsMagicMPL=True, needsGMSH=True, allowsMPI=False)
123 sortOutExample('cookbook/example09m.py', needsMagicMPL=True, needsGMSH=True, allowsMPI=False)
124 sortOutExample('cookbook/example09a.py', needsMagicMPL=True, needsGMSH=True, allowsMPI=False)
125 #sortOutExample('cookbook/example09b.py', needsMagicMPL=True, needsGMSH=True, allowsMPI=False)
126 sortOutExample('cookbook/example10a.py', needsMagicMPL=True, allowsMPI=False)
127 sortOutExample('cookbook/example10b.py', needsMagicMPL=True, allowsMPI=False)
128 sortOutExample('cookbook/example10m.py', needsMagicMPL=True, needsGMSH=True, allowsMPI=False)
129 #sortOutExample('cookbook/example10c_0.py', needsMagicMPL=True, needsGMSH=True, allowsMPI=False)
130 #sortOutExample('cookbook/example10c_1.py', needsMagicMPL=True, needsGMSH=True, allowsMPI=False)
131 sortOutExample('cookbook/example11a.py', needsMagicMPL=True, allowsMPI=False)
132 sortOutExample('cookbook/example11b.py', needsMagicMPL=True, allowsMPI=False)
133
134 if len(skipped_tests)>0:
135 print("gmsh not available. Skipping tests %s!"%' '.join(skipped_tests))
136
137 example_files = example_files_allow_mpi + example_files_no_mpi + example_deps
138
139 ex2=[os.path.join("examples", str(x)) for x in example_files]
140
141 #=============================================================================
142
143 local_env = env.Clone()
144 src_dir = local_env.Dir('.').srcnode().abspath
145 release_dir=os.path.join(env['prefix'],'release','doc')
146 Export('release_dir')
147
148 dir_cmd = "cd "+src_dir+" && "
149
150 # Need to use explicit tar/zip rather than the builder due to problems getting
151 # it not to put unwanted path components in the archive file
152 # --transform on tar is not supported on savanna
153 zip_path=os.path.join(release_dir, 'escript_examples.zip')
154 zip = local_env.Command(zip_path, None, dir_cmd+"zip "+zip_path+" "+" ".join(ex2))
155 env.Alias('examples_zipfile', zip)
156
157 tar_path=os.path.join(release_dir, 'escript_examples.tar.gz')
158 tar = local_env.Command(tar_path, None, dir_cmd+"tar -czf "+tar_path+" "+" ".join(ex2))
159 env.Alias('examples_tarfile', tar)
160
161 #env=Environment(TARFLAGS = "-c -z",chdir=src_dir)
162 #if 'Tar' in dir(env):
163 # tar=env.Tar(tar_path, example_files, chdir=src_dir)
164 # env.Alias('examples_tarfile', tar)
165
166 local_env.SConscript(dirs = ['#/doc/cookbook'], variant_dir='cookbook', duplicate=1)
167 local_env.SConscript(dirs = ['#/doc/user'], variant_dir='user', duplicate=1)
168 local_env.SConscript(dirs = ['#/doc/inversion'], variant_dir='inversion', duplicate=1)
169 local_env.SConscript(dirs = ['#/doc/epydoc'], variant_dir='epydoc', duplicate=1)
170 local_env.SConscript(dirs = ['#/doc/sphinx_api'], variant_dir='sphinx_api', duplicate=1)
171 local_env.SConscript(dirs = ['#/doc/doxygen'], variant_dir='doxygen', duplicate=1)
172 local_env.SConscript(dirs = ['#/doc/install'], variant_dir='install', duplicate=1)
173 local_env.SConscript(dirs = ['#/doc/examples'], variant_dir='examples', duplicate=1, exports=['example_files_allow_mpi', 'example_files_no_mpi', 'example_deps'])
174

  ViewVC Help
Powered by ViewVC 1.1.26