This PR modifies our CI builds to have two static production builds. These binaries will be used as release artifacts later.
include:
- name: ubuntu:production
os: ubuntu-latest
- config: production --auto-download --all-bindings --editline --docs
+ config: production --auto-download --all-bindings --editline --docs --static-binary
cache-key: production
python-bindings: true
build-documentation: true
- name: macos:production
os: macos-11
- config: production --auto-download --all-bindings --editline
+ config: production --auto-download --all-bindings --editline --static-binary
cache-key: production
python-bindings: true
check-examples: true
sudo apt-get install -y \
build-essential \
ccache \
+ libbsd-dev \
libcln-dev \
+ libedit-dev \
libgmp-dev \
libgtest-dev \
- libedit-dev \
+ libtinfo-dev \
flex \
libfl-dev \
flexc++
On macOS, we recommend using `Homebrew <https://brew.sh/>`_ to install the
dependencies. We also have a Homebrew Tap available at
https://github.com/CVC4/homebrew-cvc4 .
-To build a static binary for macOS, use:
-``./configure.sh --static --no-static-binary``.
+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
+that uses static versions of all our dependencies, but is still a dynamically
+linked binary.
Cross-compiling for Windows
.. code:: bash
- ./configure.sh --win64 --static <configure options...>
+ ./configure.sh --win64 --static-binary <configure options...>
cd <build_dir> # default is ./build
make # use -jN for parallel build with N threads
.. code::
- ./configure.sh --static <options>
+ ./configure.sh --static-binary <options>
7. Follow remaining steps from `build instructions <#building-cvc5>`_
endif()
macro(force_static_library)
- message(STATUS "before: ${CMAKE_FIND_LIBRARY_SUFFIXES}")
if (WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a)
else()
macro(reset_force_static_library)
if (WIN32)
- set(CMAKE_FIND_LIBRARY_SUFFIXES .dll)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .dll .lib)
else()
- set(CMAKE_FIND_LIBRARY_SUFFIXES .so .dylib)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .so .dylib .a)
endif()
endmacro(reset_force_static_library)
# 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)
- set_target_properties(cvc5-bin PROPERTIES LINK_FLAGS -static)
- set_target_properties(cvc5-bin PROPERTIES LINK_SEARCH_START_STATIC ON)
- set_target_properties(cvc5-bin PROPERTIES LINK_SEARCH_END_STATIC ON)
+ 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)
+ set_target_properties(cvc5-bin PROPERTIES LINK_SEARCH_END_STATIC ON)
+ endif()
endif()
if(USE_EDITLINE)