2008-10-28 20:22:29 +03:00
|
|
|
#! /bin/csh -f
|
|
|
|
#
|
|
|
|
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
# University Research and Technology
|
|
|
|
# Corporation. All rights reserved.
|
|
|
|
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
# of Tennessee Research Foundation. All rights
|
|
|
|
# reserved.
|
2014-10-02 14:09:13 +04:00
|
|
|
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
2008-10-28 20:22:29 +03:00
|
|
|
# University of Stuttgart. All rights reserved.
|
|
|
|
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
# All rights reserved.
|
2014-10-02 17:01:11 +04:00
|
|
|
# Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved.
|
2015-01-15 12:57:05 +03:00
|
|
|
# Copyright (c) 2015 Research Organization for Information Science
|
|
|
|
# and Technology (RIST). All rights reserved.
|
2008-10-28 20:22:29 +03:00
|
|
|
# $COPYRIGHT$
|
2014-10-02 14:09:13 +04:00
|
|
|
#
|
2008-10-28 20:22:29 +03:00
|
|
|
# Additional copyrights may follow
|
2014-10-02 14:09:13 +04:00
|
|
|
#
|
2008-10-28 20:22:29 +03:00
|
|
|
# $HEADER$
|
|
|
|
#
|
|
|
|
|
|
|
|
set srcdir="$1"
|
|
|
|
set builddir="`pwd`"
|
|
|
|
set distdir="$builddir/$2"
|
|
|
|
set OMPI_VERSION="$3"
|
2011-02-17 17:01:10 +03:00
|
|
|
set OMPI_REPO_REV="$4"
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
if ("$distdir" == "") then
|
|
|
|
echo "Must supply relative distdir as argv[2] -- aborting"
|
|
|
|
exit 1
|
|
|
|
elif ("$OMPI_VERSION" == "") then
|
|
|
|
echo "Must supply version as argv[1] -- aborting"
|
|
|
|
exit 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
# we can catch some hard (but possible) to do mistakes by looking at
|
2014-10-02 18:31:47 +04:00
|
|
|
# our repo's revision, but only if we are in the source tree.
|
2008-10-28 20:22:29 +03:00
|
|
|
# Otherwise, use what configure told us, at the cost of allowing one
|
|
|
|
# or two corner cases in (but otherwise VPATH builds won't work)
|
2011-02-17 17:01:10 +03:00
|
|
|
set repo_rev=$OMPI_REPO_REV
|
2014-10-02 18:31:47 +04:00
|
|
|
if (-d .git) then
|
|
|
|
set repo_rev="`config/opal_get_version.sh VERSION --repo-rev`"
|
2008-10-28 20:22:29 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
set start=`date`
|
|
|
|
cat <<EOF
|
2014-10-02 14:09:13 +04:00
|
|
|
|
2008-10-28 20:22:29 +03:00
|
|
|
Creating Open MPI distribution
|
|
|
|
In directory: `pwd`
|
|
|
|
Version: $OMPI_VERSION
|
|
|
|
Started: $start
|
2014-10-02 14:09:13 +04:00
|
|
|
|
2008-10-28 20:22:29 +03:00
|
|
|
EOF
|
|
|
|
|
|
|
|
umask 022
|
|
|
|
|
2010-10-29 17:37:19 +04:00
|
|
|
# Some shell startup files alias cp, mv, and rm to have "-i"
|
|
|
|
# (interactive). Unalias here, just so that we don't use that option.
|
|
|
|
unalias cp
|
|
|
|
unalias rm
|
|
|
|
unalias mv
|
|
|
|
|
2008-10-28 20:22:29 +03:00
|
|
|
if (! -d "$distdir") then
|
|
|
|
echo "*** ERROR: dist dir does not exist"
|
|
|
|
echo "*** ERROR: $distdir"
|
|
|
|
exit 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
2014-10-02 18:31:47 +04:00
|
|
|
# Update VERSION:repo_rev with the best value we have.
|
2008-10-28 20:22:29 +03:00
|
|
|
#
|
2014-10-02 18:31:47 +04:00
|
|
|
sed -e 's/^repo_rev=.*/repo_rev='$repo_rev'/' "${distdir}/VERSION" > "${distdir}/version.new"
|
|
|
|
cp -f "${distdir}/version.new" "${distdir}/VERSION"
|
|
|
|
rm -f "${distdir}/version.new"
|
|
|
|
# need to reset the timestamp to not annoy AM dependencies
|
|
|
|
touch -r "${srcdir}/VERSION" "${distdir}/VERSION"
|
|
|
|
echo "*** Updated VERSION file with repo rev number"
|
2008-10-28 20:22:29 +03:00
|
|
|
|
|
|
|
#########################################################
|
|
|
|
# VERY IMPORTANT: Now go into the new distribution tree #
|
|
|
|
#########################################################
|
|
|
|
cd "$distdir"
|
|
|
|
echo "*** Now in distdir: $distdir"
|
|
|
|
|
|
|
|
#
|
|
|
|
# Get the latest config.guess and config.sub from ftp.gnu.org
|
|
|
|
#
|
|
|
|
|
|
|
|
echo "*** Downloading latest config.sub/config.guess from ftp.gnu.org..."
|
|
|
|
cd config
|
|
|
|
set configdir="`pwd`"
|
|
|
|
mkdir tmp.$$
|
|
|
|
cd tmp.$$
|
|
|
|
# Official HTTP git mirrors for config.guess / config.sub
|
|
|
|
wget -t 1 -T 10 -O config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=master'
|
|
|
|
wget -t 1 -T 10 -O config.sub 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=master'
|
|
|
|
chmod +x config.guess config.sub
|
|
|
|
|
|
|
|
# Recently, ftp.gnu.org has had zero-legnth config.guess / config.sub
|
|
|
|
# files, which causes the automated nightly SVN snapshot tarball to
|
|
|
|
# fail to be made correctly. This is a primitive attempt to fix that.
|
|
|
|
# If we got zero-length files from wget, use a config.guess /
|
|
|
|
# config.sub from a known location that is more recent than what ships
|
2009-01-20 18:53:18 +03:00
|
|
|
# in the current generation of auto* tools. Also check to ensure that
|
|
|
|
# the resulting scripts are runnable (Jan 2009: there are un-runnable
|
|
|
|
# scripts available right now because of some git vulnerability).
|
2008-10-28 20:22:29 +03:00
|
|
|
|
2009-01-20 18:53:18 +03:00
|
|
|
# Before you complain about this too loudly, remember that we're using
|
|
|
|
# unreleased software...
|
|
|
|
|
|
|
|
set happy=0
|
2015-01-15 12:57:05 +03:00
|
|
|
if (! -f config.guess || `test -s config.guess;echo $status`) then
|
2009-01-20 18:53:18 +03:00
|
|
|
echo " - WARNING: Got bad config.guess from ftp.gnu.org (non-existent or empty)"
|
2008-10-28 20:22:29 +03:00
|
|
|
else
|
2009-01-20 18:53:18 +03:00
|
|
|
./config.guess >& /dev/null
|
|
|
|
if ($status != 0) then
|
|
|
|
echo " - WARNING: Got bad config.guess from ftp.gnu.org (not executable)"
|
|
|
|
else
|
2015-01-15 12:57:05 +03:00
|
|
|
if (! -f config.sub || `test -s config.sub;echo $status`) then
|
2009-01-20 18:53:18 +03:00
|
|
|
echo " - WARNING: Got bad config.sub from ftp.gnu.org (non-existent or empty)"
|
|
|
|
else
|
|
|
|
./config.sub `./config.guess` >& /dev/null
|
|
|
|
if ($status != 0) then
|
|
|
|
echo " - WARNING: Got bad config.sub from ftp.gnu.org (not executable)"
|
|
|
|
else
|
|
|
|
echo " - Got good config.guess and config.sub from ftp.gnu.org"
|
2010-10-29 17:37:19 +04:00
|
|
|
cp -f config.sub config.guess ..
|
2009-01-20 18:53:18 +03:00
|
|
|
set happy=1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
2008-10-28 20:22:29 +03:00
|
|
|
endif
|
2009-01-20 18:53:18 +03:00
|
|
|
|
|
|
|
if ("$happy" == "0") then
|
|
|
|
echo " - WARNING: using included versions for both config.sub and config.guess"
|
2008-10-28 20:22:29 +03:00
|
|
|
endif
|
|
|
|
cd ..
|
|
|
|
rm -rf tmp.$$
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Find all the config.guess/config.sub files, and replace them with
|
|
|
|
# the ones that we've downloaded
|
|
|
|
#
|
|
|
|
|
|
|
|
echo "*** Now in: `pwd`"
|
|
|
|
echo "*** Replacing config.sub/config.guess with latest from ftp.gnu.org..."
|
|
|
|
foreach file (config.guess config.sub)
|
2012-06-27 05:28:28 +04:00
|
|
|
foreach dir (opal orte ompi)
|
2010-01-05 18:11:41 +03:00
|
|
|
if (-d $dir) then
|
|
|
|
find $dir -name $file \
|
|
|
|
-exec chmod +w {} \; \
|
|
|
|
-exec cp -f $configdir/$file {} \; \
|
|
|
|
-print
|
|
|
|
endif
|
2008-10-28 20:22:29 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-09-18 03:04:06 +04:00
|
|
|
|
|
|
|
#
|
|
|
|
# Put the release version number in the README and INSTALL files
|
|
|
|
#
|
|
|
|
|
2008-10-28 20:22:29 +03:00
|
|
|
set files="README INSTALL"
|
|
|
|
echo "*** Updating version number in $files..."
|
|
|
|
foreach file ($files)
|
|
|
|
echo " - Setting $file"
|
|
|
|
if (-f $file) then
|
2014-10-02 14:09:13 +04:00
|
|
|
sed -e "s/OMPI_VERSION/$OMPI_VERSION/g" $file > bar
|
2008-10-28 20:22:29 +03:00
|
|
|
mv -f bar $file
|
|
|
|
endif
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# All done
|
|
|
|
#
|
|
|
|
|
|
|
|
cat <<EOF
|
2014-10-02 14:09:13 +04:00
|
|
|
*** Open MPI version $OMPI_VERSION distribution created
|
|
|
|
|
2008-10-28 20:22:29 +03:00
|
|
|
Started: $start
|
|
|
|
Ended: `date`
|
2014-10-02 14:09:13 +04:00
|
|
|
|
2008-10-28 20:22:29 +03:00
|
|
|
EOF
|
|
|
|
|