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

Diff of /branches/domexper/doc/SConscript

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

revision 2502 by gross, Tue Jun 30 05:49:22 2009 UTC revision 2974 by artak, Thu Mar 4 03:09:35 2010 UTC
# Line 1  Line 1 
1    
2  ########################################################  ########################################################
3  #  #
4  # Copyright (c) 2003-2008 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 14  Line 14 
14    
15  import os  import os
16  Import('*')  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:  # these are the release examples in example sub directory:
61  #  #
62  example_files_allow_mpi = [  #_deps is for files which end in .py and are required for
63   'geotutorial/steadystate_variablek.py',  # testing but should not be invoked directly themselves
64   'geotutorial/steadystate.py',  
65   'geotutorial/forward_euler.py',  sortOutExample( 'usersguide/lit_driven_cavity.py')
66   'geotutorial/myfirstscript.py',  sortOutExample( 'usersguide/mount.py')
67   'geotutorial/backward_euler.py',  sortOutExample( 'usersguide/heatedblock.py')
68   'usersguide/lit_driven_cavity.py',  sortOutExample( 'usersguide/helmholtz.py')
69   'usersguide/mount.py',  sortOutExample( 'usersguide/fluid.py')
70   'usersguide/wave.py',  sortOutExample( 'usersguide/poisson.py')
71   'usersguide/heatedblock.py',  sortOutExample( 'usersguide/diffusion.py')
72   'usersguide/helmholtz.py',  sortOutExample( 'usersguide/poisson_vtk.py')
73   'usersguide/fluid.py',  sortOutExample( 'usersguide/slip.py')
74   'usersguide/poisson.py',  sortOutExample( 'usersguide/int_save.py')
75   'usersguide/diffusion.py',  sortOutExample( 'usersguide/wave.py', needsMPL=True)
76  ]  sortOutExample( 'usersguide/trapezoid.py', needsGMSH=True)
77    sortOutExample( 'usersguide/quad.py', needsGMSH=True)
78  example_files_no_mpi = [  sortOutExample( 'usersguide/brick.py', needsGMSH=True)
79   'pyvisi/poisson_with_pyvisi.py',  sortOutExample( 'usersguide/refine.py', needsGMSH=True)
80   'pyvisi/streamline.py',  sortOutExample( 'usersguide/poisson_matplotlib.py',  needsGD=True, allowsMPI=False)
81   'pyvisi/legend.py',  
82   'pyvisi/data_sample_images/image.jpg',  sortOutExample( 'geotutorial/steadystate_variablek.py')
83   'pyvisi/data_sample_images/wave00.jpg',  sortOutExample( 'geotutorial/steadystate.py')
84   'pyvisi/data_sample_images/seriesofcuts04.jpg',  sortOutExample( 'geotutorial/forward_euler.py')
85   'pyvisi/data_sample_images/movie000943.jpg',  sortOutExample( 'geotutorial/myfirstscript.py')
86   'pyvisi/data_sample_images/seriesofreads0102.jpg',  sortOutExample( 'geotutorial/backward_euler.py')
87   'pyvisi/data_sample_images/text.jpg',  
88   'pyvisi/data_sample_images/map.jpg',  example_deps.append('cookbook/cblib.py')
89   'pyvisi/data_sample_images/seriesofcuts02.jpg',  sortOutExample('cookbook/example01a.py')
90   'pyvisi/data_sample_images/diffusion02.jpg',  sortOutExample('cookbook/example01b.py', needsMPL=True)
91   'pyvisi/data_sample_images/movie000941.jpg',  sortOutExample('cookbook/example01c.py', needsMPL=True, allowsMPI=False)
92   'pyvisi/data_sample_images/rectangle.jpg',  sortOutExample('cookbook/example02.py', needsMPL=True, allowsMPI=False)
93   'pyvisi/data_sample_images/seriesofreads0103.jpg',  sortOutExample('cookbook/example03a.py', needsGD=True, allowsMPI=False)
94   'pyvisi/data_sample_images/movie000940.jpg',  sortOutExample('cookbook/example03b.py')
95   'pyvisi/data_sample_images/diffusion04.jpg',  sortOutExample('cookbook/example04a.py', needsGMSH=True)
96   'pyvisi/data_sample_images/legend.jpg',  sortOutExample('cookbook/example04b.py', needsGMSH=True, needsGD=True)
97   'pyvisi/data_sample_images/carpet.jpg',  sortOutExample('cookbook/example05a.py', needsGMSH=True, needsGD=True)
98   'pyvisi/data_sample_images/diffusion01.jpg',  sortOutExample('cookbook/example05b.py', needsGMSH=True, needsGD=True)
99   'pyvisi/data_sample_images/poisson.jpg',  sortOutExample('cookbook/example05c.py', needsGMSH=True, needsGD=True, needsMagicMPL=True)
100   'pyvisi/data_sample_images/diffusion03.jpg',  sortOutExample('cookbook/example06.py', needsGMSH=True, needsGD=True, needsMagicMPL=True)
  'pyvisi/data_sample_images/velocity.jpg',  
  'pyvisi/data_sample_images/movie000946.jpg',  
  'pyvisi/data_sample_images/movie000945.jpg',  
  'pyvisi/data_sample_images/all.jpg',  
  'pyvisi/data_sample_images/movie000942.jpg',  
  'pyvisi/data_sample_images/seriesofcuts03.jpg',  
  'pyvisi/data_sample_images/streamline.jpg',  
  'pyvisi/data_sample_images/seriesofcuts01.jpg',  
  'pyvisi/data_sample_images/wave02.jpg',  
  'pyvisi/data_sample_images/ellipsoid.jpg',  
  'pyvisi/data_sample_images/seriesofreads0100.jpg',  
  'pyvisi/data_sample_images/seriesofreads0099.jpg',  
  'pyvisi/data_sample_images/movie.mpg',  
  'pyvisi/data_sample_images/movie000947.jpg',  
  'pyvisi/data_sample_images/logo.jpg',  
  'pyvisi/data_sample_images/heatedblock.jpg',  
  'pyvisi/data_sample_images/contour.jpg',  
  'pyvisi/data_sample_images/seriesofreads0101.jpg',  
  'pyvisi/data_sample_images/movie000948.jpg',  
  'pyvisi/data_sample_images/maponscalarclipwithrotation.jpg',  
  'pyvisi/data_sample_images/movie000938.jpg',  
  'pyvisi/data_sample_images/movie000944.jpg',  
  'pyvisi/data_sample_images/wave01.jpg',  
  'pyvisi/data_sample_images/movie000939.jpg',  
  'pyvisi/data_sample_images/helmholtz.jpg',  
  'pyvisi/data_sample_images/seriesofcuts00.jpg',  
  'pyvisi/text.py',  
  'pyvisi/wave_with_pyvisi.py',  
  'pyvisi/data_meshes/tempvel-000942.vtu',  
  'pyvisi/data_meshes/tempvel-000943.vtu',  
  'pyvisi/data_meshes/interior_3D.xml',  
  'pyvisi/data_meshes/tempvel-000947.vtu',  
  'pyvisi/data_meshes/without_st.0700.xml',  
  'pyvisi/data_meshes/tempvel-000940.vtu',  
  'pyvisi/data_meshes/access_logo.jpg',  
  'pyvisi/data_meshes/phi_talus_lava.0101.vtu',  
  'pyvisi/data_meshes/phi_talus_lava.0099.vtu',  
  'pyvisi/data_meshes/tempvel-000945.vtu',  
  'pyvisi/data_meshes/tempvel-000944.vtu',  
  'pyvisi/data_meshes/phi_talus_lava.0103.vtu',  
  'pyvisi/data_meshes/tempvel-000938.vtu',  
  'pyvisi/data_meshes/flinders.jpg',  
  'pyvisi/data_meshes/phi_talus_lava.0102.vtu',  
  'pyvisi/data_meshes/tempvel-000941.vtu',  
  'pyvisi/data_meshes/phi_talus_lava.0100.vtu',  
  'pyvisi/data_meshes/tempvel-000946.vtu',  
  'pyvisi/data_meshes/tempvel-000948.vtu',  
  'pyvisi/data_meshes/tempvel-000939.vtu',  
  'pyvisi/helmholtz_with_pyvisi.py',  
  'pyvisi/all.py',  
  'pyvisi/map.py',  
  'pyvisi/offscreen.py',  
  'pyvisi/logo.py',  
  'pyvisi/rectangle.py',  
  'pyvisi/diffusion_with_pyvisi.py',  
  'pyvisi/heatedblock_with_pyvisi.py',  
  'pyvisi/movie.py',  
  'pyvisi/seriesofcuts.py',  
  'pyvisi/velocityonplanecut.py',  
  'pyvisi/ellipsoidonplaneclip.py',  
  'pyvisi/maponscalarclipwithrotation.py',  
  'pyvisi/seriesofreads.py',  
  'pyvisi/contour.py',  
  'pyvisi/carpet.py',  
  'pyvisi/image.py'  
 ]  
101    
102  example_files= example_files_allow_mpi + example_files_no_mpi  example_files= example_files_allow_mpi + example_files_no_mpi + example_deps
103    
104    
105    ex2=[ os.path.join("examples",str(x)) for x in example_files]
106    
107  #==========================================================================================  #==========================================================================================
108    
# Line 131  local_env = clone_env(env) Line 110  local_env = clone_env(env)
110  src_dir = local_env.Dir('.').srcnode().abspath  src_dir = local_env.Dir('.').srcnode().abspath
111  release_dir=local_env.Dir('#/release/doc/').srcnode().abspath  release_dir=local_env.Dir('#/release/doc/').srcnode().abspath
112    
113  tmp1 = env.Command("#/release/doc/escript_examples.zip", None,  dir_cmd = "cd "+src_dir+" && "
114  "zip "+os.path.join(release_dir,"escript_examples.zip ") +" ".join(example_files),chdir=src_dir)  
115    tmp1 = local_env.Command("#/release/doc/escript_examples.zip", None,
116    dir_cmd+"zip "+os.path.join(release_dir,"escript_examples.zip ") +" ".join(ex2),
117    #chdir=src_dir
118    )
119  env.Alias('examples_zipfile', tmp1)  env.Alias('examples_zipfile', tmp1)
120    
121    
122  #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
123  #unwanted path components in the tar file  #unwanted path components in the tar file
124  #--transform on tar is not supported on savanna  #--transform on tar is not supported on savanna
125  tmp2 = env.Command("#/release/doc/escript_examples.tar.gz", None, "tar -czf "+os.path.join(release_dir,"escript_examples.tar.gz ")+"  ".join(example_files), 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),
126    # chdir=src_dir
127    )
128  env.Alias('examples_tarfile',tmp2)  env.Alias('examples_tarfile',tmp2)
129    
130  #env=Environment(TARFLAGS = "-c -z",chdir=src_dir)  #env=Environment(TARFLAGS = "-c -z",chdir=src_dir)
131  #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)
132  #env.Alias('examples_tarfile', '#release/doc/escript_examples.tar.gz')  #env.Alias('examples_tarfile', '#release/doc/escript_examples.tar.gz')
133    
134    local_env.SConscript(dirs = ['#/doc/cookbook'], build_dir='#/build/$PLATFORM/doc/cookbook', duplicate=1)
135  local_env.SConscript(dirs = ['#/doc/user'], build_dir='#/build/$PLATFORM/doc/user', duplicate=1)  local_env.SConscript(dirs = ['#/doc/user'], build_dir='#/build/$PLATFORM/doc/user', duplicate=1)
136  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)
137  local_env.SConscript(dirs = ['#/doc/doxygen'], build_dir='#/build/$PLATFORM/doc/doxygen', duplicate=1)  local_env.SConscript(dirs = ['#/doc/doxygen'], build_dir='#/build/$PLATFORM/doc/doxygen', duplicate=1)
138  local_env.SConscript(dirs = ['#/doc/install'], build_dir='#/build/$PLATFORM/doc/install', duplicate=1)  local_env.SConscript(dirs = ['#/doc/install'], build_dir='#/build/$PLATFORM/doc/install', duplicate=1)
139  local_env.SConscript(dirs = ['#/doc/examples'], build_dir='#/build/$PLATFORM/doc/examples', duplicate=1, exports=[ 'example_files_allow_mpi' , 'example_files_no_mpi' ])  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' ])
140    
141    

Legend:
Removed from v.2502  
changed lines
  Added in v.2974

  ViewVC Help
Powered by ViewVC 1.1.26