summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Preiner <mathias.preiner@gmail.com>2018-08-24 19:27:37 -0700
committerMathias Preiner <mathias.preiner@gmail.com>2018-09-22 16:30:59 -0700
commit0b4926e10f7788f209bbc515e13d1884a8590bb4 (patch)
tree9caa1213bec6b679d7829406cb6f400cad61ebe5
parentcdac01abe2bff167a82f749c8bf7a2d2bcd69498 (diff)
cmake: Add module finder for ABC.
-rw-r--r--CMakeLists.txt17
-rw-r--r--cmake/FindABC.cmake29
2 files changed, 42 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 81e9a0e30..9a2f8ed8a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -146,16 +146,18 @@ cvc4_option(ENABLE_TRACING "Enable tracing")
cvc4_option(ENABLE_UNIT_TESTING "Enable unit testing")
cvc4_option(ENABLE_VALGRIND "Enable valgrind instrumentation")
cvc4_option(ENABLE_SHARED "Build as shared library")
+
# >> 2-valued: ON OFF, for options where we don't need to detect if set by user
-option(ENABLE_COVERAGE "Enable support for gcov coverage testing" OFF)
-option(ENABLE_PROFILING "Enable support for gprof profiling" OFF)
+option(ENABLE_COVERAGE "Enable support for gcov coverage testing")
+option(ENABLE_PROFILING "Enable support for gprof profiling")
# Optional dependencies
+option(USE_ABC "Use ABC for AIG bit-blasting")
option(USE_CADICAL "Use CaDiCaL SAT solver")
option(USE_CLN "Use CLN instead of GMP")
option(USE_CRYPTOMINISAT "Use CryptoMiniSat SAT solver")
option(USE_LFSC "Use LFSC proof checker")
-option(USE_READLINE "Use readline for better interactive support" OFF)
+option(USE_READLINE "Use readline for better interactive support")
option(USE_SYMFPU "Use SymFPU for floating point support")
# Supported language bindings
@@ -338,6 +340,13 @@ if(ENABLE_VALGRIND)
add_definitions(-DCVC4_VALGRIND)
endif()
+if(USE_ABC)
+ find_package(ABC REQUIRED)
+ cvc4_link_library(${ABC_LIBRARIES})
+ include_directories(${ABC_INCLUDE_DIR})
+ add_definitions(-DCVC4_USE_ABC ${ABC_ARCH_FLAGS})
+endif()
+
if(USE_CADICAL)
find_package(CaDiCaL REQUIRED)
cvc4_link_library(${CaDiCaL_LIBRARIES})
@@ -576,7 +585,7 @@ endif()
#message("Multithreaded: ${support_multithreaded}")
message("Portfolio : ${ENABLE_PORTFOLIO}")
message("")
-#message("ABC : ${{with_abc}")
+message("ABC : ${USE_ABC}")
message("CaDiCaL : ${USE_CADICAL}")
message("Cryptominisat : ${USE_CRYPTOMINISAT}")
#message("GLPK : ${USE_GLPK}")
diff --git a/cmake/FindABC.cmake b/cmake/FindABC.cmake
new file mode 100644
index 000000000..406471c52
--- /dev/null
+++ b/cmake/FindABC.cmake
@@ -0,0 +1,29 @@
+# Find ABC
+# ABC_FOUND - system has ABC lib
+# ABC_INCLUDE_DIR - the ABC include directory
+# ABC_LIBRARIES - Libraries needed to use ABC
+# ABC_ARCH_FLAGS - Platform specific compile flags
+
+set(ABC_DEFAULT_HOME "${PROJECT_SOURCE_DIR}/abc/alanmi-abc-53f39c11b58d")
+
+find_path(ABC_INCLUDE_DIR
+ NAMES base/abc/abc.h
+ PATHS ${ABC_DEFAULT_HOME}/src)
+find_library(ABC_LIBRARIES
+ NAMES abc
+ PATHS ${ABC_DEFAULT_HOME})
+find_program(ABC_ARCH_FLAGS_PROG
+ NAMES arch_flags
+ PATHS ${ABC_DEFAULT_HOME})
+
+if(ABC_ARCH_FLAGS_PROG)
+ execute_process(COMMAND ${ABC_ARCH_FLAGS_PROG}
+ OUTPUT_VARIABLE ABC_ARCH_FLAGS)
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(ABC
+ DEFAULT_MSG
+ ABC_INCLUDE_DIR ABC_LIBRARIES ABC_ARCH_FLAGS)
+
+mark_as_advanced(ABC_INCLUDE_DIR ABC_LIBRARIES ABC_ARCH_FLAGS)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback