Skip to content

Commit

Permalink
Fix stp build (#200)
Browse files Browse the repository at this point in the history
* STP master branch now uses submodules -- initialise them

* STP now has ABC as a dependency -- keep libabc build results

* STP now needs libtinfo-dev installed

* Add functions for comparing versions to build scripts

* When handling the ABC dependency of STP, compare the version with 2.3.4 instead of master, which will also handle future releases

---------

Co-authored-by: Cristian Cadar <[email protected]>
  • Loading branch information
ocelaiwo and ccadar authored Oct 23, 2024
1 parent cd8b66b commit e513fc3
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
18 changes: 18 additions & 0 deletions scripts/build/common-functions
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
1 change: 1 addition & 0 deletions scripts/build/p-klee-linux-ubuntu.inc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ install_build_dependencies_klee() {
pkg-config
cmake-data
coreutils
libtinfo-dev
)

if [[ "${SOLVERS:-}" == "metaSMT" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/p-stp-linux-ubuntu.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ install_build_dependencies_stp() {

dependencies=(
build-essential

bison
ca-certificates
cmake
flex
git
zlib1g-dev
libtinfo-dev
)

#Install essential dependencies
Expand Down
16 changes: 15 additions & 1 deletion scripts/build/p-stp.inc
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# 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 version_gt "${STP_VERSION}" "2.3.4"; 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"
Expand All @@ -14,12 +20,17 @@ 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 version_gt "${STP_VERSION}" "2.3.4"; then
cd "${BASE}/stp-${STP_VERSION}" || return 1
git submodule init
git submodule update
fi
}

build_stp() {
Expand Down Expand Up @@ -98,6 +109,9 @@ get_build_artifacts_stp() {
setup_build_variables_stp
echo "${MINISAT_INSTALL_PATH}"
echo "${STP_INSTALL_PATH}"
if version_gt "${STP_VERSION}" "2.3.4"; then
echo "${ABC_INSTALL_PATH}"
fi
)
}

Expand Down

0 comments on commit e513fc3

Please sign in to comment.