-
Notifications
You must be signed in to change notification settings - Fork 160
/
install-armci-mpi
executable file
·110 lines (98 loc) · 3.08 KB
/
install-armci-mpi
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
#!/usr/bin/env bash
ARMCI_MPI_TARBALL=$1
export NWCHEM_TOP=${NWCHEM_TOP:-"`pwd`/../../"}
if test "x$NWCHEM_TOP" = x
then
echo You must set NWCHEM_TOP to use this script.
exit 1
fi
if [ ! -z "${BUILD_MPICH}" ] ; then
echo "BUILD_MPICH is set. using mpicc from BUILD_MPICH"
export PATH=${NWCHEM_TOP}/src/libext/bin:$PATH
fi
if [ ! -z "${MPICC}" ] ; then
echo "Found MPICC=${MPICC} in your environment. Using that."
ARMCIMPICC=${MPICC}
elif [ -d /opt/cray ] ; then
echo "You appear to be on a Cray machine."
echo "If you don't want to use Cray MPI wrappers, "
echo "run again with MPICC=\$YOUR_MPI ./install-armci-mpi"
ARMCIMPICC=cc
elif [ ! -z "${MPI_DIR}" ] ; then
echo "Found MPI_DIR=${MPI_DIR} in your environment."
echo "Using MPICC=${MPI_DIR}/bin/mpicc."
ARMCIMPICC=${MPI_DIR}/bin/mpicc
else
echo "Defaulting to the mpicc in your path." `which mpicc`
ARMCIMPICC=mpicc
fi
ARMCI_MPI_DIR=${NWCHEM_TOP}/src/tools/armci-mpi
if [ -d ${ARMCI_MPI_DIR} ] ; then
# Assume that it is the right one, created previously by this script.
echo "Existing ARMCI-MPI source directory found - updating it"
cd ${ARMCI_MPI_DIR} && git checkout master && git pull >& git.log
echo "Step 1 of 4 succeeded."
elif [ -x "$(command -v git)" ] ; then
#git clone -b mpi3rma --depth 10 http://git.mpich.org/armci-mpi.git ${ARMCI_MPI_DIR} >& git.log
git clone -b master --depth 10 https://github.com/jeffhammond/armci-mpi.git ${ARMCI_MPI_DIR} >& git.log
stat=$?
if [ $stat -ne 0 ] ; then
echo "git clone failed"
exit 1
else
echo "Step 1 of 4 succeeded."
fi
else
if test "x${ARMCI_MPI_TARBALL}" = x ; then
echo "You have not provided a download location for the ARMCI-MPI tarball!"
exit 1
else
wget ${ARMCI_MPI_TARBALL}
if [ $stat -ne 0 ] ; then
echo "wget failed"
exit 1
else
echo "Step 1 of 4 succeeded."
fi
fi
fi
cd ${ARMCI_MPI_DIR}
if ! [ -f ${ARMCI_MPI_DIR}/configure ] ; then
./autogen.sh >& autogen.log
stat=$?
if [ $stat -ne 0 ] ; then
echo "Autotools failed, likely because the versions your system has are too old."
echo "See https://github.com/jeffhammond/HPCInfo/wiki/Autotools."
exit 1
else
echo "Step 2 of 4 succeeded."
fi
else
echo "Step 2 of 4 succeeded."
fi
if ! [ -d ${ARMCI_MPI_DIR}/build ] ; then
mkdir ${ARMCI_MPI_DIR}/build
fi
cd ${ARMCI_MPI_DIR}/build
${ARMCI_MPI_DIR}/configure CC=$ARMCIMPICC --prefix=${NWCHEM_TOP}/external-armci --enable-g >& c.log
stat=$?
if [ $stat -ne 0 ] ; then
echo "configure failed."
echo "Please email config.log and system details to armci-discuss@lists.mpich.org."
exit 1
else
echo "Step 3 of 4 succeeded."
fi
make install >& m.log
stat=$?
if [ $stat -ne 0 ] ; then
echo "configure failed."
echo "Please email config.log and system details to armci-discuss@lists.mpich.org."
exit 1
else
echo "Step 4 of 4 succeeded."
fi
echo "Congratulations! ARMCI-MPI was built successfully."
echo "Please set the following environment variables when you build NWChem:"
echo "ARMCI_NETWORK=ARMCI"
echo "EXTERNAL_ARMCI_PATH=${NWCHEM_TOP}/external-armci"