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

Contents of /branches/domexper/doc/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3119 - (show annotations)
Mon Aug 30 05:09:28 2010 UTC (8 years, 9 months ago) by jfenwick
File size: 5937 byte(s)
Fixed more problems
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
15 import os
16 Import('*')
17
18
19 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
23 mplmagicversion='0.98.5'
24
25 try:
26 import matplotlib
27 haveMPL=True
28 mplversion=matplotlib.__version__
29 from matplotlib.mlab import griddata
30 haveGD=True
31 except ImportError:
32 pass
33
34 if not haveMPL:
35 print "matplotlib not found skipping some tests"
36 else:
37 if mplversion<mplmagicversion:
38 print "matplotlib found but version too early. Some tests skipped."
39
40 if not haveGMSH:
41 print "gmsh not found"
42
43 example_files_allow_mpi = [ ]
44 example_files_no_mpi = [ ]
45 example_deps = [ ]
46
47 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
52 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
65 sortOutExample( 'usersguide/lit_driven_cavity.py')
66 sortOutExample( 'usersguide/heatedblock.py')
67 sortOutExample( 'usersguide/helmholtz.py')
68 sortOutExample( 'usersguide/fluid.py')
69 sortOutExample( 'usersguide/poisson.py')
70 sortOutExample( 'usersguide/diffusion.py')
71 sortOutExample( 'usersguide/poisson_vtk.py')
72 sortOutExample( 'usersguide/slip.py')
73 sortOutExample( 'usersguide/int_save.py')
74 sortOutExample( 'usersguide/wave.py', needsMPL=True)
75 sortOutExample( 'usersguide/trapezoid.py', needsGMSH=True)
76 sortOutExample( 'usersguide/quad.py', needsGMSH=True)
77 sortOutExample( 'usersguide/brick.py', needsGMSH=True)
78 sortOutExample( 'usersguide/refine.py', needsGMSH=True)
79 sortOutExample( 'usersguide/poisson_matplotlib.py', needsGD=True, allowsMPI=False)
80
81 sortOutExample( 'geotutorial/steadystate_variablek.py')
82 sortOutExample( 'geotutorial/steadystate.py')
83 sortOutExample( 'geotutorial/forward_euler.py')
84 sortOutExample( 'geotutorial/myfirstscript.py')
85 sortOutExample( 'geotutorial/backward_euler.py')
86
87 example_deps.append('cookbook/cblib.py')
88 sortOutExample('cookbook/example01a.py')
89 sortOutExample('cookbook/example01b.py', needsMPL=True)
90 sortOutExample('cookbook/example01c.py', needsMPL=True, allowsMPI=False)
91 sortOutExample('cookbook/example02.py', needsMPL=True, allowsMPI=False)
92 sortOutExample('cookbook/example03a.py', needsGD=True, allowsMPI=False)
93 sortOutExample('cookbook/example03b.py')
94 sortOutExample('cookbook/example04a.py', needsGMSH=True)
95 sortOutExample('cookbook/example04b.py', needsGMSH=True, needsGD=True)
96 sortOutExample('cookbook/example05a.py', needsGMSH=True, needsGD=True)
97 sortOutExample('cookbook/example05b.py', needsGMSH=True, needsGD=True)
98 sortOutExample('cookbook/example05c.py', needsGMSH=True, needsGD=True, needsMagicMPL=True)
99 sortOutExample('cookbook/example06.py', needsGMSH=True, needsGD=True, needsMagicMPL=True)
100
101 example_files= example_files_allow_mpi + example_files_no_mpi + example_deps
102
103
104 ex2=[ os.path.join("examples",str(x)) for x in example_files]
105
106 #==========================================================================================
107
108 local_env = clone_env(env)
109 src_dir = local_env.Dir('.').srcnode().abspath
110 release_dir=local_env.Dir('#/release/doc/').srcnode().abspath
111
112 dir_cmd = "cd "+src_dir+" && "
113
114 tmp1 = local_env.Command("#/release/doc/escript_examples.zip", None,
115 dir_cmd+"zip "+os.path.join(release_dir,"escript_examples.zip ") +" ".join(ex2),
116 #chdir=src_dir
117 )
118 env.Alias('examples_zipfile', tmp1)
119
120
121 #Need to use explicit tar rather than the tar builder due to problems getting it not to put
122 #unwanted path components in the tar file
123 #--transform on tar is not supported on savanna
124 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),
125 # chdir=src_dir
126 )
127 env.Alias('examples_tarfile',tmp2)
128
129 #env=Environment(TARFLAGS = "-c -z",chdir=src_dir)
130 #if 'Tar' in dir(env): env.Tar('#/release/doc/escript_examples.tar.gz', example_files,chdir=src_dir)
131 #env.Alias('examples_tarfile', '#release/doc/escript_examples.tar.gz')
132
133 CallSConscript(local_env, dirs = ['#/doc/cookbook'], variant_dir='#/build/$PLATFORM/doc/cookbook', duplicate=1)
134 CallSConscript(local_env, dirs = ['#/doc/user'], variant_dir='#/build/$PLATFORM/doc/user', duplicate=1)
135 CallSConscript(local_env, dirs = ['#/doc/epydoc'], variant_dir='#/build/$PLATFORM/doc/epydoc', duplicate=1)
136 CallSConscript(local_env, dirs = ['#/doc/doxygen'], variant_dir='#/build/$PLATFORM/doc/doxygen', duplicate=1)
137 CallSConscript(local_env, dirs = ['#/doc/install'], variant_dir='#/build/$PLATFORM/doc/install', duplicate=1)
138
139
140 #For some reason my CallSConscript wrapper fails when you want to use the exports= keyword
141 if cantusevariantdir:
142 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' ])
143 else:
144 local_env.SConscript(dirs = ['#/doc/examples'], variant_dir='#/build/$PLATFORM/doc/examples', duplicate=1, exports=[ 'example_files_allow_mpi' , 'example_files_no_mpi', 'example_deps' ])

  ViewVC Help
Powered by ViewVC 1.1.26