-
Notifications
You must be signed in to change notification settings - Fork 2
/
node_prepare_hpl
executable file
·87 lines (75 loc) · 1.72 KB
/
node_prepare_hpl
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
#!/bin/bash
set -e # any error will stop everyting
usage() {
echo "usage: `basename $0` <source_archive> <extract_directory> <compiled_archive> [dependencies]"
}
myecho() {
echo "### "$(date "+%Y-%m-%d %H:%M:%S")" ### ${@}"
}
myecho "`basename $0` start. args = $@"
myecho "on `uname -a`"
WORKDIR=$(cd `dirname $0`; pwd)
if [ "$#" -lt "3" ] ; then
usage
exit 1
fi
SOURCEARCHIVE=$1
EXTRACTDIR=$2
COMPILEDARCHIVE=$3
shift 3
DEPS="$@"
myecho "preparing dependencies"
cd $WORKDIR
for DEP in $DEPS ; do
myecho " $DEP"
tar xzf $DEP
done
myecho "clean hpl install dir"
rm -rf $WORKDIR/hpl-install/
myecho "clean hpl source dir"
rm -rf "$WORKDIR/$EXTRACTDIR"
myecho "extract hpl"
cd "$WORKDIR"
tar xzf "$SOURCEARCHIVE"
myecho "configure hpl"
cd "$WORKDIR/$EXTRACTDIR"
cp setup/Make.Linux_PII_CBLAS .
cat <<EOF | patch Make.Linux_PII_CBLAS
70c70
< TOPdir = \$(HOME)/hpl
---
> TOPdir = $WORKDIR/$EXTRACTDIR
84c84
< MPdir = /usr/local/mpi
---
> MPdir = $WORKDIR/openmpi-install
86c86
< MPlib = \$(MPdir)/lib/libmpich.a
---
> MPlib =
95,97c95,97
< LAdir = \$(HOME)/netlib/ARCHIVES/Linux_PII
< LAinc =
< LAlib = \$(LAdir)/libcblas.a \$(LAdir)/libatlas.a
---
> LAdir = $WORKDIR/atlas-install
> LAinc = -I\$(LAdir)/include
> LAlib = \$(LAdir)/lib/libcblas.a \$(LAdir)/lib/libatlas.a
169c169
< CC = /usr/bin/gcc
---
> CC = \$(MPdir)/bin/mpicc
176c176
< LINKER = /usr/bin/g77
---
> LINKER = \$(MPdir)/bin/mpicc
EOF
myecho "make hpl"
make arch=Linux_PII_CBLAS
# myecho "install hpl"
# make install
# create targz of atlas installation
myecho "package built hpl"
cd $WORKDIR
tar czf $COMPILEDARCHIVE $EXTRACTDIR/
myecho "finished"