Skip to content

Commit e513fc3

Browse files
ocelaiwoccadar
andauthored
Fix stp build (#200)
* 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 <c.cadar@imperial.ac.uk>
1 parent cd8b66b commit e513fc3

File tree

4 files changed

+35
-2
lines changed

4 files changed

+35
-2
lines changed

scripts/build/common-functions

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,21 @@ function with_sudo() {
4141
"$@"
4242
fi
4343
}
44+
45+
function version_lte() {
46+
local v1="$1"
47+
local v2="$2"
48+
printf '%s\n%s\n' "$1" "$2" | sort -C -V
49+
}
50+
51+
function version_lt() {
52+
! version_lte "$2" "$1"
53+
}
54+
55+
function version_gte() {
56+
version_lte "$2" "$1"
57+
}
58+
59+
function version_gt() {
60+
! version_gte "$2" "$1"
61+
}

scripts/build/p-klee-linux-ubuntu.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ install_build_dependencies_klee() {
1313
pkg-config
1414
cmake-data
1515
coreutils
16+
libtinfo-dev
1617
)
1718

1819
if [[ "${SOLVERS:-}" == "metaSMT" ]]; then

scripts/build/p-stp-linux-ubuntu.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ install_build_dependencies_stp() {
55

66
dependencies=(
77
build-essential
8-
98
bison
109
ca-certificates
1110
cmake
1211
flex
1312
git
1413
zlib1g-dev
14+
libtinfo-dev
1515
)
1616

1717
#Install essential dependencies

scripts/build/p-stp.inc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
# Build scripts for STP
22
# Variables that any artifact of this package might depend on
33
setup_build_variables_stp() {
4+
source "${DIR}/common-functions"
5+
46
STP_SUFFIX="${SANITIZER_SUFFIX}"
57

68
MINISAT_BUILD_PATH="${BASE}/minisat-build${STP_SUFFIX}"
79
MINISAT_INSTALL_PATH="${BASE}/minisat-install${STP_SUFFIX}"
810

11+
if version_gt "${STP_VERSION}" "2.3.4"; then
12+
ABC_INSTALL_PATH="${BASE}/stp-${STP_VERSION}-build${STP_SUFFIX}/lib/extlib-abc/build/"
13+
fi
14+
915
STP_BUILD_PATH="${BASE}/stp-${STP_VERSION}-build${STP_SUFFIX}"
1016
STP_INSTALL_PATH="${BASE}/stp-${STP_VERSION}-install${STP_SUFFIX}"
1117
stp_url="https://github.com/stp/stp.git"
@@ -14,12 +20,17 @@ setup_build_variables_stp() {
1420
}
1521

1622
download_stp() {
17-
source "${DIR}/common-functions"
1823
# Download minisat
1924
git_clone_or_update https://github.com/stp/minisat "${BASE}/minisat" "master"
2025

2126
# Download STP
2227
git_clone_or_update "${stp_url}" "${BASE}/stp-${STP_VERSION}" "${STP_VERSION}"
28+
29+
if version_gt "${STP_VERSION}" "2.3.4"; then
30+
cd "${BASE}/stp-${STP_VERSION}" || return 1
31+
git submodule init
32+
git submodule update
33+
fi
2334
}
2435

2536
build_stp() {
@@ -98,6 +109,9 @@ get_build_artifacts_stp() {
98109
setup_build_variables_stp
99110
echo "${MINISAT_INSTALL_PATH}"
100111
echo "${STP_INSTALL_PATH}"
112+
if version_gt "${STP_VERSION}" "2.3.4"; then
113+
echo "${ABC_INSTALL_PATH}"
114+
fi
101115
)
102116
}
103117

0 commit comments

Comments
 (0)