-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·43 lines (35 loc) · 1.09 KB
/
install.sh
File metadata and controls
executable file
·43 lines (35 loc) · 1.09 KB
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
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: $0 [opae | xrt]"
exit 1
fi
if [ "$1" != "opae" ] && [ "$1" != "xrt" ]; then
echo "Usage: $0 [opae | xrt]"
exit 1
fi
if [ -z "$SOFF_PREFIX" ]; then
echo "Define the SOFF_PREFIX environment variable before running $0."
exit 1
fi
if [ ! -d "$SOFF_PREFIX" ]; then
echo "SOFF_PREFIX=$SOFF_PREFIX is not a valid directory.";
exit 1
fi
SNUCLROOT="$PWD"
if [ ! -d "$SNUCLROOT/inc" ] || [ ! -d "$SNUCLROOT/runtime" ]; then
echo "The current directory does not contains soff-runtime."
exit 1
fi
if [ ! -f "$SNUCLROOT/runtime/Makefile.$1" ] || [ ! -d "$SNUCLROOT/runtime/$1" ]; then
echo "The current directory does not contains the runtime implementation for $1."
exit 1
fi
echo "[SOFF] Compiling the runtime..."
cd "$SNUCLROOT/runtime"
SNUCLROOT=$SNUCLROOT make -j -f Makefile.$1
echo "[SOFF] Copying files to $SOFF_PREFIX..."
mkdir -p "$SOFF_PREFIX/lib"
cp "$SNUCLROOT/runtime/libsoff_opae.so" "$SOFF_PREFIX/lib/"
mkdir -p "$SOFF_PREFIX/include"
cp -r "$SNUCLROOT/inc/"* "$SOFF_PREFIX/include/"
echo "[SOFF] soff-runtime installation complete."