This PR combines the two configure flags --static and --static-binary into a single --static. Consequently, the two corresponding cmake variables are combined as well. The two variables have been implying each other for some time now and were only used to build not-completely-static binaries for MacOS, which is now done automatically anyway.
include:
- name: ubuntu:production
os: ubuntu-latest
- config: production --auto-download --all-bindings --editline --docs --static-binary
+ config: production --auto-download --all-bindings --editline --docs --static
cache-key: production
python-bindings: true
build-documentation: true
- name: macos:production
os: macos-11
- config: production --auto-download --all-bindings --editline --static-binary
+ config: production --auto-download --all-bindings --editline --static
cache-key: production
python-bindings: true
check-examples: true
cvc5_option(ENABLE_TRACING "Enable tracing")
cvc5_option(ENABLE_UNIT_TESTING "Enable unit testing")
cvc5_option(ENABLE_VALGRIND "Enable valgrind instrumentation")
-cvc5_option(ENABLE_STATIC_LIBRARY "Enable building static library")
-cvc5_option(ENABLE_STATIC_BINARY
- "Build static binaries with statically linked system libraries")
+cvc5_option(ENABLE_STATIC_BUILD "Enable building static libraries and binary")
cvc5_option(ENABLE_AUTO_DOWNLOAD "Enable automatic download of dependencies")
cvc5_option(ENABLE_IPO "Enable interprocedural optimization")
# >> 2-valued: ON OFF
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
-
-#-----------------------------------------------------------------------------#
-# Option defaults (three-valued options (cvc5_option(...)))
-#
-# These options are only set if their value is IGNORE. Otherwise, the user
-# already set the option, which we don't want to overwrite.
-
-if(ENABLE_STATIC_BINARY)
- message(STATUS "Enable static library for static binary build.")
- cvc5_set_option(ENABLE_STATIC_LIBRARY ON)
-endif()
-
#-----------------------------------------------------------------------------#
# Only enable unit testing if assertions are enabled. Otherwise, unit tests
#-----------------------------------------------------------------------------#
include(ConfigureCvc5)
-if(ENABLE_STATIC_BINARY)
+if(ENABLE_STATIC_BUILD)
set(CVC5_STATIC_BUILD ON)
endif()
# (in the assumption that only reasonably experienced users use this and
# also that custom installation prefixes are not used for longer periods of
# time anyway). Also, we print a big warning with further instructions.
-if(NOT ENABLE_STATIC_BINARY)
+if(NOT ENABLE_STATIC_BUILD)
# Get the libraries that cvc5 links against
get_target_property(libs cvc5-shared INTERFACE_LINK_LIBRARIES)
set(LIBS_SHARED_FROM_DEPS "")
print_config("Unit tests " ${ENABLE_UNIT_TESTING})
print_config("Valgrind " ${ENABLE_VALGRIND})
message("")
-print_config("Static library " ${ENABLE_STATIC_LIBRARY})
-print_config("Static binary " ${ENABLE_STATIC_BINARY})
+print_config("Static build " ${ENABLE_STATIC_BUILD})
print_config("Python bindings " ${BUILD_BINDINGS_PYTHON})
print_config("Java bindings " ${BUILD_BINDINGS_JAVA})
print_config("Python2 " ${USE_PYTHON2})
https://github.com/CVC4/homebrew-cvc4 .
Note that linking system libraries statically is
`strongly discouraged <https://developer.apple.com/library/archive/qa/qa1118/_index.html>`_
-on macOS. Using ``./configure.sh --static-binary`` will thus produce a binary
+on macOS. Using ``./configure.sh --static`` will thus produce a binary
that uses static versions of all our dependencies, but is still a dynamically
linked binary.
.. code:: bash
- ./configure.sh --win64 --static-binary <configure options...>
+ ./configure.sh --win64 --static <configure options...>
cd <build_dir> # default is ./build
make # use -jN for parallel build with N threads
.. code::
- ./configure.sh --static-binary <options>
+ ./configure.sh --static <options>
7. Follow remaining steps from `build instructions <#building-cvc5>`_
# enable_muzzle=yes
cvc5_set_option(ENABLE_MUZZLE ON)
# enable_valgrind=no
-cvc5_set_option(ENABLE_STATIC_BINARY ON)
+cvc5_set_option(ENABLE_STATIC_BUILD ON)
cvc5_set_option(ENABLE_UNIT_TESTING OFF)
# By default, we include all dependencies in our competition build that are
check_system_version("ANTLR3")
endif()
-if(ENABLE_STATIC_LIBRARY AND ANTLR3_FOUND_SYSTEM)
+if(ENABLE_STATIC_BUILD AND ANTLR3_FOUND_SYSTEM)
force_static_library()
find_library(ANTLR3_STATIC_LIBRARIES NAMES antlr3c)
if(NOT ANTLR3_STATIC_LIBRARIES)
check_system_version("CLN")
endif()
-if(ENABLE_STATIC_LIBRARY AND CLN_FOUND_SYSTEM)
+if(ENABLE_STATIC_BUILD AND CLN_FOUND_SYSTEM)
force_static_library()
find_library(CLN_STATIC_LIBRARIES NAMES cln)
if(NOT CLN_STATIC_LIBRARIES)
target_link_libraries(CLN_SHARED INTERFACE GMP_SHARED)
-if(ENABLE_STATIC_LIBRARY)
+if(ENABLE_STATIC_BUILD)
add_library(CLN_STATIC STATIC IMPORTED GLOBAL)
set_target_properties(CLN_STATIC PROPERTIES
IMPORTED_LOCATION "${CLN_STATIC_LIBRARIES}"
check_system_version("GMP")
endif()
-if(ENABLE_STATIC_LIBRARY AND GMP_FOUND_SYSTEM)
+if(ENABLE_STATIC_BUILD AND GMP_FOUND_SYSTEM)
force_static_library()
find_library(GMP_STATIC_LIBRARIES NAMES gmp)
if(NOT GMP_STATIC_LIBRARIES)
set_target_properties(GMP_SHARED PROPERTIES IMPORTED_IMPLIB "${GMP_LIBRARIES}")
endif()
-if(ENABLE_STATIC_LIBRARY)
+if(ENABLE_STATIC_BUILD)
add_library(GMP_STATIC STATIC IMPORTED GLOBAL)
set_target_properties(GMP_STATIC PROPERTIES
IMPORTED_LOCATION "${GMP_STATIC_LIBRARIES}"
else()
message(STATUS "Building GMP ${GMP_VERSION}: ${GMP_LIBRARIES}")
add_dependencies(GMP_SHARED GMP-EP)
- if(ENABLE_STATIC_LIBRARY)
+ if(ENABLE_STATIC_BUILD)
add_dependencies(GMP_STATIC GMP-EP)
endif()
endif()
check_system_version("Poly")
endif()
-if(ENABLE_STATIC_LIBRARY AND Poly_FOUND_SYSTEM)
+if(ENABLE_STATIC_BUILD AND Poly_FOUND_SYSTEM)
force_static_library()
find_library(Poly_STATIC_LIBRARIES NAMES poly)
find_library(PolyXX_STATIC_LIBRARIES NAMES polyxx)
set_target_properties(Polyxx_SHARED PROPERTIES IMPORTED_IMPLIB "${PolyXX_LIBRARIES}")
endif()
-if(ENABLE_STATIC_LIBRARY)
+if(ENABLE_STATIC_BUILD)
add_library(Poly_STATIC STATIC IMPORTED GLOBAL)
set_target_properties(Poly_STATIC PROPERTIES
IMPORTED_LOCATION "${Poly_STATIC_LIBRARIES}"
DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
- if(ENABLE_STATIC_LIBRARY)
+ if(ENABLE_STATIC_BUILD)
add_dependencies(Poly_STATIC Poly-EP)
add_dependencies(Polyxx_STATIC Poly-EP)
endif()
Features:
The following flags enable optional features (disable with --no-<option name>).
--static build static libraries and binaries [default=no]
- --static-binary statically link against system libraries
- (must be disabled for static macOS builds) [default=yes]
--auto-download automatically download dependencies if necessary
--debug-symbols include debug symbols
--valgrind Valgrind instrumentation
python_bindings=default
java_bindings=default
editline=default
-static_library=default
-static_binary=default
+static=default
statistics=default
tracing=default
tsan=default
--muzzle) muzzle=ON;;
--no-muzzle) muzzle=OFF;;
- --static) static_library=ON; static_binary=ON;;
- --no-static) static_library=OFF;;
-
- --static-binary) static_binary=ON;;
- --no-static-binary) static_binary=OFF;;
+ --static) static=ON;;
+ --no-static) static=OFF;;
--auto-download) auto_download=ON;;
--no-auto-download) auto_download=OFF;;
[ $ninja != default ] && cmake_opts="$cmake_opts -G Ninja"
[ $muzzle != default ] \
&& cmake_opts="$cmake_opts -DENABLE_MUZZLE=$muzzle"
-[ $static_library != default ] \
- && cmake_opts="$cmake_opts -DENABLE_STATIC_LIBRARY=$static_library"
-[ $static_binary != default ] \
- && cmake_opts="$cmake_opts -DENABLE_STATIC_BINARY=$static_binary"
+[ $static != default ] \
+ && cmake_opts="$cmake_opts -DENABLE_STATIC_BUILD=$static"
[ $statistics != default ] \
&& cmake_opts="$cmake_opts -DENABLE_STATISTICS=$statistics"
[ $tracing != default ] \
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
-if(ENABLE_STATIC_LIBRARY)
+if(ENABLE_STATIC_BUILD)
add_library(cvc5-static STATIC $<TARGET_OBJECTS:cvc5-obj> $<TARGET_OBJECTS:cvc5base> $<TARGET_OBJECTS:cvc5context>)
set_target_properties(cvc5-static PROPERTIES OUTPUT_NAME cvc5)
target_include_directories(cvc5-static
add_dependencies(cvc5-obj GMP_SHARED)
target_include_directories(cvc5-obj PRIVATE ${GMP_INCLUDE_DIR})
target_link_libraries(cvc5-shared PRIVATE GMP_SHARED)
-if(ENABLE_STATIC_LIBRARY)
+if(ENABLE_STATIC_BUILD)
target_link_libraries(cvc5-static PUBLIC GMP_STATIC)
endif()
# Note: For glibc < 2.17 we have to additionally link against rt (man clock_gettime).
# RT_LIBRARIES should be empty for glibc >= 2.17
target_link_libraries(cvc5-shared PRIVATE ${RT_LIBRARIES})
-if(ENABLE_STATIC_LIBRARY)
+if(ENABLE_STATIC_BUILD)
target_link_libraries(cvc5-static PRIVATE ${RT_LIBRARIES})
endif()
add_dependencies(cvc5-obj CaDiCaL)
target_include_directories(cvc5-obj PRIVATE ${CaDiCaL_INCLUDE_DIR})
target_link_libraries(cvc5-shared PRIVATE CaDiCaL)
-if(ENABLE_STATIC_LIBRARY)
+if(ENABLE_STATIC_BUILD)
target_link_libraries(cvc5-static PUBLIC CaDiCaL)
endif()
add_dependencies(cvc5-obj CLN_SHARED)
target_include_directories(cvc5-obj PRIVATE ${CLN_INCLUDE_DIR})
target_link_libraries(cvc5-shared PRIVATE CLN_SHARED)
- if(ENABLE_STATIC_LIBRARY)
+ if(ENABLE_STATIC_BUILD)
target_link_libraries(cvc5-static PUBLIC CLN_STATIC)
endif()
endif()
add_dependencies(cvc5-obj CryptoMiniSat)
target_include_directories(cvc5-obj PRIVATE ${CryptoMiniSat_INCLUDE_DIR})
target_link_libraries(cvc5-shared PRIVATE CryptoMiniSat)
- if(ENABLE_STATIC_LIBRARY)
+ if(ENABLE_STATIC_BUILD)
target_link_libraries(cvc5-static PUBLIC CryptoMiniSat)
endif()
endif()
add_dependencies(cvc5-obj Kissat)
target_include_directories(cvc5-obj PRIVATE ${Kissat_INCLUDE_DIR})
target_link_libraries(cvc5-shared PRIVATE Kissat)
- if(ENABLE_STATIC_LIBRARY)
+ if(ENABLE_STATIC_BUILD)
target_link_libraries(cvc5-static PUBLIC Kissat)
endif()
endif()
if(USE_GLPK)
target_include_directories(cvc5-obj PRIVATE ${GLPK_INCLUDE_DIR})
target_link_libraries(cvc5-shared PRIVATE ${GLPK_LIBRARIES})
- if(ENABLE_STATIC_LIBRARY)
+ if(ENABLE_STATIC_BUILD)
target_link_libraries(cvc5-static PUBLIC ${GLPK_LIBRARIES})
endif()
endif()
add_dependencies(cvc5-obj Polyxx_SHARED)
target_include_directories(cvc5-obj PRIVATE ${Poly_INCLUDE_DIR})
target_link_libraries(cvc5-shared PRIVATE Polyxx_SHARED)
- if(ENABLE_STATIC_LIBRARY)
+ if(ENABLE_STATIC_BUILD)
target_link_libraries(cvc5-static PUBLIC Polyxx_STATIC)
endif()
endif()
add_dependencies(cvc5-obj CoCoA)
target_include_directories(cvc5-obj PRIVATE ${CoCoA_INCLUDE_DIR})
target_link_libraries(cvc5-shared PRIVATE CoCoA)
- if(ENABLE_STATIC_LIBRARY)
+ if(ENABLE_STATIC_BUILD)
target_link_libraries(cvc5-static PUBLIC CoCoA)
endif()
endif()
add_dependencies(cvc5-obj SymFPU)
target_include_directories(cvc5-obj PRIVATE ${SymFPU_INCLUDE_DIR})
target_link_libraries(cvc5-shared PRIVATE SymFPU)
-if(ENABLE_STATIC_LIBRARY)
+if(ENABLE_STATIC_BUILD)
target_link_libraries(cvc5-static PUBLIC SymFPU)
endif()
# use the static system libraries.
# https://cmake.org/cmake/help/v3.0/prop_tgt/LINK_SEARCH_START_STATIC.html
# https://cmake.org/cmake/help/v3.0/prop_tgt/LINK_SEARCH_END_STATIC.html
-if(ENABLE_STATIC_BINARY)
+if(ENABLE_STATIC_BUILD)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set_target_properties(cvc5-bin PROPERTIES LINK_FLAGS -static)
set_target_properties(cvc5-bin PROPERTIES LINK_SEARCH_START_STATIC ON)
EXPORT cvc5-targets
DESTINATION ${CMAKE_INSTALL_LIBDIR})
-if(ENABLE_STATIC_LIBRARY)
+if(ENABLE_STATIC_BUILD)
add_library(cvc5parser-static STATIC $<TARGET_OBJECTS:cvc5parser-objs>)
set_target_properties(cvc5parser-static PROPERTIES OUTPUT_NAME cvc5parser)
target_link_libraries(cvc5parser-static PRIVATE cvc5-static)