Fix type error for rewriting bag.map bag.union_disjoint (#7640)
[cvc5.git] / CMakeLists.txt
1 ###############################################################################
2 # Top contributors (to current version):
3 # Aina Niemetz, Mathias Preiner, Gereon Kremer
4 #
5 # This file is part of the cvc5 project.
6 #
7 # Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
8 # in the top-level source directory and their institutional affiliations.
9 # All rights reserved. See the file COPYING in the top-level source
10 # directory for licensing information.
11 # #############################################################################
12 #
13 # The build system configuration.
14 ##
15
16 cmake_minimum_required(VERSION 3.9)
17
18 #-----------------------------------------------------------------------------#
19 # Project configuration
20
21 project(cvc5)
22
23 include(CheckIPOSupported)
24 include(GNUInstallDirs)
25 set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
26
27 include(version)
28
29 set(CMAKE_C_STANDARD 99)
30 set(CMAKE_CXX_STANDARD 17)
31 set(CMAKE_CXX_EXTENSIONS OFF)
32 set(CMAKE_CXX_STANDARD_REQUIRED ON)
33 set(CMAKE_CXX_VISIBILITY_PRESET hidden)
34 set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
35
36 # Generate compile_commands.json, which can be used for various code completion
37 # plugins.
38 set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
39
40 #-----------------------------------------------------------------------------#
41 # Policies
42
43 # Required for FindGLPK since it sets CMAKE_REQUIRED_LIBRARIES
44 if(POLICY CMP0075)
45 cmake_policy(SET CMP0075 NEW)
46 endif()
47
48 #-----------------------------------------------------------------------------#
49 # Tell CMake where to find our dependencies
50
51 if(GLPK_DIR)
52 list(APPEND CMAKE_PREFIX_PATH "${GLPK_DIR}")
53 endif()
54
55 # By default the contrib/get-* scripts install dependencies to deps/install.
56 list(APPEND CMAKE_PREFIX_PATH "${PROJECT_SOURCE_DIR}/deps/install")
57
58 #-----------------------------------------------------------------------------#
59
60 include(Helpers)
61
62 #-----------------------------------------------------------------------------#
63 # User options
64
65 # License
66 option(ENABLE_GPL "Enable GPL dependencies")
67
68 # General build options
69 #
70 # >> 3-valued: IGNORE ON OFF
71 # > allows to detect if set by user (default: IGNORE)
72 # > only necessary for options set for build types
73 option(BUILD_SHARED_LIBS "Build shared libraries and binary")
74 cvc5_option(ENABLE_ASAN "Enable ASAN build")
75 cvc5_option(ENABLE_UBSAN "Enable UBSan build")
76 cvc5_option(ENABLE_TSAN "Enable TSan build")
77 cvc5_option(ENABLE_ASSERTIONS "Enable assertions")
78 cvc5_option(ENABLE_COMP_INC_TRACK
79 "Enable optimizations for incremental SMT-COMP tracks")
80 cvc5_option(ENABLE_DEBUG_SYMBOLS "Enable debug symbols")
81 cvc5_option(ENABLE_DUMPING "Enable dumping")
82 cvc5_option(ENABLE_MUZZLE "Suppress ALL non-result output")
83 cvc5_option(ENABLE_STATISTICS "Enable statistics")
84 cvc5_option(ENABLE_TRACING "Enable tracing")
85 cvc5_option(ENABLE_UNIT_TESTING "Enable unit testing")
86 cvc5_option(ENABLE_VALGRIND "Enable valgrind instrumentation")
87 cvc5_option(ENABLE_AUTO_DOWNLOAD "Enable automatic download of dependencies")
88 cvc5_option(ENABLE_IPO "Enable interprocedural optimization")
89 # >> 2-valued: ON OFF
90 # > for options where we don't need to detect if set by user (default: OFF)
91 option(ENABLE_BEST "Enable dependencies known to give best performance")
92 option(ENABLE_COVERAGE "Enable support for gcov coverage testing")
93 option(ENABLE_DEBUG_CONTEXT_MM "Enable the debug context memory manager")
94 option(ENABLE_PROFILING "Enable support for gprof profiling")
95
96 # Optional dependencies
97 #
98 # >> 3-valued: IGNORE ON OFF
99 # > allows to detect if set by user (default: IGNORE)
100 # > only necessary for options set for ENABLE_BEST
101 cvc5_option(USE_CLN "Use CLN instead of GMP")
102 cvc5_option(USE_CRYPTOMINISAT "Use CryptoMiniSat SAT solver")
103 cvc5_option(USE_GLPK "Use GLPK simplex solver")
104 cvc5_option(USE_KISSAT "Use Kissat SAT solver")
105 cvc5_option(USE_EDITLINE "Use Editline for better interactive support")
106 # >> 2-valued: ON OFF
107 # > for options where we don't need to detect if set by user (default: OFF)
108 option(USE_POLY "Use LibPoly for polynomial arithmetic")
109 option(USE_COCOA "Use CoCoALib for further polynomial operations")
110 option(USE_PYTHON2 "Force Python 2 (deprecated)")
111
112 # Custom install directories for dependencies
113 # If no directory is provided by the user, we first check if the dependency was
114 # installed via the corresponding contrib/get-* script and if not found, we
115 # check the intalled system version. If the user provides a directory we
116 # immediately fail if the dependency was not found at the specified location.
117 set(GLPK_DIR "" CACHE STRING "Set GLPK install directory")
118
119 # Prepend binaries with prefix on make install
120 set(PROGRAM_PREFIX "" CACHE STRING "Program prefix on make install")
121
122 # Supported language bindings based on new C++ API
123 option(BUILD_BINDINGS_PYTHON "Build Python bindings based on new C++ API ")
124 option(BUILD_BINDINGS_JAVA "Build Java bindings based on new C++ API ")
125
126 # Api documentation
127 option(BUILD_DOCS "Build Api documentation")
128
129 #-----------------------------------------------------------------------------#
130 # Internal cmake variables
131
132 set(OPTIMIZATION_LEVEL 3)
133 set(GPL_LIBS "")
134
135 #-----------------------------------------------------------------------------#
136 # Determine number of threads available, used to configure (default) parallel
137 # execution of custom test targets (can be overriden with ARGS=-jN).
138
139 include(ProcessorCount)
140 ProcessorCount(CTEST_NTHREADS)
141 if(CTEST_NTHREADS EQUAL 0)
142 set(CTEST_NTHREADS 1)
143 endif()
144
145 #-----------------------------------------------------------------------------#
146 # Build types
147
148 # Note: Module CodeCoverage requires the name of the debug build to conform
149 # to cmake standards (first letter uppercase).
150 set(BUILD_TYPES Production Debug Testing Competition)
151
152 if(ENABLE_ASAN OR ENABLE_UBSAN OR ENABLE_TSAN)
153 set(CMAKE_BUILD_TYPE Debug)
154 endif()
155
156 # Set the default build type to Production
157 if(NOT CMAKE_BUILD_TYPE)
158 set(CMAKE_BUILD_TYPE
159 Production CACHE STRING "Options are: ${BUILD_TYPES}" FORCE)
160 # Provide drop down menu options in cmake-gui
161 set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${BUILD_TYPES})
162 endif()
163
164 # Check if specified build type is valid.
165 list(FIND BUILD_TYPES ${CMAKE_BUILD_TYPE} FOUND_BUILD_TYPE)
166 if(${FOUND_BUILD_TYPE} EQUAL -1)
167 message(FATAL_ERROR
168 "'${CMAKE_BUILD_TYPE}' is not a valid build type. "
169 "Available builds are: ${BUILD_TYPES}")
170 endif()
171
172 message(STATUS "Building ${CMAKE_BUILD_TYPE} build")
173 include(Config${CMAKE_BUILD_TYPE})
174
175 #-----------------------------------------------------------------------------#
176 # Compiler flags
177
178 add_check_c_cxx_flag("-O${OPTIMIZATION_LEVEL}")
179 add_check_c_cxx_flag("-Wall")
180 add_check_c_cxx_supression_flag("-Wno-unused-private-field")
181 add_check_c_flag("-fexceptions")
182 add_check_cxx_flag("-Wsuggest-override")
183 add_check_cxx_flag("-Wnon-virtual-dtor")
184 add_check_c_cxx_flag("-Wimplicit-fallthrough")
185 add_check_c_cxx_flag("-Wshadow")
186
187 # Assume no dynamic initialization of thread-local variables in non-defining
188 # translation units. This option should result in better performance and works
189 # around crashing issues with our Windows build.
190 add_check_cxx_flag("-fno-extern-tls-init")
191
192 # Temporarily disable -Wclass-memaccess to suppress 'no trivial copy-assignment'
193 # cdlist.h warnings. Remove when fixed.
194 add_check_cxx_supression_flag("-Wno-class-memaccess")
195
196 if (WIN32)
197 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--stack,100000000")
198 endif ()
199
200 #-----------------------------------------------------------------------------#
201 # Use ld.gold if available
202
203 execute_process(COMMAND ${CMAKE_C_COMPILER}
204 -fuse-ld=gold
205 -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
206 if ("${LD_VERSION}" MATCHES "GNU gold")
207 string(APPEND CMAKE_EXE_LINKER_FLAGS " -fuse-ld=gold")
208 string(APPEND CMAKE_SHARED_LINKER_FLAGS " -fuse-ld=gold")
209 string(APPEND CMAKE_MODULE_LINKER_FLAGS " -fuse-ld=gold")
210 message(STATUS "Using GNU gold linker.")
211 endif ()
212
213 #-----------------------------------------------------------------------------#
214 # Use interprocedural optimization if requested
215
216 if(ENABLE_IPO)
217 set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
218 endif()
219
220 #-----------------------------------------------------------------------------#
221
222 # Only enable unit testing if assertions are enabled. Otherwise, unit tests
223 # that expect AssertionException to be thrown will fail.
224 if(NOT ENABLE_ASSERTIONS)
225 message(STATUS "Disabling unit tests since assertions are disabled.")
226 set(ENABLE_UNIT_TESTING OFF)
227 endif()
228
229 #-----------------------------------------------------------------------------#
230 # Shared/static libraries
231
232 # Embed the installation prefix as an RPATH in the executable such that the
233 # linker can find our libraries (such as libcvc5parser) when executing the
234 # cvc5 binary. This is for example useful when installing cvc5 with a custom
235 # prefix on macOS (e.g. when using homebrew in a non-standard directory). If
236 # we do not set this option, then the linker will not be able to find the
237 # required libraries when trying to run cvc5.
238 #
239 # Also embed the installation prefix of the installed contrib libraries as an
240 # RPATH. This allows to install a dynamically linked binary that depends on
241 # dynamically linked libraries. This is dangerous, as the installed binary
242 # breaks if the contrib library is removed or changes in other ways, we thus
243 # print a big warning and only allow if installing to a custom installation
244 # prefix.
245 #
246 # More information on RPATH in CMake:
247 # https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
248 set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR};${PROJECT_SOURCE_DIR}/deps/install/lib")
249
250 # Set visibility to default if unit tests are enabled
251 if(ENABLE_UNIT_TESTING)
252 set(CMAKE_CXX_VISIBILITY_PRESET default)
253 set(CMAKE_VISIBILITY_INLINES_HIDDEN 0)
254 endif()
255
256 #-----------------------------------------------------------------------------#
257 # Enable the ctest testing framework
258
259 # This needs to be enabled here rather than in subdirectory test in order to
260 # allow calling ctest from the root build directory.
261 enable_testing()
262
263 #-----------------------------------------------------------------------------#
264 # Check options, find packages and configure build.
265
266 if(BUILD_SHARED_LIBS)
267 if (WIN32)
268 set(CMAKE_FIND_LIBRARY_SUFFIXES .dll .lib .a)
269 else()
270 set(CMAKE_FIND_LIBRARY_SUFFIXES .so .dylib .a)
271 endif()
272 else()
273 if (WIN32)
274 set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a .dll)
275 else()
276 set(CMAKE_FIND_LIBRARY_SUFFIXES .a .so .dylib)
277 endif()
278 endif()
279
280 if(USE_PYTHON2)
281 find_package(PythonInterp 2.7 REQUIRED)
282 else()
283 find_package(PythonInterp 3 REQUIRED)
284 endif()
285
286 find_package(GMP 6.1 REQUIRED)
287
288 if(ENABLE_ASAN)
289 # -fsanitize=address requires CMAKE_REQUIRED_FLAGS to be explicitely set,
290 # otherwise the -fsanitize=address check will fail while linking.
291 set(CMAKE_REQUIRED_FLAGS -fsanitize=address)
292 add_required_c_cxx_flag("-fsanitize=address")
293 unset(CMAKE_REQUIRED_FLAGS)
294 add_required_c_cxx_flag("-fno-omit-frame-pointer")
295 add_check_c_cxx_flag("-fsanitize-recover=address")
296 endif()
297
298 if(ENABLE_UBSAN)
299 add_required_c_cxx_flag("-fsanitize=undefined")
300 add_definitions(-DCVC5_USE_UBSAN)
301 endif()
302
303 if(ENABLE_TSAN)
304 # -fsanitize=thread requires CMAKE_REQUIRED_FLAGS to be explicitely set,
305 # otherwise the -fsanitize=thread check will fail while linking.
306 set(CMAKE_REQUIRED_FLAGS -fsanitize=thread)
307 add_required_c_cxx_flag("-fsanitize=thread")
308 unset(CMAKE_REQUIRED_FLAGS)
309 endif()
310
311 if(ENABLE_ASSERTIONS)
312 add_definitions(-DCVC5_ASSERTIONS)
313 else()
314 add_definitions(-DNDEBUG)
315 endif()
316
317 if(ENABLE_COVERAGE)
318 include(CodeCoverage)
319 append_coverage_compiler_flags()
320 add_definitions(-DCVC5_COVERAGE)
321 setup_code_coverage_fastcov(
322 NAME coverage
323 PATH "${PROJECT_SOURCE_DIR}"
324 EXCLUDE "${CMAKE_BINARY_DIR}/deps/*"
325 DEPENDENCIES cvc5-bin
326 )
327 endif()
328
329 if(ENABLE_DEBUG_CONTEXT_MM)
330 add_definitions(-DCVC5_DEBUG_CONTEXT_MEMORY_MANAGER)
331 endif()
332
333 if(ENABLE_DEBUG_SYMBOLS)
334 add_check_c_cxx_flag("-ggdb3")
335 endif()
336
337 if(ENABLE_COMP_INC_TRACK)
338 add_definitions(-DCVC5_SMTCOMP_APPLICATION_TRACK)
339 endif()
340
341 if(ENABLE_MUZZLE)
342 add_definitions(-DCVC5_MUZZLE)
343 endif()
344
345 if(ENABLE_DUMPING)
346 add_definitions(-DCVC5_DUMPING)
347 endif()
348
349 if(ENABLE_PROFILING)
350 add_definitions(-DCVC5_PROFILING)
351 add_check_c_cxx_flag("-pg")
352 endif()
353
354 if(ENABLE_TRACING)
355 add_definitions(-DCVC5_TRACING)
356 endif()
357
358 if(ENABLE_STATISTICS)
359 add_definitions(-DCVC5_STATISTICS_ON)
360 endif()
361
362 if(ENABLE_VALGRIND)
363 find_package(Valgrind REQUIRED)
364 add_definitions(-DCVC5_VALGRIND)
365 endif()
366
367 find_package(CaDiCaL REQUIRED)
368
369 if(USE_CLN)
370 set(GPL_LIBS "${GPL_LIBS} cln")
371 find_package(CLN 1.2.2 REQUIRED)
372 set(CVC5_USE_CLN_IMP 1)
373 set(CVC5_USE_GMP_IMP 0)
374 else()
375 set(CVC5_USE_CLN_IMP 0)
376 set(CVC5_USE_GMP_IMP 1)
377 endif()
378
379 if(USE_CRYPTOMINISAT)
380 # CryptoMiniSat requires pthreads support
381 set(THREADS_PREFER_PTHREAD_FLAG ON)
382 find_package(Threads REQUIRED)
383 if(THREADS_HAVE_PTHREAD_ARG)
384 add_c_cxx_flag(-pthread)
385 endif()
386 find_package(CryptoMiniSat 5.8 REQUIRED)
387 add_definitions(-DCVC5_USE_CRYPTOMINISAT)
388 endif()
389
390 if(USE_GLPK)
391 set(GPL_LIBS "${GPL_LIBS} glpk")
392 find_package(GLPK REQUIRED)
393 add_definitions(-DCVC5_USE_GLPK)
394 endif()
395
396 if(USE_KISSAT)
397 find_package(Kissat REQUIRED)
398 add_definitions(-DCVC5_USE_KISSAT)
399 endif()
400
401 if(USE_POLY)
402 find_package(Poly REQUIRED)
403 add_definitions(-DCVC5_USE_POLY)
404 set(CVC5_USE_POLY_IMP 1)
405 else()
406 set(CVC5_USE_POLY_IMP 0)
407 endif()
408
409 if(USE_COCOA)
410 find_package(CoCoA REQUIRED 0.99711)
411 add_definitions(-DCVC5_USE_COCOA)
412 endif()
413
414 if(USE_EDITLINE)
415 find_package(Editline REQUIRED)
416 set(HAVE_LIBEDITLINE 1)
417 if(Editline_COMPENTRY_FUNC_RETURNS_CHARPTR)
418 set(EDITLINE_COMPENTRY_FUNC_RETURNS_CHARP 1)
419 endif()
420 endif()
421
422 find_package(SymFPU REQUIRED)
423
424 if(GPL_LIBS)
425 if(NOT ENABLE_GPL)
426 message(FATAL_ERROR
427 "Bad configuration detected: BSD-licensed code only, but also requested "
428 "GPLed libraries: ${GPL_LIBS}")
429 endif()
430 set(CVC5_GPL_DEPS 1)
431 endif()
432
433 #-----------------------------------------------------------------------------#
434 # Provide targets to inspect iwyu suggestions
435
436 include(IWYU)
437 include(fuzzing-murxla)
438
439 #-----------------------------------------------------------------------------#
440
441 include(ConfigureCvc5)
442 if(BUILD_SHARED_LIBS)
443 set(CVC5_STATIC_BUILD OFF)
444 else()
445 set(CVC5_STATIC_BUILD ON)
446 endif()
447
448 #-----------------------------------------------------------------------------#
449 # Add subdirectories
450
451 add_subdirectory(src)
452
453 if(BUILD_BINDINGS_PYTHON AND NOT BUILD_SHARED_LIBS)
454 message(STATUS "Python bindings can only be built in a shared build.")
455 set(BUILD_BINDINGS_PYTHON OFF)
456 endif()
457 if(BUILD_BINDINGS_PYTHON)
458 set(BUILD_BINDINGS_PYTHON_VERSION ${PYTHON_VERSION_MAJOR})
459 add_subdirectory(src/api/python)
460 endif()
461
462 if(BUILD_BINDINGS_JAVA)
463 add_subdirectory(src/api/java)
464 message(WARNING "Java API is currently under development.")
465 endif()
466
467 if(BUILD_DOCS)
468 add_subdirectory(docs)
469 endif()
470
471 add_subdirectory(test)
472
473 include(target-graphs)
474
475 #-----------------------------------------------------------------------------#
476 # Package configuration
477 #
478 # Export cvc5 targets to support find_package(cvc5) in other cmake projects.
479
480 include(CMakePackageConfigHelpers)
481
482 # If we install a dynamically linked binary that also uses dynamically used
483 # libraries from deps/install/lib, we need to be cautious. Changing these
484 # shared libraries from deps/install/lib most probably breaks the binary.
485 # We only allow such an installation for custom installation prefixes
486 # (in the assumption that only reasonably experienced users use this and
487 # also that custom installation prefixes are not used for longer periods of
488 # time anyway). Also, we print a big warning with further instructions.
489 if(BUILD_SHARED_LIBS)
490 # Get the libraries that cvc5 links against
491 get_target_property(libs cvc5 INTERFACE_LINK_LIBRARIES)
492 set(LIBS_SHARED_FROM_DEPS "")
493 foreach(lib ${libs})
494 # Filter out those that are linked dynamically and come from deps/install
495 if(lib MATCHES ".*/deps/install/lib/.*\.so")
496 list(APPEND LIBS_SHARED_FROM_DEPS ${lib})
497 endif()
498 endforeach()
499 list(LENGTH LIBS_SHARED_FROM_DEPS list_len)
500 # Check if we actually use such "dangerous" libraries
501 if(list_len GREATER 0)
502 # Print a generic warning
503 install(CODE "message(WARNING \"You are installing a dynamically linked \
504 binary of cvc5 which may be a problem if you are using any dynamically \
505 linked third-party library that you obtained through one of the \
506 contrib/get-xxx scripts. The binary uses the rpath mechanism to find these \
507 locally, hence executing such a contrib script removing the \
508 \\\"deps/install\\\" folder most probably breaks the installed binary! \
509 Consider installing the dynamically linked dependencies on your system \
510 manually or link cvc5 statically.\")")
511 # Print the libraries in question
512 foreach(lib ${LIBS_SHARED_FROM_DEPS})
513 install(CODE "message(WARNING \"The following library is used by the cvc5 binary: ${lib}\")")
514 endforeach()
515 # Check if we use a custom installation prefix
516 if(CMAKE_INSTALL_PREFIX STREQUAL "/usr/local")
517 install(CODE "message(FATAL_ERROR \"To avoid installing a \
518 soon-to-be-broken binary, system-wide installation is disabled if the \
519 binary depends on locally-built shared libraries.\")")
520 else()
521 install(CODE "message(WARNING \"You have selected a custom install \
522 directory ${CMAKE_INSTALL_PREFIX}, so we expect you understood the \
523 previous warning and know what you are doing.\")")
524 endif()
525 endif()
526 endif()
527
528 install(EXPORT cvc5-targets
529 FILE cvc5Targets.cmake
530 NAMESPACE cvc5::
531 DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cvc5)
532
533 configure_package_config_file(
534 ${CMAKE_SOURCE_DIR}/cmake/cvc5Config.cmake.in
535 ${CMAKE_BINARY_DIR}/cmake/cvc5Config.cmake
536 INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cvc5
537 PATH_VARS CMAKE_INSTALL_LIBDIR
538 )
539
540 write_basic_package_version_file(
541 ${CMAKE_CURRENT_BINARY_DIR}/cvc5ConfigVersion.cmake
542 VERSION ${CVC5_VERSION}
543 COMPATIBILITY ExactVersion
544 )
545
546 install(FILES
547 ${CMAKE_BINARY_DIR}/cmake/cvc5Config.cmake
548 ${CMAKE_BINARY_DIR}/cvc5ConfigVersion.cmake
549 DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cvc5
550 )
551
552
553 #-----------------------------------------------------------------------------#
554 # Print build configuration
555
556 # Set colors.
557 if(NOT WIN32)
558 string(ASCII 27 Esc)
559 set(Green "${Esc}[32m")
560 set(Blue "${Esc}[1;34m")
561 set(ResetColor "${Esc}[m")
562 endif()
563
564 # Convert build type to lower case.
565 string(TOLOWER ${CMAKE_BUILD_TYPE} CVC5_BUILD_PROFILE_STRING)
566
567 # Get all definitions added via add_definitions.
568 get_directory_property(CVC5_DEFINITIONS COMPILE_DEFINITIONS)
569 string(REPLACE ";" " " CVC5_DEFINITIONS "${CVC5_DEFINITIONS}")
570
571 message("")
572 print_info("cvc5 ${CVC5_VERSION}")
573 message("")
574 if(ENABLE_COMP_INC_TRACK)
575 print_config("Build profile " "${CVC5_BUILD_PROFILE_STRING} (incremental)")
576 else()
577 print_config("Build profile " "${CVC5_BUILD_PROFILE_STRING}")
578 endif()
579 message("")
580 print_config("GPL " ${ENABLE_GPL})
581 print_config("Best configuration " ${ENABLE_BEST})
582 message("")
583 print_config("Assertions " ${ENABLE_ASSERTIONS})
584 print_config("Debug symbols " ${ENABLE_DEBUG_SYMBOLS})
585 print_config("Debug context mem mgr " ${ENABLE_DEBUG_CONTEXT_MM})
586 message("")
587 print_config("Dumping " ${ENABLE_DUMPING})
588 print_config("Muzzle " ${ENABLE_MUZZLE})
589 print_config("Statistics " ${ENABLE_STATISTICS})
590 print_config("Tracing " ${ENABLE_TRACING})
591 message("")
592 print_config("ASan " ${ENABLE_ASAN})
593 print_config("UBSan " ${ENABLE_UBSAN})
594 print_config("TSan " ${ENABLE_TSAN})
595 print_config("Coverage (gcov) " ${ENABLE_COVERAGE})
596 print_config("Profiling (gprof) " ${ENABLE_PROFILING})
597 print_config("Unit tests " ${ENABLE_UNIT_TESTING})
598 print_config("Valgrind " ${ENABLE_VALGRIND})
599 message("")
600 print_config("Shared build " ${BUILD_SHARED_LIBS})
601 print_config("Python bindings " ${BUILD_BINDINGS_PYTHON})
602 print_config("Java bindings " ${BUILD_BINDINGS_JAVA})
603 print_config("Python2 " ${USE_PYTHON2})
604 print_config("Interprocedural opt. " ${ENABLE_IPO})
605 message("")
606 print_config("CryptoMiniSat " ${USE_CRYPTOMINISAT} FOUND_SYSTEM ${CryptoMiniSat_FOUND_SYSTEM})
607 print_config("GLPK " ${USE_GLPK})
608 print_config("Kissat " ${USE_KISSAT} FOUND_SYSTEM ${Kissat_FOUND_SYSTEM})
609 print_config("LibPoly " ${USE_POLY} FOUND_SYSTEM ${Poly_FOUND_SYSTEM})
610 print_config("CoCoALib " ${USE_COCOA} FOUND_SYSTEM ${CoCoA_FOUND_SYSTEM})
611
612 if(CVC5_USE_CLN_IMP)
613 print_config("MP library " "cln" FOUND_SYSTEM ${CLN_FOUND_SYSTEM})
614 else()
615 print_config("MP library " "gmp" FOUND_SYSTEM ${GMP_FOUND_SYSTEM})
616 endif()
617 print_config("Editline " ${USE_EDITLINE})
618 message("")
619 print_config("Api docs " ${BUILD_DOCS})
620 message("")
621 if(GLPK_DIR)
622 print_config("GLPK dir " ${GLPK_DIR})
623 endif()
624 message("")
625 print_config("CPPLAGS (-D...)" "${CVC5_DEFINITIONS}")
626 print_config("CXXFLAGS " "${CMAKE_CXX_FLAGS}")
627 print_config("CFLAGS " "${CMAKE_C_FLAGS}")
628 print_config("Linker flags " "${CMAKE_EXE_LINKER_FLAGS}")
629 message("")
630 print_config("Install prefix " "${CMAKE_INSTALL_PREFIX}")
631 message("")
632
633 if(GPL_LIBS)
634 message(
635 "${Blue}cvc5 license: "
636 "${Yellow}GPLv3 (due to optional libraries; see below)${ResetColor}"
637 "\n"
638 "\n"
639 "Please note that cvc5 will be built against the following GPLed libraries:"
640 "\n"
641 "${GPL_LIBS}"
642 "\n"
643 "As these libraries are covered under the GPLv3, so is this build of cvc5."
644 "\n"
645 "cvc5 is also available to you under the terms of the (modified) BSD license."
646 "\n"
647 "If you prefer to license cvc5 under those terms, please configure cvc5 to"
648 "\n"
649 "disable all optional GPLed library dependencies (-DENABLE_BSD_ONLY=ON)."
650 )
651 else()
652 message(
653 "${Blue}cvc5 license:${ResetColor} modified BSD"
654 "\n"
655 "\n"
656 "Note that this configuration is NOT built against any GPL'ed libraries, so"
657 "\n"
658 "it is covered by the (modified) BSD license. To build against GPL'ed"
659 "\n"
660 "libraries which can improve cvc5's performance on arithmetic and bitvector"
661 "\n"
662 "logics, re-configure with '-DENABLE_GPL -DENABLE_BEST'."
663 )
664 endif()
665
666 if("${CMAKE_GENERATOR}" STREQUAL "Ninja")
667 set(BUILD_COMMAND_NAME "ninja")
668 else()
669 set(BUILD_COMMAND_NAME "make")
670 endif()
671
672 message("")
673 message("Now just type '${BUILD_COMMAND_NAME}', "
674 "followed by '${BUILD_COMMAND_NAME} check' "
675 "or '${BUILD_COMMAND_NAME} install'.")
676 message("")