File: bootstrap.sh

package info (click to toggle)
mpich 3.3-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 131,836 kB
  • sloc: ansic: 975,868; cpp: 57,437; f90: 53,762; perl: 19,562; xml: 12,464; sh: 12,303; fortran: 7,875; makefile: 7,078; ruby: 126; java: 100; python: 98; lisp: 19; php: 8; sed: 4
file content (82 lines) | stat: -rwxr-xr-x 2,948 bytes parent folder | download
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
#!/usr/bin/env bash
#
# Fetches MPICH dependencies, builds them from source, and installs them
# in the path stored in the environment variable MPICH_DEPS_PATH.

# Dependencies to install:
LIBTOOL=libtool-2.4.6
AUTOCONF=autoconf-2.69
AUTOMAKE=automake-1.15

# Check that the environment variable is set:
MPICH_DEPS_PREFIX=${MPICH_DEPS_PREFIX:?"bootstrap.sh installs MPICH dependencies \
in the path stored in the environment variable MPICH_DEPS_PREFIX but this \
variable is not set. Please set it to the path in which you want to install \
MPICH dependencies and try again."}

echo "Bootstrapping MPICH dependencies..."

# The dependencies will be downloaded and compiled in this directory
MPICH_DEPS_SRC=/tmp/mpich_deps_src

set -e # Trap on error

mkdir -p ${MPICH_DEPS_PREFIX}
mkdir    ${MPICH_DEPS_SRC}    # Errors out if the directory already exists

# File used to log errors (will be cleaned up later)
ERROR_LOG="mpich_bootstrap.log"

# Dumps the file in the ERROR_LOG environment variable to stderr and exits
function dump_ERROR_LOG {
    if [ -z ${ERROR_LOG+x} ]; then
        exit 1
    else
        cat ${ERROR_LOG} >&2
        exit 1
    fi
}

# On error, dump the log
trap 'dump_ERROR_LOG' ERR

cd ${MPICH_DEPS_SRC}

echo -ne "Downloading dependencies... libtool  [0%]\r"
wget http://ftpmirror.gnu.org/libtool/${LIBTOOL}.tar.gz >${ERROR_LOG} 2>&1
echo -ne "Downloading dependencies... autoconf [33%]\r"
wget http://ftp.gnu.org/gnu/autoconf/${AUTOCONF}.tar.gz >${ERROR_LOG} 2>&1
echo -ne "Downloading dependencies... automake [66%]\r"
wget http://ftp.gnu.org/gnu/automake/${AUTOMAKE}.tar.gz >${ERROR_LOG} 2>&1
echo     "Downloading dependencies... done.           "

echo -ne "Extracting dependencies... libtool  [0%]\r"
tar -xzf ${LIBTOOL}.tar.gz >${ERROR_LOG} 2>&1
echo -ne "Extracting dependencies... autoconf [33%]\r"
tar -xzf ${AUTOCONF}.tar.gz >${ERROR_LOG} 2>&1
echo -ne "Extracting dependencies... automake [66%]\r"
tar -xzf ${AUTOMAKE}.tar.gz >${ERROR_LOG} 2>&1
echo     "Extracting dependencies... done.           "

echo -ne "Installing dependencies... libtool  [0%]\r"
cd ${LIBTOOL}
./configure --prefix=${MPICH_DEPS_PREFIX} >${ERROR_LOG} 2>&1
make -j >${ERROR_LOG} 2>&1
make install -j >${ERROR_LOG} 2>&1
echo -ne "Installing dependencies... autoconf [33%]\r"
cd ../${AUTOCONF}
./configure --prefix=${MPICH_DEPS_PREFIX} >${ERROR_LOG} 2>&1
make install -j >${ERROR_LOG} 2>&1
make -j >${ERROR_LOG} 2>&1
echo -ne "Installing dependencies... automake [66%]\r"
cd ../${AUTOMAKE}
./configure --prefix=${MPICH_DEPS_PREFIX} >${ERROR_LOG} 2>&1
make -j >${ERROR_LOG} 2>&1
make install -j >${ERROR_LOG} 2>&1
echo     "Installing dependencies... done.          "
cd ../..

rm -rf ${MPICH_DEPS_SRC} # Cleanup the source directory.

echo     "MPICH bootstrapping finished. All dependencies have been installed to ${MPICH_DEPS_PREFIX}."
echo     "Please make sure that the directory is in your PATH before continuing configuring MPICH."