Skip to content

Commit

Permalink
Backport CaDiCaL upgrade to fix Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanGlScott committed Dec 10, 2023
1 parent 0ffa761 commit ed690c3
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ build_abc() {

build_bitwuzla() {
pushd repos/bitwuzla
if $IS_WIN ; then
# Backport https://github.com/bitwuzla/bitwuzla/commit/8522622b57e1d64384ba11dded0f4fd94bf5c622
patch -p1 -i $PATCHES/bitwuzla-upgrade-cadical.patch
fi
./configure.py
cd build
ninja -j4
Expand Down
79 changes: 79 additions & 0 deletions patches/bitwuzla-upgrade-cadical.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
From 8522622b57e1d64384ba11dded0f4fd94bf5c622 Mon Sep 17 00:00:00 2001
From: Mathias Preiner <mathias.preiner@gmail.com>
Date: Sun, 17 Sep 2023 20:58:55 -0700
Subject: [PATCH] subprojects: Update CaDiCaL to 1.7.4.

---
subprojects/cadical.wrap | 8 ++++----
subprojects/packagefiles/cadical/meson.build | 2 +-
subprojects/packagefiles/cadical/src/meson.build | 11 ++++++++++-
3 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/subprojects/cadical.wrap b/subprojects/cadical.wrap
index f85a075e2..23044d2c0 100644
--- a/subprojects/cadical.wrap
+++ b/subprojects/cadical.wrap
@@ -1,9 +1,9 @@
[wrap-file]
-directory = cadical-rel-1.5.2
+directory = cadical-rel-1.7.4

-source_url = https://github.com/arminbiere/cadical/archive/rel-1.5.2.tar.gz
-source_filename = cadical-1.5.2.tar.gz
-source_hash = 4a4251bf0191677ca8cda275cb7bf5e0cf074ae0056819642d5a7e5c1a952e6e
+source_url = https://github.com/arminbiere/cadical/archive/rel-1.7.4.tar.gz
+source_filename = cadical-1.7.4.tar.gz
+source_hash = 866c8a1332ff1ad5dc7ad403bdef3164420f3f947816b5c9509aad1d18ada7a1

patch_directory = cadical

diff --git a/subprojects/packagefiles/cadical/meson.build b/subprojects/packagefiles/cadical/meson.build
index 559146f22..3163d090e 100644
--- a/subprojects/packagefiles/cadical/meson.build
+++ b/subprojects/packagefiles/cadical/meson.build
@@ -1,6 +1,6 @@
project('cadical',
'cpp',
- version: '1.5.2',
+ version: '1.7.4',
license: 'mit',
default_options: [
'cpp_std=c++11',
diff --git a/subprojects/packagefiles/cadical/src/meson.build b/subprojects/packagefiles/cadical/src/meson.build
index 83112a1af..7e94bea49 100644
--- a/subprojects/packagefiles/cadical/src/meson.build
+++ b/subprojects/packagefiles/cadical/src/meson.build
@@ -36,8 +36,10 @@ sources = [
'ema.cpp',
'extend.cpp',
'external.cpp',
+ 'external_propagate.cpp',
'file.cpp',
'flags.cpp',
+ 'flip.cpp',
'format.cpp',
'gates.cpp',
'instantiate.cpp',
@@ -46,6 +48,8 @@ sources = [
'limit.cpp',
'logging.cpp',
'lookahead.cpp',
+ 'lratbuilder.cpp',
+ 'lratchecker.cpp',
'lucky.cpp',
'message.cpp',
'minimize.cpp',
@@ -85,7 +89,12 @@ sources = [
'watch.cpp'
]

-cadical_lib = library('cadical', sources: sources)
+cpp_args = []
+if not compiler.has_function('getc_unlocked', prefix: '#include <cstdio>')
+ cpp_args += ['-DNUNLOCKED']
+endif
+
+cadical_lib = library('cadical', sources: sources, cpp_args: cpp_args)
cadical_dep = declare_dependency(
include_directories: include_directories('.'),
link_with: cadical_lib)

0 comments on commit ed690c3

Please sign in to comment.