visit-windows-dist 7.14 KB
Newer Older
hrchilds's avatar
hrchilds committed
1 2 3
#!/bin/csh -f
#-----------------------------------------------------------------------
#
hrchilds's avatar
hrchilds committed
4 5
# VISIT-WINDOWS-DIST - Build a tar file that contains the VisIt source
#                      code and Windows project files.
hrchilds's avatar
hrchilds committed
6 7 8 9 10 11 12 13 14 15 16 17
#
# Author: Brad Whitlock
# Date:   Fri Jul 5 14:34:16 PST 2002
#
# Usage:
#    visit-windows-dist 
#
#
# Modifications:
#   Brad Whitlock, Mon Jul 15 15:29:37 PST 2002
#   I made it distribute help files.
#
hrchilds's avatar
hrchilds committed
18 19 20 21 22
#   Brad Whitlock, Wed Dec 10 09:32:39 PDT 2003
#   I rewrote it so it includes more recent project files and installtion
#   files. It also puts the core header files into a single include directory
#   so you don't have to add tons of include directories in MSVC.
#
hrchilds's avatar
hrchilds committed
23 24 25
#   Brad Whitlock, Thu Jan 8 11:15:13 PDT 2004
#   I added BUILD_NOTES.txt.
#
hrchilds's avatar
hrchilds committed
26
#------------------------------------------------------------------------------
hrchilds's avatar
hrchilds committed
27 28 29 30 31 32 33 34 35 36

if(`pwd` != "/data_vobs/VisIt") then
    echo "The visit-windows-dist script must be run from the top level VOB directory."
    exit(-1)
endif

# Set some directory variables.
set TOPDIR = "/data_vobs/VisIt"
set SCRIPTDIR = "/data_vobs/VisIt/clearcase_bin"

hrchilds's avatar
hrchilds committed
37 38 39 40
set VERSION = `cat $TOPDIR/VERSION`
set VisItDev = "$TOPDIR/VisItDev$VERSION"
set VISITSRC="visit"

hrchilds's avatar
hrchilds committed
41
# Run the visit-dist script so it creates a source distribution
hrchilds's avatar
hrchilds committed
42 43
echo "Creating intermediate source package..."
$SCRIPTDIR/visit-dist -withhelp $VISITSRC
hrchilds's avatar
hrchilds committed
44

hrchilds's avatar
hrchilds committed
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
# Create a directory to contain the VisIt source distribution.
echo "Creating $VisItDev directory..."
mkdir $VisItDev
cp $VISITSRC.tar.gz $VisItDev
cd $VisItDev

# Put the source into the development directory.
echo "Untarring intermediate source package..."
gunzip $VISITSRC.tar.gz
tar xvf $VISITSRC.tar > /dev/null
rm $VISITSRC.tar

# Remove the tools/mpeg_encode directory since it does not build on Windows
# and it creates a name conflict with the prep tool.
rm -rf $VISITSRC/tools/mpeg_encode

# Remove the $VISITSRC/include/visit directory since it's full of symlinks and Windows
# will not honor them.
echo "Removing old visit include directory..."
rm -rf $VISITSRC/include/visit

# Copy windowsbuild/VisItBuildInstructionsOnWindows.doc to $VisItDev
cp $TOPDIR/windowsbuild/VisItBuildInstructionsOnWindows.doc .
hrchilds's avatar
hrchilds committed
68
cp $TOPDIR/windowsbuild/BUILD_NOTES.txt .
hrchilds's avatar
hrchilds committed
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153

# Move windowsbuild/include to $VisItDev/include.
cp -R $TOPDIR/windowsbuild/include .

#
# Move a bunch of the core header files to the new visit directory
#
echo "Creating new visit include directory..."
mkdir include/VisIt
foreach srcdir (common components gui viewer engine mdserver launcher visitpy visit_vtk vtkqt)
    foreach srcfile (`find $VISITSRC/$srcdir -name "*.h"`)
        mv $srcfile include/VisIt
    end
end

#
# Remove SiloObj's Field.h since it will mess up the build for the XML tools.
#
rm -f include/VisIt/Field.h

#
# Copy the XPM files into include/VisIt and remove the copy directories that
# used to be symlinks to common/icons. Also, since the GUI and viewer seem
# to reference the icons using slightly different directory schemes, we
# have to duplicate them for now. The source code should probably be fixed
# at some point so it references the XPM files consistently so we can
# remove the need to duplicate the XPM files like this.
#
echo "Copying icons to include/VisIt..."
mkdir include/VisIt/icons
foreach xpmfile (`find $VISITSRC/common/icons -name "*.xpm"`)
    cp $xpmfile include/VisIt
    mv $xpmfile include/VisIt/icons
end
rm -rf $VISITSRC/gui/icons
rm -rf $VISITSRC/viewer/main/icons

# Replace the version in visit-config.h with the current version and move
# visit-config.h into the include/visit directory
sed -e "s/XXX/$VERSION/" include/visit-config.h > include/VisIt/visit-config.h
rm -f include/visit-config.h

echo "Copying tool include files to include/Tools...".
# Move a bunch of the tool header files to the new tool directory
mkdir include/Tools
foreach tooldir (qtssh silex xml xmledit)
    foreach hdrfile (`find $VISITSRC/tools/$tooldir -name "*.h"`)
        mv $hdrfile include/Tools
    end
end

#
# Put the VTK header files into include/VTK
#
echo "Copying VTK include files to include/VTK..."
foreach hdrdir (Common Filtering Graphics Hybrid IO Imaging Rendering)
    foreach hdrfile (`find $TOPDIR/include/vtk/$hdrdir -name "*.h"`)
        cp $hdrfile include/VTK
    end
end
mkdir include/VTK/MangleMesaInclude
cp $TOPDIR/include/vtk/MangleMesaInclude/*.h include/VTK/MangleMesaInclude

#
# Copy the vtkCamera.h header from include/visit to include/VTK since
# our vtkCamera was built into VTK on Windows.
#
rm -f include/VTK/vtkCamera.h
mv include/VisIt/vtkCamera.h include/VTK

#
# Create an include/Python directory and copy the Python headers to it.
#
echo "Copying Python include files to include/Python..."
cp -R $TOPDIR/include/Python include

#
# Create an include/Mesa directory and copy the Mesa files to it.
#
echo "Copying Mesa include files to include/Mesa..."
mkdir include/Mesa
mkdir include/Mesa/GL
cp $TOPDIR/include/mesa/GL/*.h include/Mesa/GL

cd $VisItDev
hrchilds's avatar
hrchilds committed
154

hrchilds's avatar
hrchilds committed
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
#
# Move windowsbuild/bin up to $VisItDev and add the plugin directories into
# it so that we have some place to store them when we build.
#
echo "Creating bin directory..."
cp -R $TOPDIR/windowsbuild/bin .
foreach configdir (Debug Release)
    # Copy the makemovie script to the right bin dir.
    cp $VISITSRC/bin/makemovie.py bin/$configdir
    # Copy the host config files to the right bin dir.
    cp $VISITSRC/clearcase_bin/visit-config-open   bin/$configdir
    cp $VISITSRC/clearcase_bin/visit-config-closed bin/$configdir
    mkdir bin/$configdir/help
    cp $VISITSRC/help/*.{html,helpml} bin/$configdir/help
    mkdir bin/$configdir/databases
    mkdir bin/$configdir/operators
    mkdir bin/$configdir/plots
    # Create small placeholder files or the directory will not be preserved
    # when extracting the distribution since empty directories tend to be
    # removed on Windows.
    echo "Directory for database plugins." > bin/$configdir/databases/README.txt
    echo "Directory for operator plugins." > bin/$configdir/operators/README.txt
    echo "Directory for plot plugins." > bin/$configdir/plots/README.txt
end

# Unzip the Python tar file in bin/Release so we have Python modules available
# when we try to distribute VisIt on Windows.
cd bin/Release
gunzip PythonModules.tar.gz
tar xvf PythonModules.tar
rm -f PythonModules.tar
cd $VisItDev

# Remove the help files since we've copied them into different directories.
rm $VISITSRC/help/*.{html,helpml}

# Move windowsbuild/lib directory up to $VisItDev.
echo "Creating lib directory..."
cp -R $TOPDIR/windowsbuild/lib .

# Move windowsbuild/resources directory up to $VisItDev.
echo "Creating resources directory..."
cp -R $TOPDIR/windowsbuild/resources .

# Move windowsbuild/installation directory up to $VisItDev.
echo "Creating installation directory..."
cp -R $TOPDIR/windowsbuild/installation .

# Move the windowsbuild/projects directory up to $VisItDev.
echo "Creating projects directory..."
cp -R $TOPDIR/windowsbuild/projects .

# Copy the windowsbuild/script directory up to $VisItDev.
echo "Creating script directory..."
cp -R $TOPDIR/windowsbuild/script .

# Create the new distribution
echo "Creating tar file distribution..."
cd $TOPDIR
set VisItDev = "VisItDev$VERSION"
tar cf $VisItDev.tar $VisItDev
hrchilds's avatar
hrchilds committed
216 217

# Cleanup
hrchilds's avatar
hrchilds committed
218 219
echo "Cleaning up..."
rm -rf $VisItDev