Skip to content

Commit 12a6917

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 Note, 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 14419d2 commit 12a6917

File tree

3 files changed

+58
-2
lines changed

3 files changed

+58
-2
lines changed

src/Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,17 @@ cprover-jar-build:
9393
cd target; jar cf org.cprover.jar `find . -name "*.class"`; \
9494
mv org.cprover.jar ../../../)
9595

96-
.PHONY: minisat2-download glucose-download cprover-jar-build
96+
ipasir-download:
97+
# get the 2016 version of the ipasir package, which contains a few solvers
98+
@echo "Download ipasir 2016 package"
99+
@(lwp-download http://baldur.iti.kit.edu/sat-competition-2016/downloads/ipasir.zip ../ipasir.zip)
100+
@(cd ..; unzip -u ipasir.zip)
101+
102+
ipasir-build: ipasir-download
103+
# build libpicosat, and create a libipasir.a in ipasir directory
104+
# make sure that the ipasir.h file is located there as well (ships with 2016 package)
105+
@echo "Build Picosat 961 from ipasir 2016 package"
106+
$(MAKE) -C ../ipasir/sat/picosat961 libipasirpicosat961.a
107+
@(cd ../ipasir; ln -sf sat/picosat961/libipasirpicosat961.a libipasir.a)
108+
109+
.PHONY: ipasir-build minisat2-download glucose-download cprover-jar-build

src/common

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,48 @@ else
155155
$(error Invalid setting for BUILD_ENV: $(BUILD_ENV_))
156156
endif
157157

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

159201
first_target: all
160202

src/config.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ endif
2222
#CHAFF = ../../zChaff
2323
#BOOLEFORCE = ../../booleforce-0.4
2424
#MINISAT = ../../MiniSat-p_v1.14
25-
MINISAT2 = ../../minisat-2.2.1
25+
#MINISAT2 = ../../minisat-2.2.1
26+
#IPASIR = ../../ipasir
2627
#GLUCOSE = ../../glucose-syrup
2728
#SMVSAT =
2829

0 commit comments

Comments
 (0)