File: maketar

package info (click to toggle)
mpich 1.1.0-3
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 22,116 kB
  • ctags: 27,349
  • sloc: ansic: 193,435; sh: 11,172; fortran: 6,545; makefile: 5,801; cpp: 5,020; tcl: 3,548; asm: 3,536; csh: 1,079; java: 614; perl: 183; awk: 168; sed: 70; f90: 62
file content (345 lines) | stat: -rwxr-xr-x 11,305 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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
154
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
#! /bin/sh
#
# This just assembles the tar file in /tmp
# You can change the name with -name= and add directories with -add=
#
# Change to distribution approach:
#  Because of the difficulties in getting "contributed" devices updated, 
#  and because we want to emphasize the flexibility of the package, 
#  we need multiple distributions.  I'm going to start with:
#      Full distribution (as now)
#      Workstations only (ch_p4, ch_shmem)
#      MPPs only (ch_mpl, ch_nx, ch_cmmd)
#      No devices at all
#
#  with separate distributions for the devices
#    ch_cenju3
#    ch_lfshmem
#    ch_nc
#    ch_nexus
#    meiko
#    nx
#    t3d
#    t3e
#    tests
#
#  Note that the meiko, nx, t3d, t3e all will fail
#  because they are ADI-2.  
#
# In addition, we build the various MPI/MPE standalone packages if
# -mpienv is specified
#
OTHERDEVICES="mpid/ch_nx mpid/ch_p4 mpid/ch_nc mpid/ch_cmmd mpid/ch_mpl \
		mpid/ch_meiko mpid/ch_shmem mpid/ch_lfshmem mpid/t3d \
		mpid/sgi mpid/nx mpid/ch_nexus mpid/ch_cenju3"
MAKE=make
MPIR_HOME=/home/MPI/mpich
relname=1.1.0
# By default, destdir is the misc tryout directory.
destdir=/home/ftp/pub/mpi/misc
if [ -s $MPIR_HOME/relname ] ; then
    relname=`cat $MPIR_HOME/relname`
fi
tarname=mpich
extrafiles=""
cleanonly=0
do_autoconf=1
verbose=1
mpienv=0
do_all_tar=1
do_copy=1
rmtmpfile=1
for arg in "$@" ; do
    case $arg in 
	-name=* )
	tarname="`echo $arg|sed -e 's/-name=//'`"
	;;

	-add=* )
	extrafiles="$extrafiles `echo A$arg | sed -e 's/A-add=//'`"
	;;

	-cleanonly )
	cleanonly=1
	;;

	-echo )
	set -x
	;;

	-quiet)
	verbose=0
	;;

	-noautoconf)
	do_autoconf=0
	;;

	-mainonly)
	do_all_tar=0
	;;

	-nocopy)
	do_copy=0
	;;
	
	-mpienv)
	mpienv=1
	;;

	-destdir=*)
	destdir="`echo A$arg | sed -e 's/A-destdir=//'`"
	if [ ! -d "$destdir" ] ; then 
	    echo "$destdir is not a valid directory"
	    exit 1
	fi
	;;

	*)
	if test -n "$arg" ; then
   	    echo "port: Unknown argument ($arg)"
	    exit 1
        fi
	;;
    esac
done
# 
cd $MPIR_HOME
#
# First, clean out the various files.
# We export make for the Makefiles just in case we need a different make...
export MAKE
$MAKE clean
for dir in $OTHERDEVICES ; 
     do echo cleaning $dir
     (cd $dir ; if [ -s Makefile ] ; then $MAKE clean ; fi ) 
done
if [ -s mpid/ch_p4/p4-1.4/Makefile ] ; then \
	    (cd  mpid/ch_p4/p4-1.4 ; $MAKE realclean ) ; fi
(cd doc ; $MAKE distrib )
if [ ! -s Xclude ] ; then 
    find . -name RCS -print | sed -e 's%^./%%g' > Xclude 
fi
#
if [ $cleanonly = 1 ] ; then
    exit 0
fi
#
# Update the configure programs
if [ $do_autoconf = 1 ] ; then
    autoconf
    /bin/rm -f .tmp
    sed -e 's/PAC_CHECK_HEADERS/AC_HAVE_HEADERS/g' \
        -e 's/PAC_CHECK_HEADER/AC_HAVE_HEADERS/g' configure.in > .tmp
    autoheader .tmp > mpichconf.h.in
    /bin/rm -f .tmp
    maint/splitsed < configure > configure.2
    echo "Some configure creations may generate errors; these can be ignored"
    if [ -s mpid/ch_tcp/p3/configure.in ] ; then
        (cd mpid/ch_tcp/p3 ; /bin/rm -f configure ; /usr/local/bin/autoconf )
    fi
    for dir in mpid/ch_p4/p4-1.4 mpid/ch_shmem/p2ptest profiling/wrappergen \
	    profiling/nupshot mpe examples/perftest examples/test ; do
        if [ -s $dir/configure.in ] ; then
	    ( cd $dir ; /bin/rm -f configure ; autoconf )
        fi
    done
    # The generalized server is autoconf 2
    (cd mpid/server ; /usr/local/cvs-test/bin/cvs update ; \
		/usr/local/bin/autoconf )
    echo "Done with configure updates"
fi
#
/bin/rm -rf /tmp/$tarname /tmp/mpich-tmp /tmp/mpifoo.tar
# This relies on bin being a link to util.
#tar cXf Xclude /tmp/mpifoo.tar 
# SGI versions of tar don't support X (eXclude); use the following line instead
#tar cf /tmp/mpifoo.tar 
# This creates a temporary directory containing the part of MPICH that
# we will distribute.
if [ $verbose = 1 ] ; then echo "Copying MPICH into /tmp..." ; fi
# Removed mpid/chameleon
tar cXf Xclude /tmp/mpifoo.tar \
 COPYRIGHT README \
 Makefile.in configure configure.2 aclocal.m4 bin ptx_ifile \
 doc/functions.ps.Z doc/perf.ps.Z doc/guide.ps.Z doc/install.ps.Z \
 doc/port.in doc/portbuild.in doc/portperf.in doc/porttest.in \
 doc/latexinfo.sty doc/epsf.sty doc/epsf.tex doc/doc.bib \
 doc/docgather doc/portrun doc/docmake \
 ref/adiman.ps.Z ref/mpiman.ps.Z \
 configure.in mpichconf.h.in acconfig.h examples include man mpe ccbugs \
 mpid/ch2 mpid/util mpid/tests \
 mpid/ch_nx mpid/ch_p4 \
 mpid/ch_mpl mpid/ch_cmmd mpid/ch_nc mpid/ch_meiko mpid/ch_shmem \
 mpid/meiko mpid/t3d mpid/t3e mpid/nx mpid/ch_nexus mpid/ch_lfshmem \
 mpid/ch_cenju3 \
 mpid/NewDevice mpid/updatedev mpid/server \
 installtest src util/mandesc util/finderrors util/insttest \
 util/mpirun.* util/mpireconfig.in util/execer util/machines \
 util/mpiman.in util/upshot util/tarch util/tdevice \
 util/mpicc.in util/mpiCC.in util/mpif77.in util/mpiinstall.in \
 util/tstmachines.in util/chp4_servs.in util/cleanipcs \
 util/maketar util/chkserv util/chkmachine util/Makefile.in profiling
#
# Untar into /tmp, remove stuff we don't want in the full file
if [ $verbose = 1 ] ; then echo "Cleaning distribution directories..." ; fi
curdir=`pwd`
mkdir /tmp/mpich-tmp
cd /tmp/mpich-tmp
tar xf ../mpifoo.tar 
rm ../mpifoo.tar
# Remove using explicit mpich-tmp just for added safety.
cd /tmp
/bin/rm -rf mpich-tmp/mpe/contrib/mandel/*.log \
	      mpich-tmp/profiling/nupshot/tl \
	      mpich-tmp/profiling/nupshot/samples \
	      mpich-tmp/profiling/upshot/bin/upshot \
	      mpich-tmp/profiling/upshot/bin/upshot.old \
	      mpich-tmp/profiling/upshot/logfiles \
	      mpich-tmp/util/machines/machines.* \
	      mpich-tmp/mpe/Makefile_nompi \
	      mpich-tmp/examples/perftest/save \
	      mpich-tmp/examples/perftest/*.cit
mkdir mpich-tmp/profiling/upshot/logfiles
cp $MPIR_HOME/profiling/upshot/logfiles/fft.trf \
	mpich-tmp/profiling/upshot/logfiles
cp $MPIR_HOME/profiling/upshot/logfiles/sam_hyp.16.log \
	mpich-tmp/profiling/upshot/logfiles
cp $MPIR_HOME/profiling/upshot/logfiles/states.c \
	mpich-tmp/profiling/upshot/logfiles
cp $MPIR_HOME/util/machines/machines.sample mpich-tmp/util/machines
find mpich-tmp \( -name 'RCS' -o -name '*.o' -o -name '#*#' -o \
              -name '*~' -o -name 'mputil.mp*' -o -name Makefile -o \
	      -name makefile -o -name 'CVS' \) -print | \
	sed 's%^%/bin/rm -rf %g' | sh
find mpich-tmp/examples -name '*.pg' -exec /bin/rm \{\} \;
find mpich-tmp/mpe -name '*.pg' -exec /bin/rm \{\} \;
find mpich-tmp/mpe -name 'Makefile' -exec /bin/rm \{\} \;
find mpich-tmp/examples -name 'Makefile' -exec /bin/rm \{\} \;
find mpich-tmp/src -name 'Makefile' -exec /bin/rm \{\} \;
find mpich-tmp/profiling -name 'Makefile' -exec /bin/rm \{\} \;
# Files of the form rdb.* appear to be Nexus files that are not being
# removed and that have not been added to the clean target in the Makefiles
find mpich-tmp/examples -name 'rdb.*' -exec /bin/rm \{\} \;
#
# Remove the 'LOCAL' information from the main Makefile, if present.
sed -e 's/mpi: Makefile.in/mpi:/g' \
    -e '/^## LOCAL START/,/^## LOCAL END/d' \
	/tmp/mpich-tmp/Makefile.in > /tmp/mpich-tmp/tmp
/bin/rm -f /tmp/mpich-tmp/Makefile.in
/bin/mv /tmp/mpich-tmp/tmp /tmp/mpich-tmp/Makefile.in
#
# We should have clean out these names, but check to be sure
find /tmp/mpich-tmp -name '#*#' -print
# This requires prune.
find /tmp/mpich-tmp -name 'lib' -prune -o -name '*.o' -print 
#
# Finally, create the tar files and compress the results
cd /tmp
mv /tmp/mpich-tmp /tmp/$tarname
if [ $verbose = 1 ] ; then echo "Full distribution" ; fi
# Full distribution
/bin/rm -f /tmp/$tarname-$relname.tar.Z /tmp/$tarname-$relname.tar.gz
tar cof - $tarname | compress > /tmp/$tarname-$relname.tar.Z
tar cof - $tarname | gzip > /tmp/$tarname-$relname.tar.gz
tarfiles="$tarname-$relname.tar"
if [ $do_all_tar = 1 ] ; then 
    # Individual devices
    if [ $verbose = 1 ] ; then echo "Individual devices" ; fi
    cd $tarname/mpid
    for dev in ch_p4 ch_shmem ch_lfshmem ch_nc ch_nexus ch_cenju3 \
    	   meiko nx t3d t3e tests ; do
        /bin/rm -f /tmp/$dev-$relname.tar.Z /tmp/$dev-$relname.tar.gz	
        tar cof - $dev | compress > /tmp/$dev-$relname.tar.Z
        tar cof - $dev | gzip > /tmp/$dev-$relname.tar.gz
        tarfiles="$tarfiles $dev-$relname.tar"
    done

    cd /tmp
    # Workstation build.  From mpid, include only util, ch2, ch_p4, ch_shmem
    if [ $verbose = 1 ] ; then echo "Workstation version" ; fi
    /bin/rm -rf /tmp/mpid
    mv $tarname/mpid .
    mkdir $tarname/mpid
    mv mpid/ch_p4 $tarname/mpid
    mv mpid/ch_shmem $tarname/mpid
    mv mpid/server $tarname/mpid
    mv mpid/ch2 $tarname/mpid
    mv mpid/util $tarname/mpid
    /bin/rm -f /tmp/$tarname-ws-$relname.tar.Z
    /bin/rm -f /tmp/$tarname-ws-$relname.tar.gz
    tar cof - $tarname | compress > /tmp/$tarname-ws-$relname.tar.Z
    tar cof - $tarname | gzip > /tmp/$tarname-ws-$relname.tar.gz
    tarfiles="$tarfiles $tarname-ws-$relname.tar"
    mv $tarname/mpid/ch_p4 mpid
    mv $tarname/mpid/ch_shmem mpid
    mv $tarname/mpid/server mpid
    #
    # Mpp build only (ch_mpl, ch_nx, ch_cmmd)
    if [ $verbose = 1 ] ; then echo "MPP version" ; fi
    mv mpid/ch_mpl $tarname/mpid
    mv mpid/ch_nx $tarname/mpid
    mv mpid/ch_cmmd $tarname/mpid
    /bin/rm -f /tmp/$tarname-mpp-$relname.tar.Z 
    /bin/rm -f /tmp/$tarname-mpp-$relname.tar.gz
    tar cof - $tarname | compress > /tmp/$tarname-mpp-$relname.tar.Z
    tar cof - $tarname | gzip > /tmp/$tarname-mpp-$relname.tar.gz
    tarfiles="$tarfiles $tarname-mpp-$relname.tar"
    mv $tarname/mpid/ch_mpl mpid
    mv $tarname/mpid/ch_nx mpid
    mv $tarname/mpid/ch_cmmd mpid
    #
    # No devices (I've left util and ch2 as examples and for support)
    # 
    if [ $verbose = 1 ] ; then echo "No device version" ; fi
    /bin/rm -f /tmp/$tarname-nodev-$relname.tar.Z
    /bin/rm -f /tmp/$tarname-nodev-$relname.tar.gz
    tar cof - $tarname | compress > /tmp/$tarname-nodev-$relname.tar.Z
    tar cof - $tarname | gzip > /tmp/$tarname-nodev-$relname.tar.gz
    tarfiles="$tarfiles $tarname-ws-$relname.tar"
    #
fi
/bin/rm -rf /tmp/$tarname /tmp/mpifoo.tar /tmp/mpid
if [ $do_copy = 1 ] ; then
    for tarfile in $tarfiles ; do
        if [ -f $tarfile.gz ] ; then 
	    if [ $verbose = 1 ] ; then 
	        echo -n "Copying $tarfile.gz to $destdir ... "
	    fi
	    cp $tarfile.gz $destdir
	    if [ $rmtmpfile = 1 ] ; then 
	        /bin/rm $tarfile.gz
	    fi
	    if [ $verbose = 1 ] ; then echo " done." ; fi
        fi
        if [ -f $tarfile.Z ] ;  then 
	    if [ $verbose = 1 ] ; then 
	        echo -n "Copying $tarfile.Z to $destdir ... "
	    fi
	    cp $tarfile.Z $destdir
	    if [ $rmtmpfile = 1 ] ; then 
	        /bin/rm $tarfile.Z
	    fi
	    if [ $verbose = 1 ] ; then echo " done." ; fi
        fi
    done
else
    echo "Created tar files are $tarfiles"
fi
#
if [ $mpienv = 1 ] ; then
    # This one moves directly into /home/ftp/pub/mpi/mpi-test
    (cd examples/test ; ./maketar )
    # This leaves in /tmp
    (cd examples/perftest ; ./maketar )
    cp /tmp/perftest.tar.gz /home/ftp/pub/mpi/misc
    if [ $rmtmpfile = 1 ] ; then
	/bin/rm /tmp/perftest.tar.gz
    fi 
    # This leaves in /tmp
    (cd mpe ; ./maketar )
    cp /tmp/mpe.tar.gz /home/ftp/pub/mpi/misc
    if [ $rmtmpfile = 1 ] ; then
	/bin/rm /tmp/mpe.tar.gz
    fi 
fi