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

Configurable smt-switch directory #327

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@ endif()
message("-- FOUND FLEX EXECUTABLE: ${FLEX_EXECUTABLE}")
message("-- FOUND FLEX INCLUDE DIRS: ${FLEX_INCLUDE_DIRS}")

if (NOT DEFINED SMT_SWITCH_DIR)
set(SMT_SWITCH_DIR "${PROJECT_SOURCE_DIR}/deps/smt-switch")
endif()

# TODO: Use find_package
# find package
#list(APPEND CMAKE_PREFIX_PATH "${PROJECT_SOURCE_DIR}/smt-switch")

set(SMT_SWITCH_DIR "${PROJECT_SOURCE_DIR}/deps/smt-switch")

# rely on cmake modules from smt-switch (required anyway)
set(CMAKE_MODULE_PATH ${SMT_SWITCH_DIR}/cmake)

Expand Down
14 changes: 14 additions & 0 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
--smt-switch-dir=STR custom smt-switch directory (default: deps/smt-switch)
--with-btor build with Boolector (default: off)
--with-msat build with MathSAT which has a custom non-BSD compliant license. (default : off)
Required for interpolant based model checking
Expand All @@ -36,6 +37,7 @@ die () {
}

build_dir=build
smt_switch_dir=default
install_prefix=default
build_type=default
with_boolector=default
Expand Down Expand Up @@ -77,6 +79,15 @@ do
*) build_dir=$(pwd)/$build_dir ;; # make absolute path
esac
;;
--smt-switch-dir) die "missing argument to $1 (see -h)" ;;
--smt-switch-dir=*)
smt_switch_dir=${1##*=}
# Check if this is an absolute path and if not, make it absolute.
case $smt_switch_dir in
/*) ;; # absolute path
*) smt_switch_dir=$(pwd)/$smt_switch_dir ;; # make absolute path
esac
;;
--with-btor) with_boolector=ON;;
--with-msat) with_msat=ON;;
--with-yices2) with_yices2=ON;;
Expand Down Expand Up @@ -109,6 +120,9 @@ done

cmake_opts="-DCMAKE_BUILD_TYPE=$buildtype -DPONO_LIB_TYPE=${lib_type} -DPONO_STATIC_EXEC=${static_exec}"

[ $smt_switch_dir != default ] \
&& cmake_opts="$cmake_opts -DSMT_SWITCH_DIR=${smt_switch_dir}"

[ $install_prefix != default ] \
&& cmake_opts="$cmake_opts -DCMAKE_INSTALL_PREFIX=$install_prefix"

Expand Down
4 changes: 2 additions & 2 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ else()
CACHE STRING "Extra flags to the cython compiler." FORCE)
endif()

include_directories("${PROJECT_SOURCE_DIR}/deps/smt-switch/python/smt_switch")
include_directories("${SMT_SWITCH_DIR}/python/smt_switch")

# Everything from here up to line 'include(FindPythonExtensions)' is copied
# from smt-switch python/CMakefile:
Expand Down Expand Up @@ -105,7 +105,7 @@ add_cython_target(pono CXX)
add_library(pono MODULE ${pono})

target_link_libraries(pono pono-lib)
target_include_directories(pono PUBLIC "${PROJECT_SOURCE_DIR}/deps/smt-switch/local/include/smt-switch")
target_include_directories(pono PUBLIC "${SMT_SWITCH_DIR}/local/include/smt-switch")

python_extension_module(pono)

Expand Down
Loading