Skip to content

Commit

Permalink
Configurable smt-switch directory
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanoKobalamyne committed Jul 4, 2024
1 parent c980d66 commit fc629ce
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ message("-- FOUND FLEX INCLUDE DIRS: ${FLEX_INCLUDE_DIRS}")
# 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
13 changes: 12 additions & 1 deletion 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-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)
Expand All @@ -33,6 +34,7 @@ die () {
}

build_dir=build
smt_switch_dir=$(pwd)/deps/smt-switch
install_prefix=default
build_type=default
with_msat=default
Expand Down Expand Up @@ -71,6 +73,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-msat) with_msat=ON;;
--with-msat-ic3ia) with_msat_ic3ia=ON;;
--with-coreir) with_coreir=ON;;
Expand Down Expand Up @@ -98,7 +109,7 @@ done
[ $lib_type = STATIC ] && [ $with_coreir = ON -o $with_coreir_extern = ON ] && \
die "CoreIR and static build are incompatible, must omit either '--static/--static-lib' or '--with-coreir/--with-coreir-extern'"

cmake_opts="-DCMAKE_BUILD_TYPE=$buildtype -DPONO_LIB_TYPE=${lib_type} -DPONO_STATIC_EXEC=${static_exec}"
cmake_opts="-DCMAKE_BUILD_TYPE=$buildtype -DPONO_LIB_TYPE=${lib_type} -DPONO_STATIC_EXEC=${static_exec} -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

0 comments on commit fc629ce

Please sign in to comment.