@@ -64,137 +64,132 @@ add_library(solvers ${sources})
64
64
65
65
include ("${CBMC_SOURCE_DIR} /../cmake/DownloadProject.cmake" )
66
66
67
- if ("${sat_impl} " STREQUAL "minisat2" )
68
- message (STATUS "Building solvers with minisat2" )
69
-
70
- # once we upgrade to CMake 3.7 or higher we can specify multiple URLs as a
71
- # fall-back in case the first URL fails (the Makefile-based build retries up
72
- # to 2 times)
73
- download_project(PROJ minisat2
74
- URL http://ftp.debian.org/debian/pool/main/m/minisat2/minisat2_2.2.1.orig.tar.gz
75
- PATCH_COMMAND patch -p1 -i ${CBMC_SOURCE_DIR} /../scripts/minisat-2.2.1-patch
76
- COMMAND cmake -E copy ${CBMC_SOURCE_DIR} /../scripts/minisat2_CMakeLists.txt CMakeLists.txt
77
- URL_MD5 27faa19ee0508660bd6fb7f894646d42
78
- )
67
+ foreach (SOLVER ${sat_impl} )
68
+ if ("${SOLVER} " STREQUAL "minisat2" )
69
+ message (STATUS "Building solvers with minisat2" )
70
+
71
+ # once we upgrade to CMake 3.7 or higher we can specify multiple URLs as a
72
+ # fall-back in case the first URL fails (the Makefile-based build retries up
73
+ # to 2 times)
74
+ download_project(PROJ minisat2
75
+ URL http://ftp.debian.org/debian/pool/main/m/minisat2/minisat2_2.2.1.orig.tar.gz
76
+ PATCH_COMMAND patch -p1 -i ${CBMC_SOURCE_DIR} /../scripts/minisat-2.2.1-patch
77
+ COMMAND cmake -E copy ${CBMC_SOURCE_DIR} /../scripts/minisat2_CMakeLists.txt CMakeLists.txt
78
+ URL_MD5 27faa19ee0508660bd6fb7f894646d42
79
+ )
79
80
80
- add_subdirectory (${minisat2_SOURCE_DIR} ${minisat2_BINARY_DIR} )
81
+ add_subdirectory (${minisat2_SOURCE_DIR} ${minisat2_BINARY_DIR} )
81
82
82
- target_compile_definitions (solvers PUBLIC
83
- SATCHECK_MINISAT2 HAVE_MINISAT2 __STDC_FORMAT_MACROS __STDC_LIMIT_MACROS
84
- )
85
-
86
- target_sources (solvers PRIVATE ${minisat2_source} )
83
+ target_compile_definitions (solvers PUBLIC
84
+ SATCHECK_MINISAT2 HAVE_MINISAT2 __STDC_FORMAT_MACROS __STDC_LIMIT_MACROS
85
+ )
87
86
88
- target_link_libraries (solvers minisat2-condensed)
89
- elseif ("${sat_impl} " STREQUAL "glucose" )
90
- message (STATUS "Building solvers with glucose" )
87
+ target_sources (solvers PRIVATE ${minisat2_source} )
91
88
92
- download_project(PROJ glucose
93
- URL https://github.com/BrunoDutertre/glucose-syrup/archive/0bb2afd3b9baace6981cbb8b4a1c7683c44968b7.tar.gz
94
- PATCH_COMMAND patch -p1 -i ${CBMC_SOURCE_DIR} /../scripts/glucose-syrup-patch
95
- COMMAND cmake -E copy ${CBMC_SOURCE_DIR} /../scripts/glucose_CMakeLists.txt CMakeLists.txt
96
- URL_MD5 7c539c62c248b74210aef7414787323a
97
- )
89
+ target_link_libraries (solvers minisat2-condensed)
90
+ elseif ("${SOLVER} " STREQUAL "glucose" )
91
+ message (STATUS "Building solvers with glucose" )
98
92
99
- add_subdirectory (${glucose_SOURCE_DIR} ${glucose_BINARY_DIR} )
93
+ download_project(PROJ glucose
94
+ URL https://github.com/BrunoDutertre/glucose-syrup/archive/0bb2afd3b9baace6981cbb8b4a1c7683c44968b7.tar.gz
95
+ PATCH_COMMAND patch -p1 -i ${CBMC_SOURCE_DIR} /../scripts/glucose-syrup-patch
96
+ COMMAND cmake -E copy ${CBMC_SOURCE_DIR} /../scripts/glucose_CMakeLists.txt CMakeLists.txt
97
+ URL_MD5 7c539c62c248b74210aef7414787323a
98
+ )
100
99
101
- target_compile_definitions (solvers PUBLIC
102
- SATCHECK_GLUCOSE HAVE_GLUCOSE __STDC_FORMAT_MACROS __STDC_LIMIT_MACROS
103
- )
100
+ add_subdirectory (${glucose_SOURCE_DIR} ${glucose_BINARY_DIR} )
104
101
105
- target_sources (solvers PRIVATE ${glucose_source} )
102
+ target_compile_definitions (solvers PUBLIC
103
+ SATCHECK_GLUCOSE HAVE_GLUCOSE __STDC_FORMAT_MACROS __STDC_LIMIT_MACROS
104
+ )
106
105
107
- target_link_libraries (solvers glucose-condensed)
108
- elseif ("${sat_impl} " STREQUAL "cadical" )
109
- message (STATUS "Building solvers with cadical" )
106
+ target_sources (solvers PRIVATE ${glucose_source} )
110
107
111
- download_project(PROJ cadical
112
- URL https://github.com/arminbiere/cadical/archive/rel-1.4.1.tar.gz
113
- PATCH_COMMAND true
114
- COMMAND CXX=${CMAKE_CXX_COMPILER} ./configure -O3 -s CXXFLAGS=-std=c++14
115
- URL_MD5 b44874501a175106424f4bd5de29aa59
116
- )
108
+ target_link_libraries (solvers glucose-condensed)
109
+ elseif ("${SOLVER} " STREQUAL "cadical" )
110
+ message (STATUS "Building solvers with cadical" )
117
111
118
- message (STATUS "Building CaDiCaL" )
119
- execute_process (COMMAND make -j WORKING_DIRECTORY ${cadical_SOURCE_DIR} )
112
+ download_project(PROJ cadical
113
+ URL https://github.com/arminbiere/cadical/archive/rel-1.4.1.tar.gz
114
+ PATCH_COMMAND patch -p1 -i ${CBMC_SOURCE_DIR} /../scripts/cadical-1.4.1-patch
115
+ COMMAND cmake -E copy ${CBMC_SOURCE_DIR} /../scripts/cadical_CMakeLists.txt CMakeLists.txt
116
+ COMMAND ./configure
117
+ URL_MD5 b44874501a175106424f4bd5de29aa59
118
+ )
120
119
121
- target_compile_definitions (solvers PUBLIC
122
- SATCHECK_CADICAL HAVE_CADICAL
123
- )
120
+ add_subdirectory (${cadical_SOURCE_DIR} ${cadical_BINARY_DIR} )
124
121
125
- add_library (cadical STATIC IMPORTED )
122
+ target_compile_definitions (solvers PUBLIC
123
+ SATCHECK_CADICAL HAVE_CADICAL
124
+ )
126
125
127
- set_target_properties (
128
- cadical
129
- PROPERTIES IMPORTED_LOCATION ${cadical_SOURCE_DIR} /build /libcadical.a
130
- )
126
+ target_include_directories (solvers
127
+ PUBLIC
128
+ ${cadical_SOURCE_DIR} /src
129
+ )
131
130
132
- target_include_directories (solvers
133
- PUBLIC
134
- ${cadical_SOURCE_DIR} /src
135
- )
131
+ target_link_libraries (solvers cadical)
132
+ elseif ("${SOLVER} " STREQUAL "ipasir-cadical" )
133
+ message (STATUS "Building with IPASIR solver linking against: CaDiCaL" )
136
134
137
- target_link_libraries (solvers cadical)
138
- elseif ("${sat_impl} " STREQUAL "ipasir-cadical" )
139
- message (STATUS "Building with IPASIR solver linking against: CaDiCaL" )
135
+ download_project(PROJ cadical
136
+ URL https://github.com/arminbiere/cadical/archive/rel-1.4.1.tar.gz
137
+ PATCH_COMMAND true
138
+ COMMAND CXX=${CMAKE_CXX_COMPILER} ./configure -O3 -s CXXFLAGS=-std=c++14
139
+ URL_MD5 b44874501a175106424f4bd5de29aa59
140
+ )
140
141
141
- download_project(PROJ cadical
142
- URL https://github.com/arminbiere/cadical/archive/rel-1.4.1.tar.gz
143
- PATCH_COMMAND true
144
- COMMAND CXX=${CMAKE_CXX_COMPILER} ./configure -O3 -s CXXFLAGS=-std=c++14
145
- URL_MD5 b44874501a175106424f4bd5de29aa59
146
- )
142
+ message (STATUS "Building CaDiCaL" )
143
+ execute_process (COMMAND make WORKING_DIRECTORY ${cadical_SOURCE_DIR} )
147
144
148
- message (STATUS "Building CaDiCaL" )
149
- execute_process (COMMAND make WORKING_DIRECTORY ${cadical_SOURCE_DIR} )
145
+ target_compile_definitions (solvers PUBLIC
146
+ SATCHECK_IPASIR HAVE_IPASIR IPASIR=${cadical_SOURCE_DIR} /src
147
+ )
150
148
151
- target_compile_definitions (solvers PUBLIC
152
- SATCHECK_IPASIR HAVE_IPASIR IPASIR=${cadical_SOURCE_DIR} /src
153
- )
149
+ add_library (cadical_ipasir STATIC IMPORTED )
150
+ set_property (TARGET cadical_ipasir
151
+ PROPERTY IMPORTED_LOCATION ${cadical_SOURCE_DIR} /build /libcadical.a
152
+ )
154
153
155
- add_library (cadical_ipasir STATIC IMPORTED )
156
- set_property (TARGET cadical_ipasir
157
- PROPERTY IMPORTED_LOCATION ${cadical_SOURCE_DIR} /build /libcadical.a
158
- )
154
+ target_include_directories (solvers
155
+ PUBLIC
156
+ ${cadical_SOURCE_DIR} /src
157
+ )
158
+ target_link_libraries (solvers cadical_ipasir)
159
+ elseif ("${SOLVER} " STREQUAL "ipasir-custom" )
160
+ message (STATUS "Building with IPASIR solver linking: custom solver provided" )
161
+
162
+ if (NOT DEFINED IPASIR)
163
+ message (FATAL_ERROR
164
+ "IPASIR solver source code not provided. Please use -DIPASIR=<location> "
165
+ "with <location> being the path to the IPASIR solver source code."
166
+ )
167
+ endif ()
168
+
169
+ if (NOT DEFINED IPASIR_LIB)
170
+ message (FATAL_ERROR
171
+ "IPASIR solver library not provided. Please use -DIPASIR_LIB=<location> "
172
+ "with <location> being the path to the IPASIR solver precompiled static "
173
+ "library."
174
+ )
175
+ endif ()
176
+
177
+ target_compile_definitions (solvers PUBLIC
178
+ SATCHECK_IPASIR HAVE_IPASIR IPASIR=${IPASIR}
179
+ )
159
180
160
- target_include_directories (solvers
161
- PUBLIC
162
- ${cadical_SOURCE_DIR} /src
163
- )
164
- target_link_libraries (solvers cadical_ipasir)
165
- elseif ("${sat_impl} " STREQUAL "ipasir-custom" )
166
- message (STATUS "Building with IPASIR solver linking: custom solver provided" )
167
-
168
- if (NOT DEFINED IPASIR)
169
- message (FATAL_ERROR
170
- "IPASIR solver source code not provided. Please use -DIPASIR=<location> "
171
- "with <location> being the path to the IPASIR solver source code."
181
+ add_library (ipasir_custom STATIC IMPORTED )
182
+ set_property (TARGET ipasir_custom
183
+ PROPERTY IMPORTED_LOCATION ${IPASIR_LIB}
172
184
)
173
- endif ()
174
185
175
- if (NOT DEFINED IPASIR_LIB)
176
- message (FATAL_ERROR
177
- "IPASIR solver library not provided. Please use -DIPASIR_LIB=<location> "
178
- "with <location> being the path to the IPASIR solver precompiled static "
179
- "library."
186
+ target_include_directories (solvers
187
+ PUBLIC
188
+ ${IPASIR}
180
189
)
190
+ target_link_libraries (solvers ipasir_custom pthread)
181
191
endif ()
182
-
183
- target_compile_definitions (solvers PUBLIC
184
- SATCHECK_IPASIR HAVE_IPASIR IPASIR=${IPASIR}
185
- )
186
-
187
- add_library (ipasir_custom STATIC IMPORTED )
188
- set_property (TARGET ipasir_custom
189
- PROPERTY IMPORTED_LOCATION ${IPASIR_LIB}
190
- )
191
-
192
- target_include_directories (solvers
193
- PUBLIC
194
- ${IPASIR}
195
- )
196
- target_link_libraries (solvers ipasir_custom pthread)
197
- endif ()
192
+ endforeach ()
198
193
199
194
if (CMAKE_USE_CUDD)
200
195
target_link_libraries (solvers util cudd-cplusplus cudd)
0 commit comments