-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·84 lines (67 loc) · 1.78 KB
/
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
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
#! /bin/bash -e
################################################################################
# #
# Installation script for the kernels and libraries used by the fastcall #
# benchmarks. #
# #
# Usage: ./install.sh #
# #
################################################################################
#
# General setup
#
# Path of this script
SPATH="$(realpath `dirname $0`)"
#
# Build and install kernel
#
install_kernel() {
echo
echo "Building $1 kernel..."
echo
cd "$SPATH/linux-$1"
if [ -e .config ]; then
echo "Config exists, skipping config creation"
else
make defconfig
fi
make -j `nproc`
sudo make modules_install
sudo make install
}
#
# Init repo if not done yet
#
echo
echo "Cloning submodules..."
echo
cd $SPATH
git submodule update --init --recursive --depth=1
#
# Build and install kernels
#
install_kernel fastcall
install_kernel fccmp
install_kernel syscall-bench
#
# Build Google's benchmark library
#
echo
echo "Building benchmark library..."
echo
cd $SPATH/benchmark
mkdir -p $SPATH/benchmark/build
cmake -DCMAKE_BUILD_TYPE=Release -DBENCHMARK_DOWNLOAD_DEPENDENCIES=on \
-S . -B "build"
cmake --build "build" --config Release -j `nproc`
sudo cmake --build "build" --config Release --target install
#
# Build fastcall benchmarks
#
echo
echo "Building fastcall benchmarks..."
echo
cd $SPATH/fastcall-benchmarks
cmake -S . -B build/ -DCMAKE_BUILD_TYPE=Release
cmake --build build/ -j `nproc`
exit 0