Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ease setup in Amazon Linux 2 #2833

Merged
merged 4 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions scripts/setup/al2/install_cbmc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
# Copyright Kani Contributors
# SPDX-License-Identifier: Apache-2.0 OR MIT

set -eu

# Source kani-dependencies to get CBMC_VERSION
source kani-dependencies

if [ -z "${CBMC_VERSION:-}" ]; then
echo "$0: Error: CBMC_VERSION is not specified"
exit 1
fi

# Binaries are not released for AL2, so build from source
WORK_DIR=$(mktemp -d)
git clone \
--branch cbmc-${CBMC_VERSION} --depth 1 \
https://github.com/diffblue/cbmc \
"${WORK_DIR}"

pushd "${WORK_DIR}"

mkdir build
git submodule update --init

cmake3 -S . -Bbuild -DWITH_JBMC=OFF -Dsat_impl="minisat2;cadical"
cmake3 --build build -- -j$(nproc)
sudo make -C build install

popd
rm -rf "${WORK_DIR}"
36 changes: 36 additions & 0 deletions scripts/setup/al2/install_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
# Copyright Kani Contributors
# SPDX-License-Identifier: Apache-2.0 OR MIT

set -eu

# Dependencies.
# Note: CMake 3.8 or higher is required to build CBMC, but those versions are
# only available in AWS AMIs through `cmake3`. So we install `cmake3` and use it
# to build CBMC.
DEPS=(
cmake
adpaco-aws marked this conversation as resolved.
Show resolved Hide resolved
cmake3
git
openssl-devel
python3-pip
wget
)

set -x

sudo yum -y update
sudo yum -y groupinstall "Development Tools"
sudo yum -y install "${DEPS[@]}"

# Add Python package dependencies
python3 -m pip install autopep8

# Get the directory containing this script
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

${SCRIPT_DIR}/install_cbmc.sh
${SCRIPT_DIR}/install_viewer.sh
# The Kissat installation script is platform-independent, so is placed one level up
${SCRIPT_DIR}/../install_kissat.sh
${SCRIPT_DIR}/../install_rustup.sh
19 changes: 19 additions & 0 deletions scripts/setup/al2/install_viewer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
# Copyright Kani Contributors
# SPDX-License-Identifier: Apache-2.0 OR MIT

set -eu

# Install cbmc-viewer

# Source kani-dependencies to get CBMC_VIEWER_VERSION
source kani-dependencies

if [ -z "${CBMC_VIEWER_VERSION:-}" ]; then
echo "$0: Error: CBMC_VIEWER_VERSION is not specified"
exit 1
fi

set -x

python3 -m pip install cbmc-viewer==$CBMC_VIEWER_VERSION