Expand the definition of a "simple" farkas proof.
[cvc5.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 3.2)
2
3 #-----------------------------------------------------------------------------#
4 # Project configuration
5
6 project(cvc4)
7
8 set(CVC4_MAJOR 1) # Major component of the version of CVC4.
9 set(CVC4_MINOR 8) # Minor component of the version of CVC4.
10 set(CVC4_RELEASE 0) # Release component of the version of CVC4.
11
12 # Extraversion component of the version of CVC4.
13 set(CVC4_EXTRAVERSION "-prerelease")
14
15 # Shared library versioning. Increment SOVERSION for every new CVC4 release.
16 set(CVC4_SOVERSION 6)
17
18 # Full release string for CVC4.
19 if(CVC4_RELEASE)
20 set(CVC4_RELEASE_STRING
21 "${CVC4_MAJOR}.${CVC4_MINOR}.${CVC4_RELEASE}${CVC4_EXTRAVERSION}")
22 else()
23 set(CVC4_RELEASE_STRING "${CVC4_MAJOR}.${CVC4_MINOR}${CVC4_EXTRAVERSION}")
24 endif()
25
26 set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
27 set(CMAKE_C_STANDARD 99)
28 set(CMAKE_CXX_STANDARD 11)
29 set(CMAKE_CXX_EXTENSIONS OFF)
30
31 # Generate compile_commands.json, which can be used for various code completion
32 # plugins.
33 set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
34
35 #-----------------------------------------------------------------------------#
36 # Policies
37
38 # Required for FindGLPK since it sets CMAKE_REQUIRED_LIBRARIES
39 if(POLICY CMP0075)
40 cmake_policy(SET CMP0075 NEW)
41 endif()
42
43 #-----------------------------------------------------------------------------#
44 # Tell CMake where to find our dependencies
45
46 if(ABC_DIR)
47 list(APPEND CMAKE_PREFIX_PATH "${ABC_DIR}")
48 endif()
49 if(ANTLR_DIR)
50 list(APPEND CMAKE_PREFIX_PATH "${ANTLR_DIR}")
51 endif()
52 if(CADICAL_DIR)
53 list(APPEND CMAKE_PREFIX_PATH "${CADICAL_DIR}")
54 endif()
55 if(CRYPTOMINISAT_DIR)
56 list(APPEND CMAKE_PREFIX_PATH "${CRYPTOMINISAT_DIR}")
57 endif()
58 if(CXXTEST_DIR)
59 list(APPEND CMAKE_PREFIX_PATH "${CXXTEST_DIR}")
60 endif()
61 if(DRAT2ER_DIR)
62 list(APPEND CMAKE_PREFIX_PATH "${DRAT2ER_DIR}")
63 endif()
64 if(GLPK_DIR)
65 list(APPEND CMAKE_PREFIX_PATH "${GLPK_DIR}")
66 endif()
67 if(GMP_DIR)
68 list(APPEND CMAKE_PREFIX_PATH "${GMP_DIR}")
69 endif()
70 if(LFSC_DIR)
71 list(APPEND CMAKE_PREFIX_PATH "${LFSC_DIR}")
72 endif()
73 if(SYMFPU_DIR)
74 list(APPEND CMAKE_PREFIX_PATH "${SYMFPU_DIR}")
75 endif()
76
77 # By default the contrib/get-* scripts install dependencies to deps/install.
78 list(APPEND CMAKE_PREFIX_PATH "${PROJECT_SOURCE_DIR}/deps/install")
79
80 #-----------------------------------------------------------------------------#
81
82 set(INCLUDE_INSTALL_DIR include)
83 set(LIBRARY_INSTALL_DIR lib)
84 set(RUNTIME_INSTALL_DIR bin)
85
86 #-----------------------------------------------------------------------------#
87
88 # Embed the installation prefix as an RPATH in the executable such that the
89 # linker can find our libraries (such as libcvc4parser) when executing the cvc4
90 # binary. This is for example useful when installing CVC4 with a custom prefix
91 # on macOS (e.g. when using homebrew in a non-standard directory). If we do not
92 # set this option, then the linker will not be able to find the required
93 # libraries when trying to run CVC4.
94 #
95 # More information on RPATH in CMake:
96 # https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
97 set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIBRARY_INSTALL_DIR}")
98
99 #-----------------------------------------------------------------------------#
100
101 include(Helpers)
102
103 #-----------------------------------------------------------------------------#
104 # User options
105
106 # License
107 option(ENABLE_GPL "Enable GPL dependencies")
108
109 # General build options
110 #
111 # >> 3-valued: IGNORE ON OFF
112 # > allows to detect if set by user (default: IGNORE)
113 # > only necessary for options set for build types
114 cvc4_option(ENABLE_ASAN "Enable ASAN build")
115 cvc4_option(ENABLE_UBSAN "Enable UBSan build")
116 cvc4_option(ENABLE_TSAN "Enable TSan build")
117 cvc4_option(ENABLE_ASSERTIONS "Enable assertions")
118 cvc4_option(ENABLE_COMP_INC_TRACK
119 "Enable optimizations for incremental SMT-COMP tracks")
120 cvc4_option(ENABLE_DEBUG_SYMBOLS "Enable debug symbols")
121 cvc4_option(ENABLE_DUMPING "Enable dumping")
122 cvc4_option(ENABLE_MUZZLE "Suppress ALL non-result output")
123 cvc4_option(ENABLE_PROOFS "Enable proof support")
124 cvc4_option(ENABLE_REPLAY "Enable the replay feature")
125 cvc4_option(ENABLE_STATISTICS "Enable statistics")
126 cvc4_option(ENABLE_TRACING "Enable tracing")
127 cvc4_option(ENABLE_UNIT_TESTING "Enable unit testing")
128 cvc4_option(ENABLE_VALGRIND "Enable valgrind instrumentation")
129 cvc4_option(ENABLE_SHARED "Build as shared library")
130 cvc4_option(ENABLE_STATIC_BINARY
131 "Build static binaries with statically linked system libraries")
132 # >> 2-valued: ON OFF
133 # > for options where we don't need to detect if set by user (default: OFF)
134 option(ENABLE_BEST "Enable dependencies known to give best performance")
135 option(ENABLE_COVERAGE "Enable support for gcov coverage testing")
136 option(ENABLE_DEBUG_CONTEXT_MM "Enable the debug context memory manager")
137 option(ENABLE_PROFILING "Enable support for gprof profiling")
138
139 # Optional dependencies
140 #
141 # >> 3-valued: IGNORE ON OFF
142 # > allows to detect if set by user (default: IGNORE)
143 # > only necessary for options set for ENABLE_BEST
144 cvc4_option(USE_ABC "Use ABC for AIG bit-blasting")
145 cvc4_option(USE_CADICAL "Use CaDiCaL SAT solver")
146 cvc4_option(USE_CLN "Use CLN instead of GMP")
147 cvc4_option(USE_GLPK "Use GLPK simplex solver")
148 cvc4_option(USE_CRYPTOMINISAT "Use CryptoMiniSat SAT solver")
149 cvc4_option(USE_READLINE "Use readline for better interactive support")
150 # >> 2-valued: ON OFF
151 # > for options where we don't need to detect if set by user (default: OFF)
152 option(USE_DRAT2ER "Include drat2er for making eager BV proofs")
153 option(USE_LFSC "Use LFSC proof checker")
154 option(USE_SYMFPU "Use SymFPU for floating point support")
155 option(USE_PYTHON2 "Prefer using Python 2 (for Python bindings)")
156 option(USE_PYTHON3 "Prefer using Python 3 (for Python bindings)")
157
158 # Custom install directories for dependencies
159 # If no directory is provided by the user, we first check if the dependency was
160 # installed via the corresponding contrib/get-* script and if not found, we
161 # check the intalled system version. If the user provides a directory we
162 # immediately fail if the dependency was not found at the specified location.
163 set(ABC_DIR "" CACHE STRING "Set ABC install directory")
164 set(ANTLR_DIR "" CACHE STRING "Set ANTLR3 install directory")
165 set(CADICAL_DIR "" CACHE STRING "Set CaDiCaL install directory")
166 set(CRYPTOMINISAT_DIR "" CACHE STRING "Set CryptoMiniSat install directory")
167 set(CXXTEST_DIR "" CACHE STRING "Set CxxTest install directory")
168 set(DRAT2ER_DIR "" CACHE STRING "Set drat2er install directory")
169 set(GLPK_DIR "" CACHE STRING "Set GLPK install directory")
170 set(GMP_DIR "" CACHE STRING "Set GMP install directory")
171 set(LFSC_DIR "" CACHE STRING "Set LFSC install directory")
172 set(SYMFPU_DIR "" CACHE STRING "Set SymFPU install directory")
173
174 # Prepend binaries with prefix on make install
175 set(PROGRAM_PREFIX "" CACHE STRING "Program prefix on make install")
176
177 # Supported SWIG language bindings
178 option(BUILD_SWIG_BINDINGS_JAVA "Build Java bindings with SWIG")
179 option(BUILD_SWIG_BINDINGS_PYTHON "Build Python bindings with SWIG")
180
181 # Supprted language bindings based on new C++ API
182 option(BUILD_BINDINGS_PYTHON "Build Python bindings based on new C++ API ")
183
184 #-----------------------------------------------------------------------------#
185 # Internal cmake variables
186
187 set(OPTIMIZATION_LEVEL 3)
188 set(GPL_LIBS "")
189
190 #-----------------------------------------------------------------------------#
191 # Determine number of threads available, used to configure (default) parallel
192 # execution of custom test targets (can be overriden with ARGS=-jN).
193
194 include(ProcessorCount)
195 ProcessorCount(CTEST_NTHREADS)
196 if(CTEST_NTHREADS EQUAL 0)
197 set(CTEST_NTHREADS 1)
198 endif()
199
200 #-----------------------------------------------------------------------------#
201 # Build types
202
203 # Note: Module CodeCoverage requires the name of the debug build to conform
204 # to cmake standards (first letter uppercase).
205 set(BUILD_TYPES Production Debug Testing Competition)
206
207 if(ENABLE_ASAN OR ENABLE_UBSAN OR ENABLE_TSAN)
208 set(CMAKE_BUILD_TYPE Debug)
209 endif()
210
211 # Set the default build type to Production
212 if(NOT CMAKE_BUILD_TYPE)
213 set(CMAKE_BUILD_TYPE
214 Production CACHE STRING "Options are: ${BUILD_TYPES}" FORCE)
215 # Provide drop down menu options in cmake-gui
216 set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${BUILD_TYPES})
217 endif()
218
219 # Check if specified build type is valid.
220 list(FIND BUILD_TYPES ${CMAKE_BUILD_TYPE} FOUND_BUILD_TYPE)
221 if(${FOUND_BUILD_TYPE} EQUAL -1)
222 message(FATAL_ERROR
223 "'${CMAKE_BUILD_TYPE}' is not a valid build type. "
224 "Available builds are: ${BUILD_TYPES}")
225 endif()
226
227 message(STATUS "Building ${CMAKE_BUILD_TYPE} build")
228 include(Config${CMAKE_BUILD_TYPE})
229
230 #-----------------------------------------------------------------------------#
231 # Compiler flags
232
233 add_check_c_cxx_flag("-O${OPTIMIZATION_LEVEL}")
234 add_check_c_cxx_flag("-Wall")
235 add_check_c_flag("-fexceptions")
236 add_check_c_cxx_flag("-Wno-deprecated")
237 add_check_cxx_flag("-Wsuggest-override")
238 add_check_cxx_flag("-Wnon-virtual-dtor")
239 add_check_c_cxx_flag("-Wimplicit-fallthrough")
240 add_check_c_cxx_flag("-Wshadow")
241
242 # Temporarily disable -Wclass-memaccess to suppress 'no trivial copy-assignment'
243 # cdlist.h warnings. Remove when fixed.
244 add_check_cxx_flag("-Wno-class-memaccess")
245
246 if (WIN32)
247 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--stack,100000000")
248 endif ()
249
250 #-----------------------------------------------------------------------------#
251 # Use ld.gold if available
252
253 execute_process(COMMAND ${CMAKE_C_COMPILER}
254 -fuse-ld=gold
255 -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
256 if ("${LD_VERSION}" MATCHES "GNU gold")
257 string(APPEND CMAKE_EXE_LINKER_FLAGS " -fuse-ld=gold")
258 string(APPEND CMAKE_SHARED_LINKER_FLAGS " -fuse-ld=gold")
259 string(APPEND CMAKE_MODULE_LINKER_FLAGS " -fuse-ld=gold")
260 message(STATUS "Using GNU gold linker.")
261 endif ()
262
263 #-----------------------------------------------------------------------------#
264 # Option defaults (three-valued options (cvc4_option(...)))
265 #
266 # These options are only set if their value is IGNORE. Otherwise, the user
267 # already set the option, which we don't want to overwrite.
268
269 if(ENABLE_STATIC_BINARY)
270 cvc4_set_option(ENABLE_SHARED OFF)
271 else()
272 cvc4_set_option(ENABLE_SHARED ON)
273 endif()
274
275 #-----------------------------------------------------------------------------#
276 # Set options for best configuration
277
278 if(ENABLE_BEST)
279 cvc4_set_option(USE_ABC ON)
280 cvc4_set_option(USE_CADICAL ON)
281 cvc4_set_option(USE_CLN ON)
282 cvc4_set_option(USE_CRYPTOMINISAT ON)
283 cvc4_set_option(USE_GLPK ON)
284 cvc4_set_option(USE_READLINE ON)
285 endif()
286
287 # Only enable unit testing if assertions are enabled. Otherwise, unit tests
288 # that expect AssertionException to be thrown will fail.
289 if(NOT ENABLE_ASSERTIONS)
290 set(ENABLE_UNIT_TESTING OFF)
291 endif()
292
293 #-----------------------------------------------------------------------------#
294 # Shared/static libraries
295 #
296 # This needs to be set before any find_package(...) command since we want to
297 # search for static libraries with suffix .a.
298
299 if(ENABLE_SHARED)
300 set(BUILD_SHARED_LIBS ON)
301 if(ENABLE_STATIC_BINARY)
302 set(ENABLE_STATIC_BINARY OFF)
303 message(WARNING "Disabling static binary since shared build is enabled.")
304 endif()
305 else()
306 set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
307 set(BUILD_SHARED_LIBS OFF)
308 cvc4_set_option(ENABLE_STATIC_BINARY ON)
309
310 # Never build unit tests as static binaries, otherwise we'll end up with
311 # ~300MB per unit test.
312 if(ENABLE_UNIT_TESTING)
313 message(WARNING "Disabling unit tests since static build is enabled.")
314 set(ENABLE_UNIT_TESTING OFF)
315 endif()
316 endif()
317
318 #-----------------------------------------------------------------------------#
319 # Enable the ctest testing framework
320
321 # This needs to be enabled here rather than in subdirectory test in order to
322 # allow calling ctest from the root build directory.
323 enable_testing()
324
325 #-----------------------------------------------------------------------------#
326 # Check GCC version.
327 #
328 # GCC version 4.5.1 builds MiniSat incorrectly with -O2, which results in
329 # incorrect answers.
330
331 if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
332 execute_process(
333 COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
334 OUTPUT_VARIABLE GCC_VERSION
335 OUTPUT_STRIP_TRAILING_WHITESPACE)
336 if(GCC_VERSION VERSION_EQUAL "4.5.1")
337 message(FATAL_ERROR
338 "GCC 4.5.1's optimizer is known to build MiniSat incorrectly "
339 "(and by extension CVC4).")
340 endif()
341 endif()
342
343 #-----------------------------------------------------------------------------#
344 # Check options, find packages and configure build.
345
346 if(USE_PYTHON2)
347 find_package(PythonInterp 2.7 REQUIRED)
348 elseif(USE_PYTHON3)
349 find_package(PythonInterp 3 REQUIRED)
350 else()
351 find_package(PythonInterp REQUIRED)
352 endif()
353
354 find_package(GMP REQUIRED)
355
356 if(ENABLE_ASAN)
357 # -fsanitize=address requires CMAKE_REQUIRED_FLAGS to be explicitely set,
358 # otherwise the -fsanitize=address check will fail while linking.
359 set(CMAKE_REQUIRED_FLAGS -fsanitize=address)
360 add_required_c_cxx_flag("-fsanitize=address")
361 unset(CMAKE_REQUIRED_FLAGS)
362 add_required_c_cxx_flag("-fno-omit-frame-pointer")
363 add_check_c_cxx_flag("-fsanitize-recover=address")
364 endif()
365
366 if(ENABLE_UBSAN)
367 add_required_c_cxx_flag("-fsanitize=undefined")
368 add_definitions(-DCVC4_USE_UBSAN)
369 endif()
370
371 if(ENABLE_TSAN)
372 # -fsanitize=thread requires CMAKE_REQUIRED_FLAGS to be explicitely set,
373 # otherwise the -fsanitize=thread check will fail while linking.
374 set(CMAKE_REQUIRED_FLAGS -fsanitize=thread)
375 add_required_c_cxx_flag("-fsanitize=thread")
376 unset(CMAKE_REQUIRED_FLAGS)
377 endif()
378
379 if(ENABLE_ASSERTIONS)
380 add_definitions(-DCVC4_ASSERTIONS)
381 else()
382 add_definitions(-DNDEBUG)
383 endif()
384
385 if(ENABLE_COVERAGE)
386 include(CodeCoverage)
387 APPEND_COVERAGE_COMPILER_FLAGS()
388 add_definitions(-DCVC4_COVERAGE)
389 # Note: The ctest command returns a non-zero exit code if tests fail or run
390 # into a timeout. As a consequence, the coverage report is not generated. To
391 # prevent this we always return with exit code 0 after the ctest command has
392 # finished.
393 setup_target_for_coverage_gcovr_html(
394 NAME coverage
395 EXECUTABLE
396 ctest -j${CTEST_NTHREADS} -LE "example"
397 --output-on-failure $$ARGS || exit 0
398 DEPENDS
399 build-tests)
400 endif()
401
402 if(ENABLE_DEBUG_CONTEXT_MM)
403 add_definitions(-DCVC4_DEBUG_CONTEXT_MEMORY_MANAGER)
404 endif()
405
406 if(ENABLE_DEBUG_SYMBOLS)
407 add_check_c_cxx_flag("-ggdb3")
408 endif()
409
410 if(ENABLE_COMP_INC_TRACK)
411 add_definitions(-DCVC4_SMTCOMP_APPLICATION_TRACK)
412 endif()
413
414 if(ENABLE_MUZZLE)
415 add_definitions(-DCVC4_MUZZLE)
416 endif()
417
418 if(ENABLE_DUMPING)
419 add_definitions(-DCVC4_DUMPING)
420 endif()
421
422 if(ENABLE_PROFILING)
423 add_definitions(-DCVC4_PROFILING)
424 add_check_c_cxx_flag("-pg")
425 endif()
426
427 if(ENABLE_PROOFS)
428 set(RUN_REGRESSION_ARGS ${RUN_REGRESSION_ARGS} --enable-proof)
429 add_definitions(-DCVC4_PROOF)
430 endif()
431
432 if(ENABLE_REPLAY)
433 add_definitions(-DCVC4_REPLAY)
434 endif()
435
436 if(ENABLE_TRACING)
437 add_definitions(-DCVC4_TRACING)
438 endif()
439
440 if(ENABLE_STATISTICS)
441 add_definitions(-DCVC4_STATISTICS_ON)
442 endif()
443
444 if(ENABLE_VALGRIND)
445 find_package(Valgrind REQUIRED)
446 add_definitions(-DCVC4_VALGRIND)
447 endif()
448
449 if(USE_ABC)
450 find_package(ABC REQUIRED)
451 add_definitions(-DCVC4_USE_ABC ${ABC_ARCH_FLAGS})
452 endif()
453
454 if(USE_CADICAL)
455 find_package(CaDiCaL REQUIRED)
456 add_definitions(-DCVC4_USE_CADICAL)
457 endif()
458
459 if(USE_CLN)
460 set(GPL_LIBS "${GPL_LIBS} cln")
461 find_package(CLN 1.2.2 REQUIRED)
462 set(CVC4_USE_CLN_IMP 1)
463 set(CVC4_USE_GMP_IMP 0)
464 else()
465 set(CVC4_USE_CLN_IMP 0)
466 set(CVC4_USE_GMP_IMP 1)
467 endif()
468
469 if(USE_CRYPTOMINISAT)
470 # CryptoMiniSat requires pthreads support
471 set(THREADS_PREFER_PTHREAD_FLAG ON)
472 find_package(Threads REQUIRED)
473 if(THREADS_HAVE_PTHREAD_ARG)
474 add_c_cxx_flag(-pthread)
475 endif()
476 find_package(CryptoMiniSat REQUIRED)
477 add_definitions(-DCVC4_USE_CRYPTOMINISAT)
478 endif()
479
480 if(USE_DRAT2ER)
481 find_package(Drat2Er REQUIRED)
482 add_definitions(-DCVC4_USE_DRAT2ER)
483 endif()
484
485 if(USE_GLPK)
486 set(GPL_LIBS "${GPL_LIBS} glpk")
487 find_package(GLPK REQUIRED)
488 add_definitions(-DCVC4_USE_GLPK)
489 endif()
490
491 if(USE_LFSC)
492 set(RUN_REGRESSION_ARGS ${RUN_REGRESSION_ARGS} --with-lfsc)
493 find_package(LFSC REQUIRED)
494 add_definitions(-DCVC4_USE_LFSC)
495 endif()
496
497 if(USE_READLINE)
498 set(GPL_LIBS "${GPL_LIBS} readline")
499 find_package(Readline REQUIRED)
500 set(HAVE_LIBREADLINE 1)
501 if(Readline_COMPENTRY_FUNC_RETURNS_CHARPTR)
502 set(READLINE_COMPENTRY_FUNC_RETURNS_CHARP 1)
503 endif()
504 endif()
505
506 if(USE_SYMFPU)
507 find_package(SymFPU REQUIRED)
508 add_definitions(-DCVC4_USE_SYMFPU)
509 set(CVC4_USE_SYMFPU 1)
510 else()
511 set(CVC4_USE_SYMFPU 0)
512 endif()
513
514 if(GPL_LIBS)
515 if(NOT ENABLE_GPL)
516 message(FATAL_ERROR
517 "Bad configuration detected: BSD-licensed code only, but also requested "
518 "GPLed libraries: ${GPL_LIBS}")
519 endif()
520 set(CVC4_GPL_DEPS 1)
521 endif()
522
523 #-----------------------------------------------------------------------------#
524 # Generate CVC4's cvc4autoconfig.h header
525
526 include(ConfigureCVC4)
527 configure_file(cvc4autoconfig.h.in cvc4autoconfig.h)
528 include_directories(${CMAKE_CURRENT_BINARY_DIR})
529
530 #-----------------------------------------------------------------------------#
531 # Add subdirectories
532
533 # signatures needs to come before src since it adds source files to libcvc4.
534 if(ENABLE_PROOFS)
535 add_subdirectory(proofs/signatures)
536 endif()
537
538 add_subdirectory(doc)
539 add_subdirectory(src)
540 add_subdirectory(test)
541
542 if(BUILD_SWIG_BINDINGS_JAVA OR BUILD_SWIG_BINDINGS_PYTHON)
543 add_subdirectory(src/bindings)
544 endif()
545
546 if(BUILD_BINDINGS_PYTHON)
547 add_subdirectory(src/api/python)
548 endif()
549
550 #-----------------------------------------------------------------------------#
551 # Package configuration
552 #
553 # Export CVC4 targets to support find_package(CVC4) in other cmake projects.
554
555 include(CMakePackageConfigHelpers)
556
557 install(EXPORT cvc4-targets
558 FILE CVC4Targets.cmake
559 NAMESPACE CVC4::
560 DESTINATION ${LIBRARY_INSTALL_DIR}/cmake/CVC4)
561
562 configure_package_config_file(
563 ${CMAKE_SOURCE_DIR}/cmake/CVC4Config.cmake.in
564 ${CMAKE_BINARY_DIR}/cmake/CVC4Config.cmake
565 INSTALL_DESTINATION ${LIBRARY_INSTALL_DIR}/cmake/CVC4
566 PATH_VARS LIBRARY_INSTALL_DIR
567 )
568
569 write_basic_package_version_file(
570 ${CMAKE_CURRENT_BINARY_DIR}/CVC4ConfigVersion.cmake
571 VERSION ${CVC4_RELEASE_STRING}
572 COMPATIBILITY ExactVersion
573 )
574
575 install(FILES
576 ${CMAKE_BINARY_DIR}/cmake/CVC4Config.cmake
577 ${CMAKE_BINARY_DIR}/CVC4ConfigVersion.cmake
578 DESTINATION ${LIBRARY_INSTALL_DIR}/cmake/CVC4
579 )
580
581
582 #-----------------------------------------------------------------------------#
583 # Print build configuration
584
585 # Convert build type to lower case.
586 string(TOLOWER ${CMAKE_BUILD_TYPE} CVC4_BUILD_PROFILE_STRING)
587
588 # Get all definitions added via add_definitions.
589 get_directory_property(CVC4_DEFINITIONS COMPILE_DEFINITIONS)
590 string(REPLACE ";" " " CVC4_DEFINITIONS "${CVC4_DEFINITIONS}")
591
592 message("CVC4 ${CVC4_RELEASE_STRING}")
593 message("")
594 if(ENABLE_COMP_INC_TRACK)
595 message("Build profile : ${CVC4_BUILD_PROFILE_STRING} (incremental)")
596 else()
597 message("Build profile : ${CVC4_BUILD_PROFILE_STRING}")
598 endif()
599 message("")
600 print_config("GPL :" ENABLE_GPL)
601 print_config("Best configuration :" ENABLE_BEST)
602 print_config("Optimization level :" OPTIMIZATION_LEVEL)
603 message("")
604 print_config("Assertions :" ENABLE_ASSERTIONS)
605 print_config("Debug symbols :" ENABLE_DEBUG_SYMBOLS)
606 print_config("Debug context mem mgr :" ENABLE_DEBUG_CONTEXT_MM)
607 message("")
608 print_config("Dumping :" ENABLE_DUMPING)
609 print_config("Muzzle :" ENABLE_MUZZLE)
610 print_config("Proofs :" ENABLE_PROOFS)
611 print_config("Replay :" ENABLE_REPLAY)
612 print_config("Statistics :" ENABLE_STATISTICS)
613 print_config("Tracing :" ENABLE_TRACING)
614 message("")
615 print_config("ASan :" ENABLE_ASAN)
616 print_config("UBSan :" ENABLE_UBSAN)
617 print_config("TSan :" ENABLE_TSAN)
618 print_config("Coverage (gcov) :" ENABLE_COVERAGE)
619 print_config("Profiling (gprof) :" ENABLE_PROFILING)
620 print_config("Unit tests :" ENABLE_UNIT_TESTING)
621 print_config("Valgrind :" ENABLE_VALGRIND)
622 message("")
623 print_config("Shared libs :" ENABLE_SHARED)
624 print_config("Static binary :" ENABLE_STATIC_BINARY)
625 print_config("Java SWIG bindings :" BUILD_SWIG_BINDINGS_JAVA)
626 print_config("Python SWIG bindings :" BUILD_SWIG_BINDINGS_PYTHON)
627 print_config("Python bindings :" BUILD_BINDINGS_PYTHON)
628 print_config("Python2 :" USE_PYTHON2)
629 print_config("Python3 :" USE_PYTHON3)
630 message("")
631 print_config("ABC :" USE_ABC)
632 print_config("CaDiCaL :" USE_CADICAL)
633 print_config("CryptoMiniSat :" USE_CRYPTOMINISAT)
634 print_config("drat2er :" USE_DRAT2ER)
635 print_config("GLPK :" USE_GLPK)
636 print_config("LFSC :" USE_LFSC)
637
638 if(CVC4_USE_CLN_IMP)
639 message("MP library : cln")
640 else()
641 message("MP library : gmp")
642 endif()
643 print_config("Readline :" ${USE_READLINE})
644 print_config("SymFPU :" ${USE_SYMFPU})
645 message("")
646 if(ABC_DIR)
647 message("ABC dir : ${ABC_DIR}")
648 endif()
649 if(ANTLR_DIR)
650 message("ANTLR dir : ${ANTLR_DIR}")
651 endif()
652 if(CADICAL_DIR)
653 message("CADICAL dir : ${CADICAL_DIR}")
654 endif()
655 if(CRYPTOMINISAT_DIR)
656 message("CRYPTOMINISAT dir : ${CRYPTOMINISAT_DIR}")
657 endif()
658 if(DRAT2ER_DIR)
659 message("DRAT2ER dir : ${DRAT2ER_DIR}")
660 endif()
661 if(GLPK_DIR)
662 message("GLPK dir : ${GLPK_DIR}")
663 endif()
664 if(GMP_DIR)
665 message("GMP dir : ${GMP_DIR}")
666 endif()
667 if(LFSC_DIR)
668 message("LFSC dir : ${LFSC_DIR}")
669 endif()
670 if(SYMFPU_DIR)
671 message("SYMFPU dir : ${SYMFPU_DIR}")
672 endif()
673 message("")
674 message("CPPLAGS (-D...) : ${CVC4_DEFINITIONS}")
675 message("CXXFLAGS : ${CMAKE_CXX_FLAGS}")
676 message("CFLAGS : ${CMAKE_C_FLAGS}")
677 message("Linker flags : ${CMAKE_EXE_LINKER_FLAGS}")
678 message("")
679 message("Install prefix : ${CMAKE_INSTALL_PREFIX}")
680 message("")
681
682 if(GPL_LIBS)
683 message(
684 "CVC4 license : GPLv3 (due to optional libraries; see below)"
685 "\n"
686 "\n"
687 "Please note that CVC4 will be built against the following GPLed libraries:"
688 "\n"
689 "${GPL_LIBS}"
690 "\n"
691 "As these libraries are covered under the GPLv3, so is this build of CVC4."
692 "\n"
693 "CVC4 is also available to you under the terms of the (modified) BSD license."
694 "\n"
695 "If you prefer to license CVC4 under those terms, please configure CVC4 to"
696 "\n"
697 "disable all optional GPLed library dependencies (-DENABLE_BSD_ONLY=ON)."
698 )
699 else()
700 message(
701 "CVC4 license : modified BSD"
702 "\n"
703 "\n"
704 "Note that this configuration is NOT built against any GPL'ed libraries, so"
705 "\n"
706 "it is covered by the (modified) BSD license. This is, however, not the best"
707 "\n"
708 "performing configuration of CVC4. To build against GPL'ed libraries which"
709 "\n"
710 "improve CVC4's performance, re-configure with '-DENABLE_GPL -DENABLE_BEST'."
711 )
712 endif()
713
714 message("")
715 message("Now just type make, followed by make check or make install.")
716 message("")