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

Annotation of /trunk/doc/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2950 - (hide annotations)
Thu Feb 25 07:33:16 2010 UTC (8 years, 11 months ago) by gross
File size: 6419 byte(s)
more renames in the cookbook.
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    
19 jfenwick 2667 haveGMSH=(os.system("gmsh -version")/256==0) #Do we have gmsh installed?
20     haveMPL=False #Do we have matplotlib?
21     haveGD=False #Does the matplotlib have griddata?
22 jfenwick 2674
23     mplmagicversion='0.98.5'
24    
25 jfenwick 2578 try:
26 jfenwick 2667 import matplotlib
27     haveMPL=True
28 jfenwick 2674 mplversion=matplotlib.__version__
29 jfenwick 2648 from matplotlib.mlab import griddata
30 jfenwick 2667 haveGD=True
31 jfenwick 2578 except ImportError:
32 jfenwick 2667 pass
33 jfenwick 2578
34 jfenwick 2667 if not haveMPL:
35     print "matplotlib not found skipping some tests"
36     else:
37 jfenwick 2674 if mplversion<mplmagicversion:
38     print "matplotlib found but version too early. Some tests skipped."
39 jfenwick 2667
40     if not haveGMSH:
41     print "gmsh not found"
42    
43 gross 2950 example_files_allow_mpi = [ ]
44     example_files_no_mpi = [ ]
45     example_deps = [ ]
46 jfenwick 2667
47 gross 2950 def sortOutExample(name, needsGMSH=False, needsMPL=False, needsMagicMPL=False, needsGD=False, allowsMPI=True):
48     if needsMagicMPL: needsMPL=True
49     if needsGD: needsMPL=True
50     if needsGMSH: allowsMPI=False
51 jfenwick 2667
52 gross 2950 if (not needsGMSH or haveGMSH) and (not needsMPL or haveMPL) and (not needsMagicMPL or mplversion>=mplmagicversion) and (not needsGD or haveGD):
53     if allowsMPI:
54     example_files_allow_mpi.append(name)
55     else:
56     example_files_no_mpi.append(name)
57     else:
58     example_deps.append(name)
59     #
60     # these are the release examples in example sub directory:
61     #
62     #_deps is for files which end in .py and are required for
63     # testing but should not be invoked directly themselves
64 jfenwick 2667
65 gross 2950 sortOutExample( 'usersguide/lit_driven_cavity.py')
66     sortOutExample( 'usersguide/mount.py')
67     sortOutExample( 'usersguide/heatedblock.py')
68     sortOutExample( 'usersguide/helmholtz.py')
69     sortOutExample( 'usersguide/fluid.py')
70     sortOutExample( 'usersguide/poisson.py')
71     sortOutExample( 'usersguide/diffusion.py')
72     sortOutExample( 'usersguide/poisson_vtk.py')
73     sortOutExample( 'usersguide/slip.py')
74     sortOutExample( 'usersguide/int_save.py')
75     sortOutExample( 'usersguide/wave.py', needsMPL=True)
76     sortOutExample( 'usersguide/trapezoid.py', needsGMSH=True)
77     sortOutExample( 'usersguide/quad.py', needsGMSH=True)
78     sortOutExample( 'usersguide/brick.py', needsGMSH=True)
79     sortOutExample( 'usersguide/refine.py', needsGMSH=True)
80     sortOutExample( 'usersguide/poisson_matplotlib.py', needsGD=True, allowsMPI=False)
81    
82     sortOutExample( 'geotutorial/steadystate_variablek.py')
83     sortOutExample( 'geotutorial/steadystate.py')
84     sortOutExample( 'geotutorial/forward_euler.py')
85     sortOutExample( 'geotutorial/myfirstscript.py')
86     sortOutExample( 'geotutorial/backward_euler.py')
87    
88     example_deps.append('cookbook/cblib.py')
89     sortOutExample('cookbook/example01a.py')
90     sortOutExample('cookbook/example01b.py', needsMPL=True)
91     sortOutExample('cookbook/example01c.py', needsMPL=True, allowsMPI=False)
92     sortOutExample('cookbook/example02.py', needsMPL=True, allowsMPI=False)
93     sortOutExample('cookbook/example03a.py', needsGD=True, allowsMPI=False)
94     sortOutExample('cookbook/example03b.py')
95    
96     print example_deps
97     print example_files_allow_mpi
98     print example_files_no_mpi
99    
100     # sortOutExample('cookbook/wavesolver2d001.py', allowsMPI=True)
101     # sortOutExample('cookbook/wavesolver2d002.py', allowsMPI=True)
102    
103    
104     # if mplversion>=mplmagicversion:
105     #sortOutExample('cookbook/run_heatrefraction.py', needsMagicMPL=True)
106     # example_files_no_mpi.append('usersguide/trapezoid.py')
107     # example_files_no_mpi.append('usersguide/quad.py')
108     # example_files_no_mpi.append('usersguide/brick.py')
109     # example_files_no_mpi.append('usersguide/refine.py')
110     # example_files_no_mpi.append('cookbook/simple_mesher001.py')
111     # example_files_no_mpi.append('cookbook/simple_solver001.py')
112     # example_files_no_mpi.append('cookbook/twodheatdiff001.py')
113    
114 jfenwick 2667 # we want to make sure these are still added to the examples bundle even if we can't run them
115 gross 2950 #if not haveGMSH:
116     # example_deps.append('cookbook/simple_mesher001.py')
117     # example_deps.append('cookbook/simple_solver001.py')
118     # example_deps.append('cookbook/twodheatdiff001.py')
119     #if not haveGD:
120     # example_deps.append('cookbook/twodheatdiff001.py')
121     #if not haveMPL:
122     # example_deps.append('cookbook/example01b.py')
123     # example_deps.append('cookbook/example01c.py')
124     # example_deps.append('cookbook/example02.py')
125 jfenwick 2667
126    
127 jfenwick 2648 example_files= example_files_allow_mpi + example_files_no_mpi + example_deps
128 gross 2502
129 jfenwick 2503
130     ex2=[ os.path.join("examples",str(x)) for x in example_files]
131    
132 gross 2502 #==========================================================================================
133    
134 ksteube 1705 local_env = clone_env(env)
135 jfenwick 2402 src_dir = local_env.Dir('.').srcnode().abspath
136 gross 2502 release_dir=local_env.Dir('#/release/doc/').srcnode().abspath
137 ksteube 1215
138 jfenwick 2923 dir_cmd = "cd "+src_dir+" && "
139    
140     tmp1 = local_env.Command("#/release/doc/escript_examples.zip", None,
141     dir_cmd+"zip "+os.path.join(release_dir,"escript_examples.zip ") +" ".join(ex2),
142     #chdir=src_dir
143     )
144 ksteube 2091 env.Alias('examples_zipfile', tmp1)
145 ksteube 1215
146 ksteube 1705
147 jfenwick 2405 #Need to use explicit tar rather than the tar builder due to problems getting it not to put
148     #unwanted path components in the tar file
149     #--transform on tar is not supported on savanna
150 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),
151     # chdir=src_dir
152     )
153 jfenwick 2405 env.Alias('examples_tarfile',tmp2)
154    
155     #env=Environment(TARFLAGS = "-c -z",chdir=src_dir)
156     #if 'Tar' in dir(env): env.Tar('#/release/doc/escript_examples.tar.gz', example_files,chdir=src_dir)
157     #env.Alias('examples_tarfile', '#release/doc/escript_examples.tar.gz')
158    
159 jfenwick 2667 local_env.SConscript(dirs = ['#/doc/cookbook'], build_dir='#/build/$PLATFORM/doc/cookbook', duplicate=1)
160 gross 707 local_env.SConscript(dirs = ['#/doc/user'], build_dir='#/build/$PLATFORM/doc/user', duplicate=1)
161 elspeth 712 local_env.SConscript(dirs = ['#/doc/epydoc'], build_dir='#/build/$PLATFORM/doc/epydoc', duplicate=1)
162 ksteube 1215 local_env.SConscript(dirs = ['#/doc/doxygen'], build_dir='#/build/$PLATFORM/doc/doxygen', duplicate=1)
163 jfenwick 2287 local_env.SConscript(dirs = ['#/doc/install'], build_dir='#/build/$PLATFORM/doc/install', duplicate=1)
164 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' ])
165 ksteube 1705
166 jfenwick 2402

  ViewVC Help
Powered by ViewVC 1.1.26