2 #--------------------------------------------------------------------------#
6 Usage: $0 [<build type>] [<option> ...]
16 -h, --help display this help and exit
17 --prefix=STR install directory
18 --program-prefix=STR prefix of binaries prepended on make install
19 --name=STR use custom build directory name (optionally: +path)
20 --best turn on dependencies known to give best performance
21 --gpl permit GPL dependencies, if available
22 --win64 cross-compile for Windows 64 bit
26 The following flags enable optional features (disable with --no-<option name>).
27 --static build static libraries and binaries [default=no]
28 --static-binary enable/disable static binaries
29 --proofs support for proof generation
30 --optimized optimize the build
31 --debug-symbols include debug symbols
32 --valgrind Valgrind instrumentation
33 --debug-context-mm use the debug context memory manager
34 --statistics include statistics
35 --replay turn on the replay feature
36 --assertions turn on assertions
37 --tracing include tracing code
38 --dumping include dumping code
39 --muzzle complete silence (no non-result output)
40 --coverage support for gcov coverage testing
41 --profiling support for gprof profiling
42 --unit-testing support for unit testing
43 --python2 prefer using Python 2 (also for Python bindings)
44 --python3 prefer using Python 3 (also for Python bindings)
46 The following options configure parameterized features.
48 --language-bindings[=java,python,all]
49 specify language bindings to build
52 The following flags enable optional packages (disable with --no-<option name>).
53 --cln use CLN instead of GMP
54 --glpk use GLPK simplex solver
55 --abc use the ABC AIG library
56 --cadical use the CaDiCaL SAT solver
57 --cryptominisat use the CryptoMiniSat SAT solver
58 --drat2er use drat2er (required for eager BV proofs)
59 --lfsc use the LFSC proof checker
60 --symfpu use SymFPU for floating point solver
61 --portfolio build the multithreaded portfolio version of CVC4
63 --readline support the readline library
65 Optional Path to Optional Packages:
66 --abc-dir=PATH path to top level of ABC source tree
67 --antlr-dir=PATH path to ANTLR C headers and libraries
68 --cadical-dir=PATH path to top level of CaDiCaL source tree
69 --cryptominisat-dir=PATH path to top level of CryptoMiniSat source tree
70 --drat2er-dir=PATH path to the top level of the drat2er installation
71 --cxxtest-dir=PATH path to CxxTest installation
72 --glpk-dir=PATH path to top level of GLPK installation
73 --gmp-dir=PATH path to top level of GMP installation
74 --lfsc-dir=PATH path to top level of LFSC source tree
75 --symfpu-dir=PATH path to top level of SymFPU source tree
81 #--------------------------------------------------------------------------#
84 echo "*** configure.sh: $*" 1>&2
89 echo "[configure.sh] $*"
92 #--------------------------------------------------------------------------#
94 [ ! -e src
/theory
] && die
"$0 not called from CVC4 base directory"
96 #--------------------------------------------------------------------------#
99 install_prefix
=default
102 #--------------------------------------------------------------------------#
113 cryptominisat
=default
114 debug_symbols
=default
115 debug_context_mm
=default
128 static_binary
=default
139 language_bindings_java
=default
140 language_bindings_python
=default
145 cryptominisat_dir
=default
153 #--------------------------------------------------------------------------#
165 --no-asan) asan
=OFF
;;
167 --assertions) assertions
=ON
;;
168 --no-assertions) assertions
=OFF
;;
171 --no-best) best
=OFF
;;
173 --prefix) die
"missing argument to $1 (try -h)" ;;
175 install_prefix
=${1##*=}
176 # Check if install_prefix is an absolute path and if not, make it
178 case $install_prefix in
179 /*) ;; # absolute path
180 *) install_prefix
=$
(pwd)/$install_prefix ;; # make absolute path
184 --program-prefix) die
"missing argument to $1 (try -h)" ;;
185 --program-prefix=*) program_prefix
=${1##*=} ;;
187 --name) die
"missing argument to $1 (try -h)" ;;
188 --name=*) build_dir
=${1##*=} ;;
190 --cadical) cadical
=ON
;;
191 --no-cadical) cadical
=OFF
;;
196 --coverage) coverage
=ON
;;
197 --no-coverage) coverage
=OFF
;;
199 --cryptominisat) cryptominisat
=ON
;;
200 --no-cryptominisat) cryptominisat
=OFF
;;
202 --debug-symbols) debug_symbols
=ON
;;
203 --no-debug-symbols) debug_symbols
=OFF
;;
205 --debug-context-mm) debug_context_mm
=ON
;;
206 --no-debug-context-mm) debug_context_mm
=OFF
;;
208 --drat2er) drat2er
=ON
;;
209 --no-drat2er) drat2er
=OFF
;;
211 --dumping) dumping
=ON
;;
212 --no-dumping) dumping
=OFF
;;
218 --no-win64) win64
=OFF
;;
221 --no-glpk) glpk
=OFF
;;
224 --no-lfsc) lfsc
=OFF
;;
226 --muzzle) muzzle
=ON
;;
227 --no-muzzle) muzzle
=OFF
;;
229 --optimized) optimized
=ON
;;
230 --no-optimized) optimized
=OFF
;;
232 --portfolio) portfolio
=ON
;;
233 --no-portfolio) portfolio
=OFF
;;
235 --proofs) proofs
=ON
;;
236 --no-proofs) proofs
=OFF
;;
238 --replay) replay
=ON
;;
239 --no-replay) replay
=OFF
;;
241 --static) shared
=OFF
; static_binary
=ON
;;
242 --no-static) shared
=ON
;;
244 --static-binary) static_binary
=ON
;;
245 --no-static-binary) static_binary
=OFF
;;
247 --statistics) statistics
=ON
;;
248 --no-statistics) statistics
=OFF
;;
250 --symfpu) symfpu
=ON
;;
251 --no-symfpu) symfpu
=OFF
;;
253 --tracing) tracing
=ON
;;
254 --no-tracing) tracing
=OFF
;;
256 --unit-testing) unit_testing
=ON
;;
257 --no-unit-testing) unit_testing
=OFF
;;
259 --python2) python2
=ON
;;
260 --no-python2) python2
=OFF
;;
262 --python3) python3
=ON
;;
263 --no-python3) python3
=OFF
;;
265 --valgrind) valgrind
=ON
;;
266 --no-valgrind) valgrind
=OFF
;;
268 --profiling) profiling
=ON
;;
269 --no-profiling) profiling
=OFF
;;
271 --readline) readline
=ON
;;
272 --no-readline) readline
=OFF
;;
274 --language-bindings) die
"missing argument to $1 (try -h)" ;;
275 --language-bindings=*)
280 java
) language_bindings_java
=ON
;;
281 python
) language_bindings_python
=ON
;;
283 language_bindings_python
=ON
284 language_bindings_java
=ON
;;
285 *) die
"invalid language binding '$l' specified (try -h)" ;;
291 --abc-dir) die
"missing argument to $1 (try -h)" ;;
292 --abc-dir=*) abc_dir
=${1##*=} ;;
294 --antlr-dir) die
"missing argument to $1 (try -h)" ;;
295 --antlr-dir=*) antlr_dir
=${1##*=} ;;
297 --cadical-dir) die
"missing argument to $1 (try -h)" ;;
298 --cadical-dir=*) cadical_dir
=${1##*=} ;;
300 --cryptominisat-dir) die
"missing argument to $1 (try -h)" ;;
301 --cryptominisat-dir=*) cryptominisat_dir
=${1##*=} ;;
303 --cxxtest-dir) die
"missing argument to $1 (try -h)" ;;
304 --cxxtest-dir=*) cxxtest_dir
=${1##*=} ;;
306 --drat2er-dir) die
"missing argument to $1 (try -h)" ;;
307 --drat2er-dir=*) drat2er_dir
=${1##*=} ;;
309 --glpk-dir) die
"missing argument to $1 (try -h)" ;;
310 --glpk-dir=*) glpk_dir
=${1##*=} ;;
312 --gmp-dir) die
"missing argument to $1 (try -h)" ;;
313 --gmp-dir=*) gmp_dir
=${1##*=} ;;
315 --lfsc-dir) die
"missing argument to $1 (try -h)" ;;
316 --lfsc-dir=*) lfsc_dir
=${1##*=} ;;
318 --symfpu-dir) die
"missing argument to $1 (try -h)" ;;
319 --symfpu-dir=*) symfpu_dir
=${1##*=} ;;
321 -*) die
"invalid option '$1' (try -h)";;
324 production
) buildtype
=Production
;;
325 debug
) buildtype
=Debug
;;
326 testing
) buildtype
=Testing
;;
327 competition
) buildtype
=Competition
;;
328 *) die
"invalid build type (try -h)";;
335 #--------------------------------------------------------------------------#
339 [ $buildtype != default
] \
340 && cmake_opts
="$cmake_opts -DCMAKE_BUILD_TYPE=$buildtype"
342 [ $asan != default
] \
343 && cmake_opts
="$cmake_opts -DENABLE_ASAN=$asan"
344 [ $assertions != default
] \
345 && cmake_opts
="$cmake_opts -DENABLE_ASSERTIONS=$assertions"
346 [ $best != default
] \
347 && cmake_opts
="$cmake_opts -DENABLE_BEST=$best"
348 [ $coverage != default
] \
349 && cmake_opts
="$cmake_opts -DENABLE_COVERAGE=$coverage"
350 [ $debug_symbols != default
] \
351 && cmake_opts
="$cmake_opts -DENABLE_DEBUG_SYMBOLS=$debug_symbols"
352 [ $debug_context_mm != default
] \
353 && cmake_opts
="$cmake_opts -DENABLE_DEBUG_CONTEXT_MM=$debug_context_mm"
354 [ $dumping != default
] \
355 && cmake_opts
="$cmake_opts -DENABLE_DUMPING=$dumping"
356 [ $gpl != default
] \
357 && cmake_opts
="$cmake_opts -DENABLE_GPL=$gpl"
358 [ $win64 != default
] \
359 && cmake_opts
="$cmake_opts -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw64.cmake"
360 [ $muzzle != default
] \
361 && cmake_opts
="$cmake_opts -DENABLE_MUZZLE=$muzzle"
362 [ $optimized != default
] \
363 && cmake_opts
="$cmake_opts -DENABLE_OPTIMIZED=$optimized"
364 [ $portfolio != default
] \
365 && cmake_opts
="$cmake_opts -DENABLE_PORTFOLIO=$portfolio"
366 [ $proofs != default
] \
367 && cmake_opts
="$cmake_opts -DENABLE_PROOFS=$proofs"
368 [ $replay != default
] \
369 && cmake_opts
="$cmake_opts -DENABLE_REPLAY=$replay"
370 [ $shared != default
] \
371 && cmake_opts
="$cmake_opts -DENABLE_SHARED=$shared"
372 [ $static_binary != default
] \
373 && cmake_opts
="$cmake_opts -DENABLE_STATIC_BINARY=$static_binary"
374 [ $statistics != default
] \
375 && cmake_opts
="$cmake_opts -DENABLE_STATISTICS=$statistics"
376 [ $tracing != default
] \
377 && cmake_opts
="$cmake_opts -DENABLE_TRACING=$tracing"
378 [ $unit_testing != default
] \
379 && cmake_opts
="$cmake_opts -DENABLE_UNIT_TESTING=$unit_testing"
380 [ $python2 != default
] \
381 && cmake_opts
="$cmake_opts -DUSE_PYTHON2=$python2"
382 [ $python3 != default
] \
383 && cmake_opts
="$cmake_opts -DUSE_PYTHON3=$python3"
384 [ $valgrind != default
] \
385 && cmake_opts
="$cmake_opts -DENABLE_VALGRIND=$valgrind"
386 [ $profiling != default
] \
387 && cmake_opts
="$cmake_opts -DENABLE_PROFILING=$profiling"
388 [ $readline != default
] \
389 && cmake_opts
="$cmake_opts -DUSE_READLINE=$readline"
390 [ $abc != default
] \
391 && cmake_opts
="$cmake_opts -DUSE_ABC=$abc"
392 [ $cadical != default
] \
393 && cmake_opts
="$cmake_opts -DUSE_CADICAL=$cadical"
394 [ $cln != default
] \
395 && cmake_opts
="$cmake_opts -DUSE_CLN=$cln"
396 [ $cryptominisat != default
] \
397 && cmake_opts
="$cmake_opts -DUSE_CRYPTOMINISAT=$cryptominisat"
398 [ $drat2er != default
] \
399 && cmake_opts
="$cmake_opts -DUSE_DRAT2ER=$drat2er"
400 [ $glpk != default
] \
401 && cmake_opts
="$cmake_opts -DUSE_GLPK=$glpk"
402 [ $lfsc != default
] \
403 && cmake_opts
="$cmake_opts -DUSE_LFSC=$lfsc"
404 [ $symfpu != default
] \
405 && cmake_opts
="$cmake_opts -DUSE_SYMFPU=$symfpu"
407 [ $language_bindings_java != default
] \
408 && cmake_opts
="$cmake_opts -DBUILD_BINDINGS_JAVA=$language_bindings_java"
409 [ $language_bindings_python != default
] \
410 && cmake_opts
="$cmake_opts -DBUILD_BINDINGS_PYTHON=$language_bindings_python"
412 [ "$abc_dir" != default
] \
413 && cmake_opts
="$cmake_opts -DABC_DIR=$abc_dir"
414 [ "$antlr_dir" != default
] \
415 && cmake_opts
="$cmake_opts -DANTLR_DIR=$antlr_dir"
416 [ "$cadical_dir" != default
] \
417 && cmake_opts
="$cmake_opts -DCADICAL_DIR=$cadical_dir"
418 [ "$cryptominisat_dir" != default
] \
419 && cmake_opts
="$cmake_opts -DCRYPTOMINISAT_DIR=$cryptominisat_dir"
420 [ "$cxxtest_dir" != default
] \
421 && cmake_opts
="$cmake_opts -DCXXTEST_DIR=$cxxtest_dir"
422 [ "$drat2er_dir" != default
] \
423 && cmake_opts
="$cmake_opts -DDRAT2ER_DIR=$drat2er_dir"
424 [ "$glpk_dir" != default
] \
425 && cmake_opts
="$cmake_opts -DGLPK_DIR=$glpk_dir"
426 [ "$gmp_dir" != default
] \
427 && cmake_opts
="$cmake_opts -DGMP_DIR=$gmp_dir"
428 [ "$lfsc_dir" != default
] \
429 && cmake_opts
="$cmake_opts -DLFSC_DIR=$lfsc_dir"
430 [ "$symfpu_dir" != default
] \
431 && cmake_opts
="$cmake_opts -DSYMFPU_DIR=$symfpu_dir"
432 [ "$install_prefix" != default
] \
433 && cmake_opts
="$cmake_opts -DCMAKE_INSTALL_PREFIX=$install_prefix"
434 [ -n "$program_prefix" ] \
435 && cmake_opts
="$cmake_opts -DPROGRAM_PREFIX=$program_prefix"
439 # The cmake toolchain can't be changed once it is configured in $build_dir.
440 # Thus, remove $build_dir and create an empty directory.
441 [ $win64 = ON
] && [ -e "$build_dir" ] && rm -r "$build_dir"
442 mkdir
-p "$build_dir"
444 cd "$build_dir" ||
exit 1
446 [ -e CMakeCache.txt
] && rm CMakeCache.txt
447 build_dir_escaped
=$
(echo "$build_dir" |
sed 's/\//\\\//g')
448 cmake
"$root_dir" $cmake_opts 2>&1 | \
449 sed "s/^Now just/Now change to '$build_dir_escaped' and/"