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

Diff of /trunk/doc/SConscript

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

revision 1133 by gross, Tue May 8 07:19:33 2007 UTC revision 2674 by jfenwick, Mon Sep 21 00:37:18 2009 UTC
# Line 1  Line 1 
 # Scons configuration file for documentation  
1    
2  #          Copyright 2006 by ACcESS MNRF                    ########################################################
 #                                                            
 #              http://www.access.edu.au                      
 #       Primary Business: Queensland, Australia              
 #  Licensed under the Open Software License version 3.0      
 #     http://www.opensource.org/licenses/osl-3.0.php        
 #                                                            
3  #  #
4    # Copyright (c) 2003-2009 by University of Queensland
5    # Earth Systems Science Computational Center (ESSCC)
6    # http://www.uq.edu.au/esscc
7  #  #
8  # set appropriate defaults for configuration variables  # 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  import os
16  Import('*')  Import('*')
17    
18  local_env=env.Copy()  example_deps = ['cookbook/cblib.py', 'cookbook/heatrefraction_mesher001.py',
19      'cookbook/heatrefraction_mesher002.py',
20      'cookbook/heatrefraction001.py',
21      'cookbook/heatrefraction002.py'
22    ]
23    
24    #
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     'usersguide/poisson_vtk.py',
41     'usersguide/slip.py'
42    ]
43    
44    example_files_no_mpi = [
45    ]
46    
47    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    
51    mplmagicversion='0.98.5'
52    
 # get all the examples:  
 src_dir = local_env.Dir('examples').srcnode().abspath  
 example_files=[]  
 for x in os.listdir(src_dir):  
    if not x.startswith("."):  
       f = "examples/"+x  
       if os.path.isdir(src_dir+'/'+f):  
          example_files+=[ env.File(f+"/"+y) for y in os.listdir(src_dir+'/'+f) if not y.startswith('.')]  
       else:  
          example_files+=[ env.File(f) ]  
 env.Zip(examples_zipfile, example_files)  
53  try:  try:
54    env.Tar(examples_tarfile, example_files)     import matplotlib
55  except AttributeError:     haveMPL=True
56    pass     mplversion=matplotlib.__version__
57  # Call the doc build using SConscript     from matplotlib.mlab import griddata
58  local_env.SConscript(dirs = ['#/doc/user'], build_dir='#/build/$PLATFORM/doc/user', duplicate=1)     haveGD=True
59    except ImportError:
60       pass
61    
62    if not haveMPL:
63       print "matplotlib not found skipping some tests"
64    else:
65       if mplversion<mplmagicversion:
66        print "matplotlib found but version too early. Some tests skipped."
67    
68    if not haveGMSH:
69       print "gmsh not found"
70    
71    example_files_no_mpi.append('cookbook/onedheatdiff.py')
72    example_files_no_mpi.append('cookbook/onedheatdiff_var001.py')
73    example_files_no_mpi.append('cookbook/sandbox.py')
74    example_files_no_mpi.append('cookbook/twodheatdiff.py')
75    example_files_no_mpi.append('cookbook/wavesolver2d001.py')
76    example_files_no_mpi.append('cookbook/wavesolver2d002.py')
77    
78    
79    if haveMPL:
80       example_files_no_mpi.append('cookbook/onedheatdiff001.py')
81       example_files_no_mpi.append('cookbook/onedheatdiff002.py')
82       if mplversion>=mplmagicversion:
83        example_files_no_mpi.append('cookbook/twodheatdiff001.py')
84        example_files_no_mpi.append('usersguide/poisson_matplotlib.py')
85        example_files_allow_mpi.append('usersguide/wave.py')
86        if haveGMSH:
87            example_files_no_mpi.append('cookbook/run_heatrefraction.py')
88    
89    # we want to make sure these are still added to the examples bundle even if we can't run them
90    if not haveGMSH:
91       example_deps.append('cookbook/run_heatrefraction.py')
92    if not haveGD:
93       example_deps.append('cookbook/twodheatdiff001.py')
94       example_deps.append('usersguide/poisson_matplotlib.py')
95       example_deps.append('usersguide/wave.py')
96    if not haveMPL:
97       example_deps.append('cookbook/onedheatdiff001.py')
98       example_deps.append('cookbook/onedheatdiff002.py')
99    
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    tmp1 = env.Command("#/release/doc/escript_examples.zip", None,
113    "zip "+os.path.join(release_dir,"escript_examples.zip ") +" ".join(ex2),chdir=src_dir)
114    env.Alias('examples_zipfile', tmp1)
115    
116    
117    #Need to use explicit tar rather than the tar builder due to problems getting it not to put
118    #unwanted path components in the tar file
119    #--transform on tar is not supported on savanna
120    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)
121    env.Alias('examples_tarfile',tmp2)
122    
123    #env=Environment(TARFLAGS = "-c -z",chdir=src_dir)
124    #if 'Tar' in dir(env): env.Tar('#/release/doc/escript_examples.tar.gz', example_files,chdir=src_dir)
125    #env.Alias('examples_tarfile', '#release/doc/escript_examples.tar.gz')
126    
127    local_env.SConscript(dirs = ['#/doc/cookbook'], build_dir='#/build/$PLATFORM/doc/cookbook', duplicate=1)
128    local_env.SConscript(dirs = ['#/doc/user'], build_dir='#/build/$PLATFORM/doc/user', duplicate=1)
129  local_env.SConscript(dirs = ['#/doc/epydoc'], build_dir='#/build/$PLATFORM/doc/epydoc', duplicate=1)  local_env.SConscript(dirs = ['#/doc/epydoc'], build_dir='#/build/$PLATFORM/doc/epydoc', duplicate=1)
130    local_env.SConscript(dirs = ['#/doc/doxygen'], build_dir='#/build/$PLATFORM/doc/doxygen', duplicate=1)
131    local_env.SConscript(dirs = ['#/doc/install'], build_dir='#/build/$PLATFORM/doc/install', duplicate=1)
132    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' ])
133    
134    

Legend:
Removed from v.1133  
changed lines
  Added in v.2674

  ViewVC Help
Powered by ViewVC 1.1.26