-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall-requirements.sh
More file actions
executable file
·56 lines (47 loc) · 1.62 KB
/
install-requirements.sh
File metadata and controls
executable file
·56 lines (47 loc) · 1.62 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
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
set -e
echo "This script will install the minimum requirements to run."
echo "It may override previously installed instances of the dependencies therein."
read -r -p "Are you sure you want to continue with this? [y/N] " response
response=${response,,}
if [[ ! "$response" =~ ^(yes|y)$ ]]; then
echo "User confirmation required for installation."
echo "Ending script execution now"
exit 1
fi
echo -e "\nSTARTING REQUIREMENT INSTALLATION...\n"
# Formatting
sudo apt-get update
sudo apt-get -y install python3-pip clang-format-9
pip install pre-commit
pre-commit --version
# CMake
which cmake
mkdir cmake-tmp
pushd cmake-tmp
VERSION=3.15.3 # Use any version 3.12+ (3.15+ required for cmake --install vs make install)
wget https://github.com/Kitware/CMake/releases/download/v$VERSION/cmake-$VERSION-linux-x86_64.sh
sudo chmod +x cmake-$VERSION-linux-x86_64.sh
sudo ./cmake-$VERSION-linux-x86_64.sh --skip-license --prefix=/usr/local # Will overwrite a cmake installation
popd
sudo rm cmake-tmp -rf
echo "Global CMake: $(cmake --version)"
if [ "$(cmake --version | head -n 1)" != "cmake version $VERSION" ]; then
echo "Wrong CMake version installed here: ";
which cmake;
exit 1;
else
echo "Global CMake: $(cmake --version)";
fi
# GCC
sudo apt -y install build-essential
sudo apt -y install gcc-9 g++-9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
gcc --version
g++ --version
echo
echo -e "\nCOMPELTED REQUIREMENT INSTALLATION\n"
exit 0