Skip to content

Commit 5300018

Browse files
committed
Add openmpi package. Curl now retries downloads
1 parent 2eda7a2 commit 5300018

File tree

2 files changed

+63
-1
lines changed

2 files changed

+63
-1
lines changed

pkgs/openmpi.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/bash
2+
3+
pkg="openmpi"
4+
pkgopts=$@
5+
cleanup=""
6+
7+
version=4.1.2
8+
pdir=openmpi-${version}
9+
pfile=${pdir}.tar.gz
10+
src=$(eval "@TOP_DIR@/tools/fetch_check.sh" https://download.open-mpi.org/release/open-mpi/v4.1/${pfile} ${pfile})
11+
12+
if [ "x${src}" = "x" ]; then
13+
echo "Failed to fetch ${pkg}" >&2
14+
exit 1
15+
fi
16+
cleanup="${src}"
17+
18+
if [ "@DOCKER@" = "yes" ]; then
19+
log=/dev/stderr
20+
else
21+
log="../log_${pkg}"
22+
fi
23+
24+
echo "Building ${pkg}..." >&2
25+
26+
rm -rf ${pdir}
27+
28+
fcopt="--enable-mpi-fortran=usempi"
29+
if [ "x@FC@" = "x" ]; then
30+
fcopt="--enable-mpi-fortran=no"
31+
fi
32+
unset F90
33+
unset F90FLAGS
34+
35+
wrap=""
36+
if [ "x@MPI_EXTRA_COMP@" != "x" ]; then
37+
wrap="${wrap} --with-wrapper-cflags=\"@MPI_EXTRA_COMP@\" --with-wrapper-cxxflags=\"@MPI_EXTRA_COMP@\" --with-wrapper-fcflags=\"@MPI_EXTRA_COMP@\""
38+
fi
39+
40+
if [ "x@MPI_EXTRA_LINK@" != "x" ]; then
41+
wrap="${wrap} --with-wrapper-ldflags=\"@MPI_EXTRA_LINK@\""
42+
fi
43+
44+
tar xzf ${src} \
45+
&& cd mpich-${version} \
46+
&& cleanup="${cleanup} $(pwd)" \
47+
&& CC="@CC@" CXX="@CXX@" FC="@FC@" F77="@FC@" \
48+
CFLAGS="@CFLAGS@" CXXFLAGS="@CXXFLAGS@" \
49+
FFLAGS="@FCFLAGS@" FCFLAGS="@FCFLAGS@" \
50+
./configure @CROSS@ ${fcopt} ${wrap} \
51+
--prefix="@AUX_PREFIX@" > ${log} 2>&1 \
52+
&& make -j @MAKEJ@ >> ${log} 2>&1 \
53+
&& make install >> ${log} 2>&1
54+
55+
if [ $? -ne 0 ]; then
56+
echo "Failed to build ${pkg}" >&2
57+
exit 1
58+
fi
59+
60+
echo "Finished building ${pkg}" >&2
61+
echo "${cleanup}"
62+
exit 0

tools/fetch_check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ plocal="${pooldir}/${local}"
2121

2222
if [ ! -e "${plocal}" ]; then
2323
echo "Fetching ${local} to download pool..." >&2
24-
curl -SL "${url}" -o "${plocal}"
24+
curl --connect-timeout 30 --max-time 300 --retry 5 -SL "${url}" -o "${plocal}"
2525
else
2626
echo "Found existing ${local} in download pool." >&2
2727
fi

0 commit comments

Comments
 (0)