From bc441711c882b16d17f03f33a59301a410fd907d Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Mon, 14 Oct 2024 17:23:41 +0200 Subject: [PATCH 1/5] STP master branch now uses submodules -- initialise them --- scripts/build/p-stp.inc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/build/p-stp.inc b/scripts/build/p-stp.inc index 4bec4e054f..c53b525f97 100644 --- a/scripts/build/p-stp.inc +++ b/scripts/build/p-stp.inc @@ -20,6 +20,12 @@ download_stp() { # Download STP git_clone_or_update "${stp_url}" "${BASE}/stp-${STP_VERSION}" "${STP_VERSION}" + + if [[ "${STP_VERSION}" == "master" ]]; then + cd "${BASE}/stp-${STP_VERSION}" || return 1 + git submodule init + git submodule update + fi } build_stp() { From 11b1fb1d97fb8a983ecc5f0d2c894ce0bbb1d8f8 Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Thu, 17 Oct 2024 16:00:29 +0100 Subject: [PATCH 2/5] STP now has ABC as a dependency -- keep libabc build results --- scripts/build/p-stp.inc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/build/p-stp.inc b/scripts/build/p-stp.inc index c53b525f97..136592571c 100644 --- a/scripts/build/p-stp.inc +++ b/scripts/build/p-stp.inc @@ -6,6 +6,10 @@ setup_build_variables_stp() { MINISAT_BUILD_PATH="${BASE}/minisat-build${STP_SUFFIX}" MINISAT_INSTALL_PATH="${BASE}/minisat-install${STP_SUFFIX}" + if [[ "${STP_VERSION}" == "master" ]]; then + ABC_INSTALL_PATH="${BASE}/stp-${STP_VERSION}-build${STP_SUFFIX}/lib/extlib-abc/build/" + fi + STP_BUILD_PATH="${BASE}/stp-${STP_VERSION}-build${STP_SUFFIX}" STP_INSTALL_PATH="${BASE}/stp-${STP_VERSION}-install${STP_SUFFIX}" stp_url="https://github.com/stp/stp.git" @@ -104,6 +108,9 @@ get_build_artifacts_stp() { setup_build_variables_stp echo "${MINISAT_INSTALL_PATH}" echo "${STP_INSTALL_PATH}" + if [[ "${STP_VERSION}" == "master" ]]; then + echo "${ABC_INSTALL_PATH}" + fi ) } From 63cf4437b3dd04effc6cbb6a778a39539f83eaf8 Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Tue, 15 Oct 2024 21:20:14 +0100 Subject: [PATCH 3/5] STP now needs libtinfo-dev installed --- scripts/build/p-klee-linux-ubuntu.inc | 1 + scripts/build/p-stp-linux-ubuntu.inc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/build/p-klee-linux-ubuntu.inc b/scripts/build/p-klee-linux-ubuntu.inc index 70af8dc110..b87cb5af7e 100644 --- a/scripts/build/p-klee-linux-ubuntu.inc +++ b/scripts/build/p-klee-linux-ubuntu.inc @@ -13,6 +13,7 @@ install_build_dependencies_klee() { pkg-config cmake-data coreutils + libtinfo-dev ) if [[ "${SOLVERS:-}" == "metaSMT" ]]; then diff --git a/scripts/build/p-stp-linux-ubuntu.inc b/scripts/build/p-stp-linux-ubuntu.inc index 612022efe5..5fdc0bed24 100644 --- a/scripts/build/p-stp-linux-ubuntu.inc +++ b/scripts/build/p-stp-linux-ubuntu.inc @@ -5,13 +5,13 @@ install_build_dependencies_stp() { dependencies=( build-essential - bison ca-certificates cmake flex git zlib1g-dev + libtinfo-dev ) #Install essential dependencies From 277a670e154ae673031744ca203df7b2b7197ee6 Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Fri, 18 Oct 2024 09:25:51 +0100 Subject: [PATCH 4/5] Add functions for comparing versions to build scripts --- scripts/build/common-functions | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/scripts/build/common-functions b/scripts/build/common-functions index d7ae4654c4..3e5e2acda3 100644 --- a/scripts/build/common-functions +++ b/scripts/build/common-functions @@ -41,3 +41,21 @@ function with_sudo() { "$@" fi } + +function version_lte() { + local v1="$1" + local v2="$2" + printf '%s\n%s\n' "$1" "$2" | sort -C -V +} + +function version_lt() { + ! version_lte "$2" "$1" +} + +function version_gte() { + version_lte "$2" "$1" +} + +function version_gt() { + ! version_gte "$2" "$1" +} From 4edfe7e648ce7edca78d8da925bd1c642285f384 Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Fri, 18 Oct 2024 09:29:32 +0100 Subject: [PATCH 5/5] When handling the ABC dependency of STP, compare the version with 2.3.4 instead of master, which will also handle future releases --- scripts/build/p-stp.inc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/build/p-stp.inc b/scripts/build/p-stp.inc index 136592571c..1ef202ab9a 100644 --- a/scripts/build/p-stp.inc +++ b/scripts/build/p-stp.inc @@ -1,12 +1,14 @@ # Build scripts for STP # Variables that any artifact of this package might depend on setup_build_variables_stp() { + source "${DIR}/common-functions" + STP_SUFFIX="${SANITIZER_SUFFIX}" MINISAT_BUILD_PATH="${BASE}/minisat-build${STP_SUFFIX}" MINISAT_INSTALL_PATH="${BASE}/minisat-install${STP_SUFFIX}" - if [[ "${STP_VERSION}" == "master" ]]; then + if version_gt "${STP_VERSION}" "2.3.4"; then ABC_INSTALL_PATH="${BASE}/stp-${STP_VERSION}-build${STP_SUFFIX}/lib/extlib-abc/build/" fi @@ -18,14 +20,13 @@ setup_build_variables_stp() { } download_stp() { - source "${DIR}/common-functions" # Download minisat git_clone_or_update https://github.com/stp/minisat "${BASE}/minisat" "master" # Download STP git_clone_or_update "${stp_url}" "${BASE}/stp-${STP_VERSION}" "${STP_VERSION}" - if [[ "${STP_VERSION}" == "master" ]]; then + if version_gt "${STP_VERSION}" "2.3.4"; then cd "${BASE}/stp-${STP_VERSION}" || return 1 git submodule init git submodule update @@ -108,7 +109,7 @@ get_build_artifacts_stp() { setup_build_variables_stp echo "${MINISAT_INSTALL_PATH}" echo "${STP_INSTALL_PATH}" - if [[ "${STP_VERSION}" == "master" ]]; then + if version_gt "${STP_VERSION}" "2.3.4"; then echo "${ABC_INSTALL_PATH}" fi )