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

Diff of /trunk/doc/SConscript

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2655 by gross, Tue Sep 8 23:31:32 2009 UTC revision 3208 by jfenwick, Sun Sep 26 23:31:17 2010 UTC
# Line 1  Line 1 
1    
2  ########################################################  ########################################################
3  #  #
4  # Copyright (c) 2003-2009 by University of Queensland  # Copyright (c) 2003-2010 by University of Queensland
5  # Earth Systems Science Computational Center (ESSCC)  # Earth Systems Science Computational Center (ESSCC)
6  # http://www.uq.edu.au/esscc  # http://www.uq.edu.au/esscc
7  #  #
# Line 15  Line 15 
15  import os  import os
16  Import('*')  Import('*')
17    
 example_deps = ['cookbook/cblib.py']  
18    
19  #  haveGMSH=(os.system("gmsh -version")/256==0)    #Do we have gmsh installed?
20  # these are the release examples in example sub directory:  haveMPL=False                   #Do we have matplotlib?
21  #  haveGD=False                    #Does the matplotlib have griddata?
 example_files_allow_mpi = [  
  'geotutorial/steadystate_variablek.py',  
  'geotutorial/steadystate.py',  
  'geotutorial/forward_euler.py',  
  'geotutorial/myfirstscript.py',  
  'geotutorial/backward_euler.py',  
  'usersguide/lit_driven_cavity.py',  
  'usersguide/mount.py',  
  'usersguide/heatedblock.py',  
  'usersguide/helmholtz.py',  
  'usersguide/fluid.py',  
  'usersguide/poisson.py',  
  'usersguide/diffusion.py',  
  'usersguide/poisson_vtk.py',  
  'usersguide/slip.py'  
 ]  
22    
23  example_files_no_mpi = [  mplmagicversion='0.98.5'
 ]  
24    
 #Now we add tests which depend on matplotlib  
25  try:  try:
26       import matplotlib
27       haveMPL=True
28       mplversion=matplotlib.__version__
29     from matplotlib.mlab import griddata     from matplotlib.mlab import griddata
30     example_files_no_mpi.append('usersguide/poisson_matplotlib.py')     haveGD=True
    example_files_allow_mpi.append('usersguide/wave.py')  
 #   example_deps.append('cookbook/heatrefraction_mesher001.py')  
 #   example_deps.append('cookbook/heatrefraction_mesher002.py')  
 #   example_deps.append('cookbook/heatrefraction001.py')  
 #   example_deps.append('cookbook/heatrefraction002.py')  
 #   example_files_no_mpi.append('cookbook/onedheatdiff001.py')  
 #   example_files_no_mpi.append('cookbook/onedheatdiff002.py')  
 #   example_files_no_mpi.append('cookbook/twodheatdiff.py')  
    import os  
    if os.system("gmsh -version")/256 ==0:   #gmsh found on this system  
 #   example_files_no_mpi.append('cookbook/test_heatref.py')  
     pass  
    else:  
     print "gmsh not found skipping examples"  
31  except ImportError:  except ImportError:
32     print "matplotlib not found - skipping example"     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/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    sortOutExample('cookbook/example04a.py', needsGMSH=True)
96    sortOutExample('cookbook/example04b.py', needsGMSH=True, needsGD=True)
97    sortOutExample('cookbook/example05a.py', needsGMSH=True, needsGD=True)
98    sortOutExample('cookbook/example05b.py', needsGMSH=True, needsGD=True)
99    sortOutExample('cookbook/example05c.py', needsGMSH=True, needsGD=True, needsMagicMPL=True)
100    sortOutExample('cookbook/example06.py', needsGMSH=True, needsGD=True, needsMagicMPL=True)
101    sortOutExample('cookbook/example07a.py', needsMagicMPL=True, allowsMPI=False)
102    sortOutExample('cookbook/example07b.py', needsMagicMPL=True, allowsMPI=False)
103    sortOutExample('cookbook/example08a.py', needsMagicMPL=True, allowsMPI=False)
104    sortOutExample('cookbook/example08b.py', needsMagicMPL=True, allowsMPI=False)
105    sortOutExample('cookbook/example08c.py', needsMagicMPL=True, needsGMSH=True, allowsMPI=False)
106    #sortOutExample('cookbook/example09m.py', needsMagicMPL=True, needsGMSH=True, allowsMPI=False)
107    #sortOutExample('cookbook/example09a.py', needsMagicMPL=True, needsGMSH=True, allowsMPI=False)
108    #sortOutExample('cookbook/example09b.py', needsMagicMPL=True, needsGMSH=True, allowsMPI=False)
109    
110  example_files= example_files_allow_mpi + example_files_no_mpi + example_deps  example_files= example_files_allow_mpi + example_files_no_mpi + example_deps
111    
# Line 72  local_env = clone_env(env) Line 118  local_env = clone_env(env)
118  src_dir = local_env.Dir('.').srcnode().abspath  src_dir = local_env.Dir('.').srcnode().abspath
119  release_dir=local_env.Dir('#/release/doc/').srcnode().abspath  release_dir=local_env.Dir('#/release/doc/').srcnode().abspath
120    
121  tmp1 = env.Command("#/release/doc/escript_examples.zip", None,  dir_cmd = "cd "+src_dir+" && "
122  "zip "+os.path.join(release_dir,"escript_examples.zip ") +" ".join(ex2),chdir=src_dir)  
123    tmp1 = local_env.Command("#/release/doc/escript_examples.zip", None,
124    dir_cmd+"zip "+os.path.join(release_dir,"escript_examples.zip ") +" ".join(ex2),
125    #chdir=src_dir
126    )
127  env.Alias('examples_zipfile', tmp1)  env.Alias('examples_zipfile', tmp1)
128    
129    
130  #Need to use explicit tar rather than the tar builder due to problems getting it not to put  #Need to use explicit tar rather than the tar builder due to problems getting it not to put
131  #unwanted path components in the tar file  #unwanted path components in the tar file
132  #--transform on tar is not supported on savanna  #--transform on tar is not supported on savanna
133  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)  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),
134    # chdir=src_dir
135    )
136  env.Alias('examples_tarfile',tmp2)  env.Alias('examples_tarfile',tmp2)
137    
138  #env=Environment(TARFLAGS = "-c -z",chdir=src_dir)  #env=Environment(TARFLAGS = "-c -z",chdir=src_dir)
139  #if 'Tar' in dir(env): env.Tar('#/release/doc/escript_examples.tar.gz', example_files,chdir=src_dir)  #if 'Tar' in dir(env): env.Tar('#/release/doc/escript_examples.tar.gz', example_files,chdir=src_dir)
140  #env.Alias('examples_tarfile', '#release/doc/escript_examples.tar.gz')  #env.Alias('examples_tarfile', '#release/doc/escript_examples.tar.gz')
141    
142  local_env.SConscript(dirs = ['#/doc/user'], build_dir='#/build/$PLATFORM/doc/user', duplicate=1)  CallSConscript(local_env, dirs = ['#/doc/cookbook'], variant_dir='#/build/$PLATFORM/doc/cookbook', duplicate=1)
143  local_env.SConscript(dirs = ['#/doc/epydoc'], build_dir='#/build/$PLATFORM/doc/epydoc', duplicate=1)  CallSConscript(local_env, dirs = ['#/doc/user'], variant_dir='#/build/$PLATFORM/doc/user', duplicate=1)
144  local_env.SConscript(dirs = ['#/doc/doxygen'], build_dir='#/build/$PLATFORM/doc/doxygen', duplicate=1)  CallSConscript(local_env, dirs = ['#/doc/epydoc'], variant_dir='#/build/$PLATFORM/doc/epydoc', duplicate=1)
145  local_env.SConscript(dirs = ['#/doc/install'], build_dir='#/build/$PLATFORM/doc/install', duplicate=1)  CallSConscript(local_env, dirs = ['#/doc/doxygen'], variant_dir='#/build/$PLATFORM/doc/doxygen', duplicate=1)
146  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' ])  CallSConscript(local_env, dirs = ['#/doc/install'], variant_dir='#/build/$PLATFORM/doc/install', duplicate=1)
147    
148    
149    #For some reason my CallSConscript wrapper fails when you want to use the exports= keyword
150    if cantusevariantdir:
151        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' ])
152    else:
153        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' ])

Legend:
Removed from v.2655  
changed lines
  Added in v.3208

  ViewVC Help
Powered by ViewVC 1.1.26