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

Annotation of /trunk/doc/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2667 - (hide annotations)
Thu Sep 17 01:49:11 2009 UTC (9 years, 5 months ago) by jfenwick
File size: 4738 byte(s)
Renamed the main cookbook tex file to match our convention.
Replaced doc/cookbook/figures/heatrefraction002contqu.pdf with
a version which is actually pdf. However it needs to be regnerated since
it it sideways.

The examples have had their copyright notices fixed (dates were too early).
sb2.py has been removed since it uses pyvisi.

scons will now build the cookbook as parts of a docs build.
Also in reposnse to :
scons cookbook_pdf


1 ksteube 1811
2     ########################################################
3 cochrane 369 #
4 jfenwick 2548 # Copyright (c) 2003-2009 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 2667 example_deps = ['cookbook/cblib.py', 'cookbook/heatrefraction_mesher001.py',
19     'cookbook/heatrefraction_mesher002.py',
20     'cookbook/heatrefraction001.py',
21     'cookbook/heatrefraction002.py'
22     ]
23 jfenwick 2648
24 gross 2502 #
25     # these are the release examples in example sub directory:
26     #
27     example_files_allow_mpi = [
28     'geotutorial/steadystate_variablek.py',
29     'geotutorial/steadystate.py',
30     'geotutorial/forward_euler.py',
31     'geotutorial/myfirstscript.py',
32     'geotutorial/backward_euler.py',
33     'usersguide/lit_driven_cavity.py',
34     'usersguide/mount.py',
35     'usersguide/heatedblock.py',
36     'usersguide/helmholtz.py',
37     'usersguide/fluid.py',
38     'usersguide/poisson.py',
39     'usersguide/diffusion.py',
40 gross 2655 'usersguide/poisson_vtk.py',
41 gross 2654 'usersguide/slip.py'
42 gross 2502 ]
43 cochrane 369
44 gross 2574 example_files_no_mpi = [
45     ]
46 gross 2502
47 jfenwick 2667 haveGMSH=(os.system("gmsh -version")/256==0) #Do we have gmsh installed?
48     haveMPL=False #Do we have matplotlib?
49     haveGD=False #Does the matplotlib have griddata?
50 jfenwick 2578 try:
51 jfenwick 2667 import matplotlib
52     haveMPL=True
53 jfenwick 2648 from matplotlib.mlab import griddata
54 jfenwick 2667 haveGD=True
55 jfenwick 2578 except ImportError:
56 jfenwick 2667 pass
57 jfenwick 2578
58 jfenwick 2667 if not haveMPL:
59     print "matplotlib not found skipping some tests"
60     else:
61     if not haveGD:
62     print "matplotlib found but griddata not provided"
63    
64     if not haveGMSH:
65     print "gmsh not found"
66    
67     example_files_no_mpi.append('cookbook/onedheatdiff.py')
68     example_files_no_mpi.append('cookbook/onedheatdiff_var001.py')
69     example_files_no_mpi.append('cookbook/sandbox.py')
70     example_files_no_mpi.append('cookbook/twodheatdiff.py')
71     example_files_no_mpi.append('cookbook/wavesolver2d001.py')
72     example_files_no_mpi.append('cookbook/wavesolver2d002.py')
73    
74    
75     if haveMPL:
76     example_files_no_mpi.append('cookbook/onedheatdiff001.py')
77     example_files_no_mpi.append('cookbook/onedheatdiff002.py')
78     if haveGD:
79     example_files_no_mpi.append('cookbook/twodheatdiff001.py')
80     example_files_no_mpi.append('usersguide/poisson_matplotlib.py')
81     example_files_allow_mpi.append('usersguide/wave.py')
82     if haveGMSH:
83     example_files_no_mpi.append('cookbook/run_heatrefraction.py')
84    
85     # we want to make sure these are still added to the examples bundle even if we can't run them
86     if not haveGMSH:
87     example_deps.append('cookbook/run_heatrefraction.py')
88     if not haveGD:
89     example_deps.append('cookbook/twodheatdiff001.py')
90     example_deps.append('usersguide/poisson_matplotlib.py')
91     example_deps.append('usersguide/wave.py')
92     if not haveMPL:
93     example_deps.append('cookbook/onedheatdiff001.py')
94     example_deps.append('cookbook/onedheatdiff002.py')
95    
96    
97 jfenwick 2648 example_files= example_files_allow_mpi + example_files_no_mpi + example_deps
98 gross 2502
99 jfenwick 2503
100     ex2=[ os.path.join("examples",str(x)) for x in example_files]
101    
102 gross 2502 #==========================================================================================
103    
104 ksteube 1705 local_env = clone_env(env)
105 jfenwick 2402 src_dir = local_env.Dir('.').srcnode().abspath
106 gross 2502 release_dir=local_env.Dir('#/release/doc/').srcnode().abspath
107 ksteube 1215
108 jfenwick 2402 tmp1 = env.Command("#/release/doc/escript_examples.zip", None,
109 jfenwick 2503 "zip "+os.path.join(release_dir,"escript_examples.zip ") +" ".join(ex2),chdir=src_dir)
110 ksteube 2091 env.Alias('examples_zipfile', tmp1)
111 ksteube 1215
112 ksteube 1705
113 jfenwick 2405 #Need to use explicit tar rather than the tar builder due to problems getting it not to put
114     #unwanted path components in the tar file
115     #--transform on tar is not supported on savanna
116 jfenwick 2503 tmp2 = env.Command("#/release/doc/escript_examples.tar.gz", None, "tar -czf "+os.path.join(release_dir,"escript_examples.tar.gz ")+" ".join(ex2), chdir=src_dir)
117 jfenwick 2405 env.Alias('examples_tarfile',tmp2)
118    
119     #env=Environment(TARFLAGS = "-c -z",chdir=src_dir)
120     #if 'Tar' in dir(env): env.Tar('#/release/doc/escript_examples.tar.gz', example_files,chdir=src_dir)
121     #env.Alias('examples_tarfile', '#release/doc/escript_examples.tar.gz')
122    
123 jfenwick 2667 local_env.SConscript(dirs = ['#/doc/cookbook'], build_dir='#/build/$PLATFORM/doc/cookbook', duplicate=1)
124 gross 707 local_env.SConscript(dirs = ['#/doc/user'], build_dir='#/build/$PLATFORM/doc/user', duplicate=1)
125 elspeth 712 local_env.SConscript(dirs = ['#/doc/epydoc'], build_dir='#/build/$PLATFORM/doc/epydoc', duplicate=1)
126 ksteube 1215 local_env.SConscript(dirs = ['#/doc/doxygen'], build_dir='#/build/$PLATFORM/doc/doxygen', duplicate=1)
127 jfenwick 2287 local_env.SConscript(dirs = ['#/doc/install'], build_dir='#/build/$PLATFORM/doc/install', duplicate=1)
128 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' ])
129 ksteube 1705
130 jfenwick 2402

  ViewVC Help
Powered by ViewVC 1.1.26