visit-build-closed 9.36 KB
Newer Older
hrchilds's avatar
hrchilds committed
1 2 3 4 5 6 7 8 9 10
#!/bin/sh
#-----------------------------------------------------------------------
#
# VISIT-BUILD-CLOSED - Build the visit distributions on the closed
#                      network.
#
# Author: Eric Brugger
# Date:   February 12, 2001
#
# Usage:
hrchilds's avatar
hrchilds committed
11
#    visit-build-closed -d <distribution>
hrchilds's avatar
hrchilds committed
12
#
13 14 15 16 17 18
#
# Modifications:
#
#   Hank Childs, Mon Oct 15 09:04:12 PDT 2007
#   Add some print statements for usability.
#
hrchilds's avatar
hrchilds committed
19 20 21
#   Hank Childs, Thu Oct 18 15:40:05 PDT 2007
#   Add ksh support for sunset.
#
hrchilds's avatar
hrchilds committed
22 23 24
#   Hank Childs, Mon Oct 22 09:25:47 PDT 2007
#   More ksh support for sunset.
#
25 26 27
#   Hank Childs, Sat Feb  9 14:18:54 PST 2008
#   Change clearcase_bin to svn_bin.
#
brugger's avatar
 
brugger committed
28 29 30
#   Eric Brugger, Mon Apr  7 13:51:23 PDT 2008
#   Removed sc build.
#
whitlocb's avatar
whitlocb committed
31 32 33 34 35
#   Brad Whitlock, Tue Dec  2 13:49:50 PST 2008
#   Add --prefix for Linux targets so we can use -rpath for the engine
#   wrapper library. I commented out sunset since Qt4 does not build
#   there.
#
hrchilds's avatar
hrchilds committed
36 37 38 39 40 41 42 43 44
#-----------------------------------------------------------------------

test=no

user=`whoami`

#
# Parse the execute line, providing default values for error checking.
#
hrchilds's avatar
hrchilds committed
45
crier=true
hrchilds's avatar
hrchilds committed
46
purple=true
hrchilds's avatar
hrchilds committed
47
hopi=true
hrchilds's avatar
hrchilds committed
48 49 50 51 52 53 54 55 56 57 58 59

dist=undefined

#
# The loop is executed once for each symbol on the execute line.  This means
# that $1 may be blank for later executions of the loop if any "shift 2"
# commands are executed.  The variable abc is not used in the loop.  
#
for abc
do
   case $1 in
      -none)
hrchilds's avatar
hrchilds committed
60
         crier=false
hrchilds's avatar
hrchilds committed
61
         purple=false
hrchilds's avatar
hrchilds committed
62
         hopi=false
hrchilds's avatar
hrchilds committed
63 64
         shift
         ;;
hrchilds's avatar
hrchilds committed
65 66 67 68 69 70 71 72
      -crier)
         crier=false
         shift
         ;;
      +crier)
         crier=true
         shift
         ;;
hrchilds's avatar
hrchilds committed
73 74
      -purple)
         purple=false
hrchilds's avatar
hrchilds committed
75 76
         shift
         ;;
hrchilds's avatar
hrchilds committed
77 78
      +purple)
         purple=true
hrchilds's avatar
hrchilds committed
79 80
         shift
         ;;
hrchilds's avatar
hrchilds committed
81 82 83 84 85 86 87 88
      -hopi)
         hopi=false
         shift
         ;;
      +hopi)
         hopi=true
         shift
         ;;
hrchilds's avatar
hrchilds committed
89 90 91 92 93 94 95 96
      -d)
         dist=$2
         shift 2
         ;;
   esac
done

#
hrchilds's avatar
hrchilds committed
97
# Check that the distribution name was provided.
hrchilds's avatar
hrchilds committed
98 99 100
#
if [ $dist = undefined ]
then
hrchilds's avatar
hrchilds committed
101
   echo "Usage: [-none] [-<machine name>] -d <distribution>"
102 103 104 105
   echo "Valid machine names:"
   echo "    crier (B-Div, Linux),"
   echo "    purple (LC, AIX),"
   echo "    hopi (LC, x86_64)"
hrchilds's avatar
hrchilds committed
106 107 108 109 110 111 112 113 114 115 116 117 118
   exit
fi

#
# Check that the distribution exists.
#
distfile=$dist.tar.gz
if [ ! -f $distfile ]
then
   echo "Distribution file doesn't exist."
   exit
fi

hrchilds's avatar
hrchilds committed
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
#
# Build on crier.
#
rm -f crier
cat <<EOF > crier
#!/bin/sh
if test ! -e /export/scratch/$user ; then
   mkdir /export/scratch/$user
fi
if test ! -e /export/scratch/$user/crier ; then
   mkdir /export/scratch/$user/crier
fi
rm -rf /export/scratch/$user/crier/visitbuild
mkdir /export/scratch/$user/crier/visitbuild
mv crier_$dist.tar.gz /export/scratch/$user/crier/visitbuild/$dist.tar.gz
cd /export/scratch/$user/crier/visitbuild
gunzip -c $dist.tar.gz | tar xvf - > buildlog 2>&1
brugger's avatar
 
brugger committed
136
cd $dist/src
hrchilds's avatar
hrchilds committed
137 138 139 140
ver=\`cat VERSION\`
ver2=\`echo \$ver | tr "." "_"\`
LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/gapps/visit/gcc/3.2.3/linux_redhat7/lib
export LD_LIBRARY_PATH
whitlocb's avatar
whitlocb committed
141
env CXXFLAGS=-O2 ./configure --prefix=/usr/gapps/visit >> ../../buildlog 2>&1
brugger's avatar
 
brugger committed
142
make -j 4 >> ../../buildlog 2>&1
143
svn_bin/visit-bin-dist >> ../../buildlog 2>&1
brugger's avatar
 
brugger committed
144 145
mv visit\$ver2.linux.tar.gz ../..
cd ../..
hrchilds's avatar
hrchilds committed
146 147 148 149 150 151
rm -f resultlog
echo "        build of visit on crier"        > resultlog 2>&1
echo "       -------------------------"       >> resultlog 2>&1
echo ""                                       >> resultlog 2>&1
ls -l                                         >> resultlog 2>&1
echo ""                                       >> resultlog 2>&1
brugger's avatar
 
brugger committed
152 153 154
echo "number of database plugins = "\`ls $dist/src/plugins/databases/libI* | wc -l\` >> resultlog 2>&1
echo "number of operator plugins = "\`ls $dist/src/plugins/operators/libI* | wc -l\` >> resultlog 2>&1
echo "number of plot plugins = "\`ls $dist/src/plugins/plots/libI* | wc -l\` >> resultlog 2>&1
hrchilds's avatar
hrchilds committed
155 156
echo ""                                       >> resultlog 2>&1
echo "The database plugins:"                  >> resultlog 2>&1
brugger's avatar
 
brugger committed
157
ls $dist/src/plugins/databases/libI* | sed "s/$dist\/src\/plugins\/databases\/libI//" | sed "s/Database.so//" >> resultlog 2>&1
hrchilds's avatar
hrchilds committed
158 159 160 161 162 163
EOF
 
if [ $crier = true ]
then
   if [ $test = no ]
   then
164
      echo "Building on crier"
hrchilds's avatar
hrchilds committed
165 166 167 168 169 170
      scp -P 22 crier crier:crier_buildit
      scp -P 22 $dist.tar.gz crier:crier_$dist.tar.gz
      ssh -p 22 crier "chmod 750 crier_buildit;./crier_buildit" &
   fi
fi

hrchilds's avatar
hrchilds committed
171
#
hrchilds's avatar
hrchilds committed
172
# Build on purple, both serial and parallel versions.
hrchilds's avatar
hrchilds committed
173
#
hrchilds's avatar
hrchilds committed
174 175
rm -f purple
cat <<EOF > purple
hrchilds's avatar
hrchilds committed
176
#!/bin/sh
hrchilds's avatar
hrchilds committed
177
PATH=/usr/local/bin:\$PATH
hrchilds's avatar
hrchilds committed
178 179
if test ! -d /p/gscratch3/$user ; then
   mkdir /p/gscratch3/$user
hrchilds's avatar
hrchilds committed
180
fi
hrchilds's avatar
hrchilds committed
181 182
if test ! -d /p/gscratch3/$user/purple ; then
   mkdir /p/gscratch3/$user/purple
hrchilds's avatar
hrchilds committed
183
fi
hrchilds's avatar
hrchilds committed
184 185 186 187
rm -rf /p/gscratch3/$user/purple/visitbuild
mkdir /p/gscratch3/$user/purple/visitbuild
mv purple_$dist.tar.gz /p/gscratch3/$user/purple/visitbuild/$dist.tar.gz
cd /p/gscratch3/$user/purple/visitbuild
hrchilds's avatar
hrchilds committed
188
gunzip -c $dist.tar.gz | tar xvf - > buildlog 2>&1
hrchilds's avatar
hrchilds committed
189
mv $dist ${dist}_32
brugger's avatar
 
brugger committed
190
cd ${dist}_32/src
hrchilds's avatar
hrchilds committed
191 192
ver=\`cat VERSION\`
ver2=\`echo \$ver | tr "." "_"\`
hrchilds's avatar
hrchilds committed
193 194
OBJECT_MODE=32
export OBJECT_MODE
brugger's avatar
 
brugger committed
195 196
env CXXFLAGS=-O2 MAKE=gmake ./configure --with-config=config-site/purple1441_32.conf >> ../../buildlog 2>&1
gmake -j 4 >> ../../buildlog 2>&1
197
svn_bin/visit-bin-dist -make gmake >> ../../buildlog 2>&1
brugger's avatar
 
brugger committed
198 199
mv visit\$ver2.aix.tar.gz ../..
cd ../..
hrchilds's avatar
hrchilds committed
200
gunzip -c $dist.tar.gz | tar xvf - >> buildlog 2>&1
brugger's avatar
 
brugger committed
201
cd $dist/src
hrchilds's avatar
hrchilds committed
202 203
OBJECT_MODE=64
export OBJECT_MODE
brugger's avatar
 
brugger committed
204 205
env CXXFLAGS=-O2 MAKE=gmake ./configure --enable-parallel >> ../../buildlog 2>&1
gmake -j 4 >> ../../buildlog 2>&1
206
svn_bin/visit-bin-dist -make gmake >> ../../buildlog 2>&1
brugger's avatar
 
brugger committed
207 208
mv visit\$ver2.aix64.tar.gz ../..
cd ../..
hrchilds's avatar
hrchilds committed
209 210
echo "        build of visit on purple"       > resultlog 2>&1
echo "       --------------------------"      >> resultlog 2>&1
hrchilds's avatar
hrchilds committed
211 212 213
echo ""                                       >> resultlog 2>&1
ls -l                                         >> resultlog 2>&1
echo ""                                       >> resultlog 2>&1
hrchilds's avatar
hrchilds committed
214 215
echo "            32 bit build"               >> resultlog 2>&1
echo ""                                       >> resultlog 2>&1
brugger's avatar
 
brugger committed
216 217 218
echo "number of database plugins = "\`ls ${dist}_32/src/plugins/databases/libI* | wc -l\` >> resultlog 2>&1
echo "number of operator plugins = "\`ls ${dist}_32/src/plugins/operators/libI* | wc -l\` >> resultlog 2>&1
echo "number of plot plugins = "\`ls ${dist}_32/src/plugins/plots/libI* | wc -l\` >> resultlog 2>&1
hrchilds's avatar
hrchilds committed
219 220
echo ""                                       >> resultlog 2>&1
echo "The database plugins:"                  >> resultlog 2>&1
brugger's avatar
 
brugger committed
221
ls ${dist}_32/src/plugins/databases/libI* | sed "s/${dist}_32\/src\/plugins\/databases\/libI//" | sed "s/Database.so//" >> resultlog 2>&1
hrchilds's avatar
hrchilds committed
222 223 224
echo ""                                       >> resultlog 2>&1
echo "            64 bit build"               >> resultlog 2>&1
echo ""                                       >> resultlog 2>&1
brugger's avatar
 
brugger committed
225 226 227
echo "number of database plugins = "\`ls $dist/src/plugins/databases/libI* | wc -l\` >> resultlog 2>&1
echo "number of operator plugins = "\`ls $dist/src/plugins/operators/libI* | wc -l\` >> resultlog 2>&1
echo "number of plot plugins = "\`ls $dist/src/plugins/plots/libI* | wc -l\` >> resultlog 2>&1
hrchilds's avatar
hrchilds committed
228 229
echo ""                                       >> resultlog 2>&1
echo "The database plugins:"                  >> resultlog 2>&1
brugger's avatar
 
brugger committed
230
ls $dist/src/plugins/databases/libI* | sed "s/$dist\/src\/plugins\/databases\/libI//" | sed "s/Database.so//" >> resultlog 2>&1
hrchilds's avatar
hrchilds committed
231 232
EOF

hrchilds's avatar
hrchilds committed
233
if [ $purple = true ]
hrchilds's avatar
hrchilds committed
234 235 236
then
   if [ $test = no ]
   then
237
      echo "Building on purple"
hrchilds's avatar
hrchilds committed
238 239 240
      scp purple purple:purple_buildit
      scp $dist.tar.gz purple:purple_$dist.tar.gz
      ssh purple "chmod 750 purple_buildit;./purple_buildit" &
hrchilds's avatar
hrchilds committed
241 242 243
   fi
fi

hrchilds's avatar
hrchilds committed
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262
#
# Build on hopi.
#
rm -f hopi
cat <<EOF > hopi
#!/bin/sh
XLOCALEDIR=/usr/lib/X11/locale
PATH=/usr/bin/X11:\$PATH
if test ! -d /usr/tmp/$user ; then
   mkdir /usr/tmp/$user
fi
if test ! -d /usr/tmp/$user/hopi ; then
   mkdir /usr/tmp/$user/hopi
fi
rm -rf /usr/tmp/$user/hopi/visitbuild
mkdir /usr/tmp/$user/hopi/visitbuild
mv hopi_$dist.tar.gz /usr/tmp/$user/hopi/visitbuild/$dist.tar.gz
cd /usr/tmp/$user/hopi/visitbuild
gunzip -c $dist.tar.gz | tar xvf - > buildlog 2>&1
brugger's avatar
 
brugger committed
263
cd $dist/src
hrchilds's avatar
hrchilds committed
264 265
ver=\`cat VERSION\`
ver2=\`echo \$ver | tr "." "_"\`
whitlocb's avatar
whitlocb committed
266
env CXXFLAGS=-O2 ./configure --prefix=/usr/gapps/visit --enable-parallel >> ../../buildlog 2>&1
brugger's avatar
 
brugger committed
267
make -j 6 >> ../../buildlog 2>&1
268
svn_bin/visit-bin-dist >> ../../buildlog 2>&1
brugger's avatar
 
brugger committed
269 270
mv visit\$ver2.linux-x86_64.tar.gz ../..
cd ../..
hrchilds's avatar
hrchilds committed
271 272 273 274 275 276
rm -f resultlog
echo "        build of visit on hopi"         > resultlog 2>&1
echo "       ------------------------"        >> resultlog 2>&1
echo ""                                       >> resultlog 2>&1
ls -l                                         >> resultlog 2>&1
echo ""                                       >> resultlog 2>&1
brugger's avatar
 
brugger committed
277 278 279
echo "number of database plugins = "\`ls $dist/src/plugins/databases/libI* | wc -l\` >> resultlog 2>&1
echo "number of operator plugins = "\`ls $dist/src/plugins/operators/libI* | wc -l\` >> resultlog 2>&1
echo "number of plot plugins = "\`ls $dist/src/plugins/plots/libI* | wc -l\` >> resultlog 2>&1
hrchilds's avatar
hrchilds committed
280 281
echo ""                                       >> resultlog 2>&1
echo "The database plugins:"                  >> resultlog 2>&1
brugger's avatar
 
brugger committed
282
ls $dist/src/plugins/databases/libI* | sed "s/$dist\/src\/plugins\/databases\/libI//" | sed "s/Database.so//" >> resultlog 2>&1
hrchilds's avatar
hrchilds committed
283 284 285 286 287 288
EOF

if [ $hopi = true ]
then
   if [ $test = no ]
   then
289
      echo "Building on hopi"
hrchilds's avatar
hrchilds committed
290 291 292 293 294 295
      scp hopi hopi3:hopi_buildit
      scp $dist.tar.gz hopi3:hopi_$dist.tar.gz
      ssh hopi3 "chmod 750 hopi_buildit;./hopi_buildit" &
   fi
fi

hrchilds's avatar
hrchilds committed
296 297 298 299 300
#
# Clean up.
#
if [ $test = no ]
then
brugger's avatar
 
brugger committed
301
   rm -f crier purple hopi
hrchilds's avatar
hrchilds committed
302
fi