From e6c12e6e11f88c706e239a47a32b16d1fad01262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ron=20Ricardo=20Perez-Lopez?= Date: Wed, 30 Oct 2024 14:24:19 -0700 Subject: [PATCH] Install cvc5 in alternate location --- .github/workflows/ci.yml | 2 +- ci-scripts/setup-cvc5.sh | 43 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 2 deletions(-) mode change 120000 => 100755 ci-scripts/setup-cvc5.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7ef6c03c..b9195b5fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,7 +66,7 @@ jobs: run: ./ci-scripts/setup-${{ matrix.name }}.sh ${{ matrix.setup_opts }} - name: Configure - run: ./configure.sh --${{ matrix.name }} --debug --static --python --smtlib-reader + run: ./configure.sh --${{ matrix.name }} --cvc5-home=custom_install/cvc5 --debug --static --python --smtlib-reader - name: Build run: | diff --git a/ci-scripts/setup-cvc5.sh b/ci-scripts/setup-cvc5.sh deleted file mode 120000 index da4f1395f..000000000 --- a/ci-scripts/setup-cvc5.sh +++ /dev/null @@ -1 +0,0 @@ -../contrib/setup-cvc5.sh \ No newline at end of file diff --git a/ci-scripts/setup-cvc5.sh b/ci-scripts/setup-cvc5.sh new file mode 100755 index 000000000..e08f49e0d --- /dev/null +++ b/ci-scripts/setup-cvc5.sh @@ -0,0 +1,42 @@ +#!/bin/bash +set -e + +CONTRIB_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +ROOT_DIR="$(dirname "$CONTRIB_DIR")" +INSTALL_DIR="$ROOT_DIR/custom_install" + +mkdir -p $INSTALL_DIR + +CVC5_VERSION=cvc5-1.1.1 + +if [ "$(uname)" == "Darwin" ]; then + NUM_CORES=$(sysctl -n hw.logicalcpu) +elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then + NUM_CORES=$(nproc) +else + NUM_CORES=1 +fi + +$CONTRIB_DIR/setup-cadical.sh + +if [ ! -d "$INSTALL_DIR/cvc5" ]; then + cd $INSTALL_DIR + git clone https://github.com/cvc5/cvc5.git + cd cvc5 + git checkout ${CVC5_VERSION} + ./configure.sh --static --auto-download --dep-path="$DEPS/install" + cd build + make -j$NUM_CORES +else + echo "$INSTALL_DIR/cvc5 already exists. If you want to rebuild, please remove it manually." +fi + +if [ -f $INSTALL_DIR/cvc5/build/src/libcvc5.a ] && [ -f $INSTALL_DIR/cvc5/build/src/parser/libcvc5parser.a ]; then + echo "It appears cvc5 was setup successfully into $INSTALL_DIR/cvc5." + echo "You may now install it with make ./configure.sh --cvc5 && cd build && make" +else + echo "Building cvc5 failed." + echo "You might be missing some dependencies." + echo "Please see their github page for installation instructions: https://github.com/cvc5/cvc5" + exit 1 +fi