forked from LLNL/scr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·198 lines (176 loc) · 4.65 KB
/
bootstrap.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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
#!/bin/bash
#
# This is an easy-bake script to download and build all SCR's external
# dependencies. The dependencies will be build in scr/deps/ and
# installed to scr/install/
#
# Optional flags:
# --debug compiles dependencies with full debug "-g -O0"
# --dev builds most recent version of each dependency
#
set -x
# optional builds
build_debug=0 # whether to build optimized (0) or debug "-g -O0" (1)
build_dev=0 # whether to checkout fixed version tags (0) or use latest (1)
while [ $# -ge 1 ]; do
case "$1" in
"--debug" )
build_debug=1 ;;
"--dev" )
build_dev=1 ;;
*)
echo "USAGE ERROR: unknown option $1"
exit 1 ;;
esac
shift
done
ROOT="$(pwd)"
mkdir -p deps
mkdir -p install
INSTALL_DIR=$ROOT/install
cd deps
lwgrp=lwgrp-1.0.3
dtcmp=dtcmp-1.1.2
pdsh=pdsh-2.34
if [ ! -f ${lwgrp}.tar.gz ] ; then
wget https://github.com/LLNL/lwgrp/releases/download/v1.0.3/${lwgrp}.tar.gz
fi
if [ ! -f ${dtcmp}.tar.gz ] ; then
wget https://github.com/LLNL/dtcmp/releases/download/v1.1.2/${dtcmp}.tar.gz
fi
if [ ! -f ${pdsh}.tar.gz ] ; then
wget https://github.com/chaos/pdsh/releases/download/${pdsh}/${pdsh}.tar.gz
fi
repos=(https://github.com/ECP-VeloC/KVTree.git
https://github.com/ECP-VeloC/AXL.git
https://github.com/ECP-VeloC/spath.git
https://github.com/ECP-VeloC/rankstr.git
https://github.com/ECP-VeloC/redset.git
https://github.com/ECP-VeloC/shuffile.git
https://github.com/ECP-VeloC/er.git
)
for i in "${repos[@]}" ; do
# Get just the name of the project (like "KVTree")
name=$(basename $i | sed 's/\.git//g')
if [ -d $name ] ; then
echo "$name already exists, skipping it"
else
git clone $i
fi
done
# whether to build optimized or "-g -O0" debug
buildtype="Release"
if [ $build_debug -eq 1 ] ; then
buildtype="Debug"
fi
rm -rf ${lwgrp}
tar -zxf ${lwgrp}.tar.gz
pushd ${lwgrp}
./configure \
--prefix=${INSTALL_DIR} && \
make && \
make install
if [ $? -ne 0 ]; then
echo "failed to configure, build, or install liblwgrp"
exit 1
fi
popd
rm -rf ${dtcmp}
tar -zxf ${dtcmp}.tar.gz
pushd ${dtcmp}
./configure \
--prefix=${INSTALL_DIR} \
--with-lwgrp=${INSTALL_DIR} && \
make && \
make install
if [ $? -ne 0 ]; then
echo "failed to configure, build, or install libdtcmp"
exit 1
fi
popd
rm -rf ${pdsh}
tar -zxf ${pdsh}.tar.gz
pushd ${pdsh}
./configure --prefix=$INSTALL_DIR && \
make && \
make install
if [ $? -ne 0 ]; then
echo "failed to configure, build, or install pdsh"
exit 1
fi
popd
cd KVTree
if [ $build_dev -eq 0 ] ; then
git checkout v1.1.1
fi
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=$buildtype -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DMPI=ON ..
make -j `nproc`
make install
cd ../..
cd AXL
if [ $build_dev -eq 0 ] ; then
git checkout v0.4.0
fi
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=$buildtype -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR ..
make -j `nproc`
make install
cd ../..
cd spath
if [ $build_dev -eq 0 ] ; then
git checkout v0.0.2
fi
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=$buildtype -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DMPI=ON ..
make -j `nproc`
make install
#make test
cd ../..
cd rankstr
if [ $build_dev -eq 0 ] ; then
git checkout v0.0.3
fi
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=$buildtype -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DMPI=ON ..
make -j `nproc`
make install
#make test
cd ../..
cd redset
if [ $build_dev -eq 0 ] ; then
git checkout v0.0.5
fi
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=$buildtype -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DWITH_KVTREE_PREFIX=$INSTALL_DIR -DMPI=ON ..
make -j `nproc`
make install
cd ../..
cd shuffile
if [ $build_dev -eq 0 ] ; then
git checkout v0.0.4
fi
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=$buildtype -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DWITH_KVTREE_PREFIX=$INSTALL_DIR -DMPI=ON ..
make -j `nproc`
make install
cd ../..
cd er
if [ $build_dev -eq 0 ] ; then
git checkout v0.0.4
fi
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=$buildtype -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DWITH_KVTREE_PREFIX=$INSTALL_DIR -DWITH_REDSET_PREFIX=$INSTALL_DIR -DWITH_SHUFFILE_PREFIX=$INSTALL_DIR -DMPI=ON ..
make -j `nproc`
make install
cd ../..
set +x
cd "$ROOT"
mkdir -p build
echo "*************************************************************************"
echo "Dependencies are all built. You can now build SCR with:"
echo ""
echo " mkdir -p build && cd build"
echo " cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR .."
echo " make && make install"
echo "*************************************************************************"