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

Contents of /trunk/doc/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3463 - (show annotations)
Mon Feb 7 02:09:57 2011 UTC (8 years ago) by caltinay
File size: 6713 byte(s)
Check for gmsh in main SConstruct file and skip tests that depend on it when
the executable is not found.

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

  ViewVC Help
Powered by ViewVC 1.1.26