-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·47 lines (39 loc) · 897 Bytes
/
install.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
#!/bin/bash
BUILD_ROOT="$( mktemp -d )"
SRC_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
WORKING_DIR=$PWD
DASH_JAY="-j $(getconf _NPROCESSORS_ONLN)"
err() {
echo "${1-Died}." >&2
}
die() {
err "$1"
exit 1
}
pushd () {
command pushd "$@" > /dev/null
}
popd () {
command popd "$@" > /dev/null
}
function setupENV()
{
sudo apt-get update
sudo apt-get install dpkg-dev rpm doxygen libelf-dev rename
}
function buildHIP()
{
pushd $BUILD_ROOT
cmake $SRC_ROOT -DCMAKE_BUILD_TYPE=Release
make $DASH_JAY
make package
cp hip-*.deb $WORKING_DIR
sudo dpkg -i -B hip-base*.deb hip-hcc*.deb hip-sample*.deb hip-doc*.deb
popd
rm -rf $BUILD_ROOT
}
echo "Preparing build environment"
setupENV || die "setupENV failed"
echo "Building and installing HIP packages"
buildHIP || die "buildHIP failed"
echo "Finished building HIP packages"