Skip to content

Commit 04cac1a

Browse files
author
Norbert Manthey
committed
build: add ipasir solver support
Add necessary steps to set variables for IPASIR Furthermore, allow to select SAT solver from make command line, for example by calling IPASIR=../../ipasir LIBSOLVER=$(pwd)/ipasir/libipasir.a make Not, to compile with a different SAT solver, e.g. GLUCOSE=../../glucose-syrup make it has to be ensured, that the solvers.a library is rebuild, and all components that link against this library are renewed as well. This can be achieved by touching the satcheck.h flie, i.e.: touch src/solvers/sat/satcheck.h
1 parent de08c8f commit 04cac1a

File tree

3 files changed

+101
-2
lines changed

3 files changed

+101
-2
lines changed

src/Makefile

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,41 @@ glucose-download:
8484
@(cd ../glucose-syrup; patch -p1 < ../scripts/glucose-syrup-patch)
8585
@rm glucose-syrup.tgz
8686

87-
.PHONY: minisat2-download glucose-download
87+
zlib-download:
88+
@echo "Downloading zlib 1.2.11"
89+
@lwp-download http://zlib.net/zlib-1.2.11.tar.gz
90+
@tar xfz zlib-1.2.11.tar.gz
91+
@rm -Rf ../zlib
92+
@mv zlib-1.2.11 ../zlib
93+
@rm zlib-1.2.11.tar.gz
94+
95+
libzip-download:
96+
@echo "Downloading libzip 1.1.2"
97+
# The below wants SSL
98+
#@lwp-download http://www.nih.at/libzip/libzip-1.1.2.tar.gz
99+
@lwp-download http://http.debian.net/debian/pool/main/libz/libzip/libzip_1.1.2.orig.tar.gz
100+
@tar xfz libzip_1.1.2.orig.tar.gz
101+
@rm -Rf ../libzip
102+
@mv libzip-1.1.2 ../libzip
103+
@rm libzip_1.1.2.orig.tar.gz
104+
105+
libzip-build:
106+
@echo "Building zlib"
107+
@(cd ../zlib; ./configure; make)
108+
@echo "Building libzip"
109+
@(cd ../libzip; BASE=`pwd`; ./configure --with-zlib=$(BASE)/zlib ; make)
110+
111+
ipasir-download:
112+
# get the 2016 version of the ipasir package, which contains a few solvers
113+
@echo "Download ipasir 2016 package"
114+
@(lwp-download http://baldur.iti.kit.edu/sat-competition-2016/downloads/ipasir.zip ../ipasir.zip)
115+
@(cd ..; unzip -u ipasir.zip)
116+
117+
ipasir-build: ipasir-download
118+
# build libpicaso, and create a libipasir.a in ipasir directory
119+
# make sure that the ipasir.h file is located there as well (ships with 2016 package)
120+
@echo "Build Picaso 961 from ipasir 2016 package"
121+
$(MAKE) -C ../ipasir/sat/picosat961 libipasirpicosat961.a
122+
@(cd ../ipasir; ln -sf sat/picosat961/libipasirpicosat961.a libipasir.a)
123+
124+
.PHONY: ipasir-build minisat2-download glucose-download zlib-download libzip-download libzip-build

src/common

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,64 @@ else
150150
$(error Invalid setting for BUILD_ENV: $(BUILD_ENV_))
151151
endif
152152

153+
# select default solver to be minisat2 if no other is specified
154+
ifndef IPASIR
155+
ifndef PRECOSAT
156+
ifndef PICOSAT
157+
ifndef LINGELING
158+
ifndef CHAFF
159+
ifndef BOOLEFORCE
160+
ifndef MINISAT
161+
ifndef MINISAT2
162+
ifndef GLUCOSE
163+
MINISAT2 = ../../minisat-2.2.1
164+
endif
165+
endif
166+
endif
167+
endif
168+
endif
169+
endif
170+
endif
171+
endif
172+
endif
173+
174+
ifneq ($(IPASIR),)
175+
CP_CXXFLAGS += -DHAVE_IPASIR
176+
endif
177+
178+
ifneq ($(PRECOSAT),)
179+
CP_CXXFLAGS += -DHAVE_PRECOSAT
180+
endif
181+
182+
ifneq ($(PICOSAT),)
183+
CP_CXXFLAGS += -DHAVE_PICOSAT
184+
endif
185+
186+
ifneq ($(LINGELING),)
187+
CP_CXXFLAGS += -DHAVE_LINGELING
188+
endif
189+
190+
ifneq ($(CHAFF),)
191+
CP_CXXFLAGS += -DHAVE_CHAFF
192+
endif
193+
194+
ifneq ($(BOOLEFORCE),)
195+
CP_CXXFLAGS += -DHAVE_BOOLEFORCE
196+
endif
197+
198+
ifneq ($(MINISAT),)
199+
CP_CXXFLAGS += -DHAVE_MINISAT
200+
endif
201+
202+
ifneq ($(MINISAT2),)
203+
CP_CXXFLAGS += -DHAVE_MINISAT2
204+
endif
205+
206+
ifneq ($(GLUCOSE),)
207+
CP_CXXFLAGS += -DHAVE_GLUCOSE
208+
endif
209+
210+
153211

154212
first_target: all
155213

src/config.inc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@ BUILD_ENV = AUTO
2121
#CHAFF = ../../zChaff
2222
#BOOLEFORCE = ../../booleforce-0.4
2323
#MINISAT = ../../MiniSat-p_v1.14
24-
MINISAT2 = ../../minisat-2.2.1
24+
#MINISAT2 = ../../minisat-2.2.1
25+
#IPASIR = ../../ipasir
2526
#GLUCOSE = ../../glucose-syrup
2627
#SMVSAT =
2728

29+
LIBZIPLIB = ../../libzip/lib/.libs/libzip.a ../../zlib/libz.a
30+
LIBZIPINC = ../../libzip/lib
31+
2832
# Signing identity for MacOS Gatekeeper
2933

3034
OSX_IDENTITY="Developer ID Application: Daniel Kroening"

0 commit comments

Comments
 (0)