-
Notifications
You must be signed in to change notification settings - Fork 2
/
node_prepare_atlas
executable file
·63 lines (51 loc) · 1.4 KB
/
node_prepare_atlas
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
#!/bin/bash
set -e # any error will stop everyting
usage() {
echo "usage: `basename $0` <source_archive> <extract_directory> <compiled_archive>"
}
myecho() {
echo "### "$(date "+%Y-%m-%d %H:%M:%S")" ### ${@}"
}
myecho "`basename $0` start. args = $@"
myecho "on `uname -a`"
WORKDIR=$(cd `dirname $0`; pwd)
if [ "$#" != 3 ] ; then
usage
exit 1
fi
SOURCEARCHIVE=$1
EXTRACTDIR=$2
COMPILEDARCHIVE=$3
myecho "ensure no cpu throttling"
for cpu in /sys/devices/system/cpu/cpu* ; do
if [ -f "$cpu/cpufreq/scaling_governor" ] ; then
myecho " cpu: $cpu"
if [ `cat "$cpu/cpufreq/scaling_governor"` != "performance" ] ; then
echo "$cpu/cpufreq/scaling_governor = "`cat $cpu/cpufreq/scaling_governor` >&2
exit 1
fi
fi
done
myecho "clean atlas install dir"
rm -rf $WORKDIR/atlas-install/
myecho "clean atlas source dir"
rm -rf "$WORKDIR/$EXTRACTDIR"
myecho "extract atlas"
cd "$WORKDIR"
tar xjf "$SOURCEARCHIVE"
myecho "create atlas build dir"
cd "$WORKDIR/$EXTRACTDIR"
mkdir build
cd build
myecho "configure atlas"
POINTER_BITWIDTH=`getconf LONG_BIT`
../configure --prefix=$WORKDIR/atlas-install --nof77 -t 0 -b "$POINTER_BITWIDTH" --cripple-atlas-performance
myecho "make atlas"
make
myecho "install atlas"
make install
# create targz of atlas installation
myecho "package atlas install"
cd $WORKDIR
tar czf $COMPILEDARCHIVE atlas-install/
myecho "finished"