about summary refs log tree commit diff homepage
path: root/scripts/build/p-klee-linux-ubuntu.inc
blob: 5e7f8135a6e8a47aacfa7ae3c5a4db65a4e6722e (plain) (blame)
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
install_build_dependencies_klee() {
  source "${DIR}/common-functions"

  # Check if the Ubuntu version is an LTS version - otherwise no cmake version available
  if [[ $(grep -q LTS /etc/os-release) ]]; then
    with_sudo apt update -y
    # Add Kitware's certificate for CMake
    dependencies=(
      apt-transport-https
      ca-certificates
      gnupg
      lsb-release
      software-properties-common
      wget
    )

    with_sudo apt -y --no-install-recommends install "${dependencies[@]}"
    wget -O - "https://apt.kitware.com/keys/kitware-archive-latest.asc" 2> /dev/null \
        | gpg --dearmor - | with_sudo tee /etc/apt/trusted.gpg.d/kitware.gpg > /dev/null

    # Add CMake repository
    codename="$(lsb_release --codename --short)"
    with_sudo apt-add-repository -y "deb https://apt.kitware.com/ubuntu/ ${codename} main"
  fi

  with_sudo apt update -y

  # Install KLEE's dependencies
  dependencies=(
    build-essential
    gcc-multilib # to generate 32bit
    cmake
    zlib1g-dev
    python3
    python3-setuptools
    python3-pip
    python3-wheel
  )

  if [[ $(to_bool "${COVERAGE}") -eq 1 ]]; then
    dependencies+=(lcov curl git)
  fi

  if [[ $(to_bool "${ENABLE_DOXYGEN}") -eq 1 ]]; then
    dependencies+=(doxygen graphviz)
  fi

  with_sudo apt -y --no-install-recommends install "${dependencies[@]}"

  pip3 install --user lit
  pip3 install --user tabulate
  base_path="$(python3 -m site --user-base)"
  export PATH="$PATH:${base_path}/bin"
}