about summary refs log tree commit diff homepage
path: root/scripts
diff options
context:
space:
mode:
authorMartin Nowack <m.nowack@imperial.ac.uk>2020-01-23 15:25:45 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2020-02-13 17:39:21 +0000
commitdbda156217c532a7e1a65e8c216e593a64c0b8fc (patch)
tree015e9b05723106f58c7865f1636ad7157edd41bb /scripts
parent64a2b1a93648461f11daa44911d791c28bc00885 (diff)
downloadklee-dbda156217c532a7e1a65e8c216e593a64c0b8fc.tar.gz
Update ubuntu build dependencies for KLEE
Build dependencies for different components were tied to a specific Ubuntu version (16.04).
Although, they are the same for newer versions as well.

By renaming `p-component-linux-ubuntu-16.04.inc` to `p-component-linux-ubuntu.inc`, the script can be used for newer Ubuntu versions as well.

Do some minor cleaning up.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build/p-clang-linux-ubuntu.inc (renamed from scripts/build/p-clang-linux-ubuntu-16.04.inc)11
-rw-r--r--scripts/build/p-gtest-linux-ubuntu.inc (renamed from scripts/build/p-gtest-linux-ubuntu-16.04.inc)0
-rw-r--r--scripts/build/p-klee-linux-ubuntu.inc (renamed from scripts/build/p-klee-linux-ubuntu-16.04.inc)2
-rw-r--r--scripts/build/p-libcxx-linux-ubuntu.inc18
-rw-r--r--scripts/build/p-llvm-linux-ubuntu-18.04.inc49
-rw-r--r--scripts/build/p-llvm-linux-ubuntu.inc (renamed from scripts/build/p-llvm-linux-ubuntu-16.04.inc)17
-rw-r--r--scripts/build/p-metasmt-linux-ubuntu.inc (renamed from scripts/build/p-metasmt-linux-ubuntu-16.04.inc)4
-rw-r--r--scripts/build/p-sqlite-linux-ubuntu.inc (renamed from scripts/build/p-sqlite-linux-ubuntu-16.04.inc)12
-rw-r--r--scripts/build/p-stp-linux-ubuntu.inc (renamed from scripts/build/p-stp-linux-ubuntu-16.04.inc)0
-rw-r--r--scripts/build/p-tcmalloc-linux-ubuntu.inc (renamed from scripts/build/p-tcmalloc-linux-ubuntu-16.04.inc)0
-rw-r--r--scripts/build/p-uclibc-linux-ubuntu.inc (renamed from scripts/build/p-uclibc-linux-ubuntu-16.04.inc)0
-rw-r--r--scripts/build/p-z3-linux-ubuntu.inc (renamed from scripts/build/p-z3-linux-ubuntu-16.04.inc)3
12 files changed, 48 insertions, 68 deletions
diff --git a/scripts/build/p-clang-linux-ubuntu-16.04.inc b/scripts/build/p-clang-linux-ubuntu.inc
index 0fb30e52..b3159d3c 100644
--- a/scripts/build/p-clang-linux-ubuntu-16.04.inc
+++ b/scripts/build/p-clang-linux-ubuntu.inc
@@ -13,13 +13,20 @@ install_binary_artifact_clang() {
     dependencies=(
       ca-certificates
       wget
+      lsb-release
+      gnupg
     )
 
     apt -y --no-install-recommends install "${dependencies[@]}"
     wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add -
 
     # Add repository
-    echo "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial${version} main" >> /etc/apt/sources.list
+    codename="$(lsb_release --codename --short)"
+    apt_entry="deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}${version} main"
+    if [[ ! $(grep -q "${apt_entry}") ]]; then
+      echo "${apt_entry}" >> /etc/apt/sources.list
+      apt update -y
+    fi
   fi
 
   apt update -y
@@ -29,7 +36,7 @@ install_binary_artifact_clang() {
   )
 
   #Install essential dependencies
-  apt -y --no-install-recommends install "${dependencies[@]}"
+  apt -y --no-install-recommends install "${dependencies[@]}" || return 1
 }
 
 get_docker_config_id_clang() {
diff --git a/scripts/build/p-gtest-linux-ubuntu-16.04.inc b/scripts/build/p-gtest-linux-ubuntu.inc
index f636d321..f636d321 100644
--- a/scripts/build/p-gtest-linux-ubuntu-16.04.inc
+++ b/scripts/build/p-gtest-linux-ubuntu.inc
diff --git a/scripts/build/p-klee-linux-ubuntu-16.04.inc b/scripts/build/p-klee-linux-ubuntu.inc
index 9109a27f..a19e6a3b 100644
--- a/scripts/build/p-klee-linux-ubuntu-16.04.inc
+++ b/scripts/build/p-klee-linux-ubuntu.inc
@@ -20,6 +20,6 @@ install_build_dependencies_klee() {
 
   apt -y --no-install-recommends install "${dependencies[@]}"
 
-  pip install lit
+  pip3 install lit
   pip3 install tabulate
 }
diff --git a/scripts/build/p-libcxx-linux-ubuntu.inc b/scripts/build/p-libcxx-linux-ubuntu.inc
new file mode 100644
index 00000000..8fefd83e
--- /dev/null
+++ b/scripts/build/p-libcxx-linux-ubuntu.inc
@@ -0,0 +1,18 @@
+install_build_dependencies_libcxx() { 
+  apt-get update -y
+
+  dependencies=(
+    build-essential
+    ca-certificates
+    git
+    python3
+    python3-pip
+    cmake
+    curl
+    file # Needed for wllvm
+  )
+
+  apt -y --no-install-recommends install "${dependencies[@]}"
+
+  pip3 install wllvm
+}
\ No newline at end of file
diff --git a/scripts/build/p-llvm-linux-ubuntu-18.04.inc b/scripts/build/p-llvm-linux-ubuntu-18.04.inc
deleted file mode 100644
index f83112db..00000000
--- a/scripts/build/p-llvm-linux-ubuntu-18.04.inc
+++ /dev/null
@@ -1,49 +0,0 @@
-install_build_dependencies_llvm() { 
-	apt update -y
-
-	dependencies=(
-		build-essential
-
-		autoconf
-		automake
-		groff
-		gcc
-		g++
-		python-dev
-		make
-		subversion # Check out code
-		zlib1g-dev
-	)
-
-	#Install essential dependencies
-	apt -y --no-install-recommends install "${dependencies[@]}"
-}
-
-install_binary_artifact_llvm() {
-  apt update -y
-  
-  dependencies=(
-    "clang-${LLVM_VERSION}"
-  )
-
-  #Install essential dependencies
-  apt -y --no-install-recommends install "${dependencies[@]}"
-}
-
-# Check if the binary artifact is installed
-is_installed_llvm() {
-	local lc=""
-	# Check if llvm-config with the right version exists	
-	lc=$(which "llvm-config-${LLVM_VERSION}")
-	
-	local rtti
-	rtti="$(${lc} --has-rtti)"
-	local assertion
-	assertion="$(${lc} --assertion-mode)"
-	local build_mode
-	build_mode="$(${lc} --build-mode)"
-	
-	# Check requested mode with mode of the found item	
-	[[ $(to_bool "${REQUIRES_RTTI}") -eq $(to_bool "${rtti}") ]] || return 1
-	[[ $(to_bool "${DISABLE_ASSERTIONS}") -ne $(to_bool "${assertion}") ]] || return 1
-}
\ No newline at end of file
diff --git a/scripts/build/p-llvm-linux-ubuntu-16.04.inc b/scripts/build/p-llvm-linux-ubuntu.inc
index bab32d45..98fe9abe 100644
--- a/scripts/build/p-llvm-linux-ubuntu-16.04.inc
+++ b/scripts/build/p-llvm-linux-ubuntu.inc
@@ -3,6 +3,7 @@ install_build_dependencies_llvm() {
   apt update -y
 
   dependencies=(
+    ca-certificates
     build-essential
     autoconf
     automake
@@ -11,7 +12,7 @@ install_build_dependencies_llvm() {
     g++
     python-dev
     make
-    subversion # To check out code
+    git # To check out code
     zlib1g-dev
     cmake
   )
@@ -49,6 +50,8 @@ install_binary_artifact_llvm() {
   dependencies=(
     ca-certificates
     wget
+    lsb-release
+    gnupg
   )
   apt -y --no-install-recommends install "${dependencies[@]}"
   wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add -
@@ -56,10 +59,14 @@ install_binary_artifact_llvm() {
   local version=""
   [[ "${LLVM_VERSION_MAJOR}" -le 6 ]] && version="-${LLVM_VERSION}"
   [[ "${LLVM_VERSION_MAJOR}" -ge 7 ]] && version="-${LLVM_VERSION_MAJOR}"
-  
+
   # Add repository
-  echo "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial${version} main" >> /etc/apt/sources.list
-  apt update -y
+  codename="$(lsb_release --codename --short)"
+  apt_entry="deb http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}${version} main"
+  if [[ ! $(grep -q "${apt_entry}") ]]; then
+    echo  "${apt_entry}" >> /etc/apt/sources.list
+    apt update -y
+  fi
 
   dependencies=(
     "llvm${version}"
@@ -69,7 +76,7 @@ install_binary_artifact_llvm() {
   )
 
   #Install essential dependencies
-  apt -y --no-install-recommends install "${dependencies[@]}"
+  apt -y --no-install-recommends install "${dependencies[@]}" || return 1
 }
 
 # Check if the binary artifact is installed
diff --git a/scripts/build/p-metasmt-linux-ubuntu-16.04.inc b/scripts/build/p-metasmt-linux-ubuntu.inc
index 583f869a..1e381b78 100644
--- a/scripts/build/p-metasmt-linux-ubuntu-16.04.inc
+++ b/scripts/build/p-metasmt-linux-ubuntu.inc
@@ -9,7 +9,8 @@ install_build_dependencies_metasmt() {
     # libgmp, gperf (required by yices2)
     gperf
     libgmp-dev
-
+    libbz2-dev
+    libboost-dev
     build-essential
     git
     wget
@@ -22,6 +23,7 @@ install_build_dependencies_metasmt() {
     python
     autoconf
     python3
+    curl
   )
 
   #Install essential dependencies
diff --git a/scripts/build/p-sqlite-linux-ubuntu-16.04.inc b/scripts/build/p-sqlite-linux-ubuntu.inc
index ee5531a2..158ea41c 100644
--- a/scripts/build/p-sqlite-linux-ubuntu-16.04.inc
+++ b/scripts/build/p-sqlite-linux-ubuntu.inc
@@ -11,25 +11,21 @@ install_build_dependencies_sqlite() {
   apt -y --no-install-recommends install "${dependencies[@]}"
 }
 install_binary_artifact_sqlite() {
+  [[ "${SANITIZER_SUFFIX}x" == "x" ]] || return 1
 
-  if [[ "${SANITIZER_SUFFIX}x" != "x" ]]; then
-    return 1
-  fi
   apt update -y
-  
   dependencies=(
     libsqlite3-dev
   )
-
-  #Install essential dependencies
   apt -y --no-install-recommends install "${dependencies[@]}"
 }
 
 # Check if the binary artifact is installed
 is_installed_sqlite() {
-	[[ -f /usr/lib/x86_64-linux-gnu/libsqlite3.so ]] || return 1
+  [[ -f /usr/lib/x86_64-linux-gnu/libsqlite3.so ]] || return 1
+  return 0
 }
 
 get_docker_config_id_sqlite() {
-    return 0
+  return 0
 }
diff --git a/scripts/build/p-stp-linux-ubuntu-16.04.inc b/scripts/build/p-stp-linux-ubuntu.inc
index f4030023..f4030023 100644
--- a/scripts/build/p-stp-linux-ubuntu-16.04.inc
+++ b/scripts/build/p-stp-linux-ubuntu.inc
diff --git a/scripts/build/p-tcmalloc-linux-ubuntu-16.04.inc b/scripts/build/p-tcmalloc-linux-ubuntu.inc
index 26bf2da9..26bf2da9 100644
--- a/scripts/build/p-tcmalloc-linux-ubuntu-16.04.inc
+++ b/scripts/build/p-tcmalloc-linux-ubuntu.inc
diff --git a/scripts/build/p-uclibc-linux-ubuntu-16.04.inc b/scripts/build/p-uclibc-linux-ubuntu.inc
index 36bdce58..36bdce58 100644
--- a/scripts/build/p-uclibc-linux-ubuntu-16.04.inc
+++ b/scripts/build/p-uclibc-linux-ubuntu.inc
diff --git a/scripts/build/p-z3-linux-ubuntu-16.04.inc b/scripts/build/p-z3-linux-ubuntu.inc
index 2f5e4086..2a46ac46 100644
--- a/scripts/build/p-z3-linux-ubuntu-16.04.inc
+++ b/scripts/build/p-z3-linux-ubuntu.inc
@@ -4,8 +4,7 @@ install_build_dependencies_z3() {
 
   dependencies=(
     build-essential
-
-	python
+    python
     git
     wget
     ca-certificates