diff --git a/CMakeLists.txt b/CMakeLists.txt index 016f752e..581922b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,10 @@ else() set(SHARED_LIB_EXT "so") endif() +if (WITH_BITWUZLA) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWITH_BITWUZLA") +endif() + if (WITH_MSAT) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWITH_MSAT") endif() @@ -67,6 +71,8 @@ set(CMAKE_MODULE_PATH ${SMT_SWITCH_DIR}/cmake) find_package(GMP REQUIRED) # Check that dependencies are there +list(APPEND CMAKE_PREFIX_PATH "${SMT_SWITCH_DIR}/deps/install") + if (NOT EXISTS "${SMT_SWITCH_DIR}/local/include/smt-switch/smt.h") message(FATAL_ERROR "Missing smt-switch headers -- try running ./contrib/setup-smt-switch.sh") endif() @@ -83,6 +89,14 @@ if (NOT EXISTS "${SMT_SWITCH_DIR}/local/lib/libsmt-switch-cvc5.a") message(FATAL_ERROR "Missing smt-switch cvc5 library -- try running ./contrib/setup-smt-switch.sh --with-cvc5") endif() +if (WITH_BITWUZLA) + find_package(PkgConfig REQUIRED) + pkg_check_modules(BITWUZLA REQUIRED bitwuzla) + if (NOT EXISTS "${SMT_SWITCH_DIR}/local/lib/libsmt-switch-bitwuzla.a") + message(FATAL_ERROR "Missing smt-switch bitwuzla library -- try running ./contrib/setup-smt-switch.sh --with-bitwuzla") + endif() +endif() + if (WITH_MSAT) if (NOT EXISTS "${SMT_SWITCH_DIR}/local/lib/libsmt-switch-msat.a") message(FATAL_ERROR "Missing smt-switch mathsat library -- try running ./contrib/setup-smt-switch.sh --with-msat") @@ -223,6 +237,11 @@ endif() target_link_libraries(pono-lib PUBLIC "${SMT_SWITCH_DIR}/local/lib/libsmt-switch-btor.a") target_link_libraries(pono-lib PUBLIC "${SMT_SWITCH_DIR}/local/lib/libsmt-switch-cvc5.a") +if (WITH_BITWUZLA) + target_link_libraries(pono-lib PUBLIC "${SMT_SWITCH_DIR}/local/lib/libsmt-switch-bitwuzla.a") + target_link_libraries(pono-lib PUBLIC ${BITWUZLA_LDFLAGS}) +endif() + if (WITH_MSAT) target_link_libraries(pono-lib PUBLIC "${SMT_SWITCH_DIR}/local/lib/libsmt-switch-msat.a") endif() diff --git a/configure.sh b/configure.sh index 6faed196..3cb00b94 100755 --- a/configure.sh +++ b/configure.sh @@ -13,6 +13,7 @@ Configures the CMAKE build environment. -h, --help display this message and exit --prefix=STR install directory (default: /usr/local/) --build-dir=STR custom build directory (default: build) +--with-bitwuzla build with Bitwuzla (default: off) --with-msat build with MathSAT which has a custom non-BSD compliant license. (default : off) Required for interpolant based model checking --with-msat-ic3ia build with the open-source IC3IA implementation as a backend. (default: off) @@ -36,6 +37,7 @@ die () { build_dir=build install_prefix=default build_type=default +with_bitwuzla=default with_msat=default with_msat_ic3ia=default with_coreir=default @@ -73,6 +75,7 @@ do *) build_dir=$(pwd)/$build_dir ;; # make absolute path esac ;; + --with-bitwuzla) with_bitwuzla=ON;; --with-msat) with_msat=ON;; --with-msat-ic3ia) with_msat_ic3ia=ON;; --with-coreir) with_coreir=ON;; @@ -106,6 +109,9 @@ cmake_opts="-DCMAKE_BUILD_TYPE=$buildtype -DPONO_LIB_TYPE=${lib_type} -DPONO_STA [ $install_prefix != default ] \ && cmake_opts="$cmake_opts -DCMAKE_INSTALL_PREFIX=$install_prefix" +[ $with_bitwuzla != default ] \ + && cmake_opts="$cmake_opts -DWITH_BITWUZLA=$with_bitwuzla" + [ $with_msat != default ] \ && cmake_opts="$cmake_opts -DWITH_MSAT=$with_msat" diff --git a/contrib/setup-smt-switch.sh b/contrib/setup-smt-switch.sh index 5f0d27f8..54a57cc9 100755 --- a/contrib/setup-smt-switch.sh +++ b/contrib/setup-smt-switch.sh @@ -13,6 +13,7 @@ Usage: $0 [