-
Notifications
You must be signed in to change notification settings - Fork 2
/
openmpi_build.sh
executable file
·61 lines (53 loc) · 1.28 KB
/
openmpi_build.sh
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
#!/bin/bash
if [[ "x$MPI_ROOT" == "x" ]]; then
echo "MPI_ROOT not defined"
exit 70
fi
if [[ -e $MPI_ROOT/bin/mpicc ]]; then
echo "MPI compilers already exist"
exit 71
fi
which ucx_info &> /dev/null
if [[ $? -ne 0 ]]; then
echo "UCX not found. OpenMPI will be installed without it!"
ucx_opt=""
else
UCX_DIR=$( readlink -f $( dirname $( which ucx_info ) )/.. )
ucx_opt="--with-ucx=$UCX_DIR"
fi
srcDir=$(mktemp -d -t ci-XXXXXXXXXX)
if [[ ! -d $srcDir ]]; then
echo "Source dir $srcDir does not exist"
exit 90
fi
echo "Using temporary directory $srcDir"
cp -a src_all/* $srcDir/.
for sub_dir in $MPI_ROOT; do
mkdir $sub_dir
rc=$?
if [[ $rc -ne 0 ]]; then
echo "Return code $rc given when making $sub_dir"
exit 90
fi
done
OMPI_DIR=openmpi-4.0.4
cd $srcDir
tar -xzf ${OMPI_DIR}.tar.gz
cd $OMPI_DIR
#./configure --prefix=$MPI_ROOT --with-verbs
#./configure --prefix=$MPI_ROOT --with-pmi=/opt/slurm/include --without-verbs $ucx_opt
./configure --prefix=$MPI_ROOT --without-verbs $ucx_opt
rc=$?
if [[ $rc -ne 0 ]]; then
echo "Configure failed"
exit $rc
fi
for mk_cmd in "make" "make install" "make check"; do
$mk_cmd
if [[ $rc -ne 0 ]]; then
echo "Make command failed: $mk_cmd"
exit $rc
fi
done
echo "Install complete"
exit 0