2 #--------------------------------------------------------------------------#
6 Usage: $0 [<build type>] [<option> ...]
17 -h, --help display this help and exit
18 --prefix=STR install directory
19 --program-prefix=STR prefix of binaries prepended on make install
20 --name=STR use custom build directory name (optionally: +path)
21 --best turn on dependencies known to give best performance
22 --gpl permit GPL dependencies, if available
23 --win64 cross-compile for Windows 64 bit
24 --ninja use Ninja build system
28 The following flags enable optional features (disable with --no-<option name>).
29 --static build static libraries and binaries [default=no]
30 --static-binary enable/disable static binaries
31 --proofs support for proof generation
32 --optimized optimize the build
33 --debug-symbols include debug symbols
34 --valgrind Valgrind instrumentation
35 --debug-context-mm use the debug context memory manager
36 --statistics include statistics
37 --replay turn on the replay feature
38 --assertions turn on assertions
39 --tracing include tracing code
40 --dumping include dumping code
41 --muzzle complete silence (no non-result output)
42 --coverage support for gcov coverage testing
43 --profiling support for gprof profiling
44 --unit-testing support for unit testing
45 --python2 prefer using Python 2 (also for Python bindings)
46 --python3 prefer using Python 3 (also for Python bindings)
47 --python-bindings build Python bindings based on new C++ API
48 --asan build with ASan instrumentation
49 --ubsan build with UBSan instrumentation
50 --tsan build with TSan instrumentation
52 The following options configure parameterized features.
54 --language-bindings[=java,python,all]
55 specify language bindings to build
58 The following flags enable optional packages (disable with --no-<option name>).
59 --cln use CLN instead of GMP
60 --glpk use GLPK simplex solver
61 --abc use the ABC AIG library
62 --cadical use the CaDiCaL SAT solver
63 --cryptominisat use the CryptoMiniSat SAT solver
64 --drat2er use drat2er (required for eager BV proofs)
65 --lfsc use the LFSC proof checker
66 --symfpu use SymFPU for floating point solver
67 --portfolio build the multithreaded portfolio version of CVC4
69 --readline support the readline library
71 Optional Path to Optional Packages:
72 --abc-dir=PATH path to top level of ABC source tree
73 --antlr-dir=PATH path to ANTLR C headers and libraries
74 --cadical-dir=PATH path to top level of CaDiCaL source tree
75 --cryptominisat-dir=PATH path to top level of CryptoMiniSat source tree
76 --drat2er-dir=PATH path to the top level of the drat2er installation
77 --cxxtest-dir=PATH path to CxxTest installation
78 --glpk-dir=PATH path to top level of GLPK installation
79 --gmp-dir=PATH path to top level of GMP installation
80 --lfsc-dir=PATH path to top level of LFSC source tree
81 --symfpu-dir=PATH path to top level of SymFPU source tree
87 #--------------------------------------------------------------------------#
90 echo "*** configure.sh: $*" 1>&2
95 echo "[configure.sh] $*"
98 #--------------------------------------------------------------------------#
100 [ ! -e src
/theory
] && die
"$0 not called from CVC4 base directory"
102 #--------------------------------------------------------------------------#
105 install_prefix
=default
108 #--------------------------------------------------------------------------#
122 cryptominisat
=default
123 debug_symbols
=default
124 debug_context_mm
=default
138 static_binary
=default
145 python_bindings
=default
150 language_bindings_java
=default
151 language_bindings_python
=default
156 cryptominisat_dir
=default
164 #--------------------------------------------------------------------------#
176 --no-asan) asan
=OFF
;;
179 --no-ubsan) ubsan
=OFF
;;
182 --no-tsan) tsan
=OFF
;;
184 --assertions) assertions
=ON
;;
185 --no-assertions) assertions
=OFF
;;
188 --no-best) best
=OFF
;;
190 --prefix) die
"missing argument to $1 (try -h)" ;;
192 install_prefix
=${1##*=}
193 # Check if install_prefix is an absolute path and if not, make it
195 case $install_prefix in
196 /*) ;; # absolute path
197 *) install_prefix
=$
(pwd)/$install_prefix ;; # make absolute path
201 --program-prefix) die
"missing argument to $1 (try -h)" ;;
202 --program-prefix=*) program_prefix
=${1##*=} ;;
204 --name) die
"missing argument to $1 (try -h)" ;;
205 --name=*) build_dir
=${1##*=} ;;
207 --cadical) cadical
=ON
;;
208 --no-cadical) cadical
=OFF
;;
213 --coverage) coverage
=ON
;;
214 --no-coverage) coverage
=OFF
;;
216 --cryptominisat) cryptominisat
=ON
;;
217 --no-cryptominisat) cryptominisat
=OFF
;;
219 --debug-symbols) debug_symbols
=ON
;;
220 --no-debug-symbols) debug_symbols
=OFF
;;
222 --debug-context-mm) debug_context_mm
=ON
;;
223 --no-debug-context-mm) debug_context_mm
=OFF
;;
225 --drat2er) drat2er
=ON
;;
226 --no-drat2er) drat2er
=OFF
;;
228 --dumping) dumping
=ON
;;
229 --no-dumping) dumping
=OFF
;;
235 --no-win64) win64
=OFF
;;
240 --no-glpk) glpk
=OFF
;;
243 --no-lfsc) lfsc
=OFF
;;
245 --muzzle) muzzle
=ON
;;
246 --no-muzzle) muzzle
=OFF
;;
248 --optimized) optimized
=ON
;;
249 --no-optimized) optimized
=OFF
;;
251 --portfolio) portfolio
=ON
;;
252 --no-portfolio) portfolio
=OFF
;;
254 --proofs) proofs
=ON
;;
255 --no-proofs) proofs
=OFF
;;
257 --replay) replay
=ON
;;
258 --no-replay) replay
=OFF
;;
260 --static) shared
=OFF
; static_binary
=ON
;;
261 --no-static) shared
=ON
;;
263 --static-binary) static_binary
=ON
;;
264 --no-static-binary) static_binary
=OFF
;;
266 --statistics) statistics
=ON
;;
267 --no-statistics) statistics
=OFF
;;
269 --symfpu) symfpu
=ON
;;
270 --no-symfpu) symfpu
=OFF
;;
272 --tracing) tracing
=ON
;;
273 --no-tracing) tracing
=OFF
;;
275 --unit-testing) unit_testing
=ON
;;
276 --no-unit-testing) unit_testing
=OFF
;;
278 --python2) python2
=ON
;;
279 --no-python2) python2
=OFF
;;
281 --python3) python3
=ON
;;
282 --no-python3) python3
=OFF
;;
284 --python-bindings) python_bindings
=ON
;;
285 --no-python-bindings) python_bindings
=OFF
;;
287 --valgrind) valgrind
=ON
;;
288 --no-valgrind) valgrind
=OFF
;;
290 --profiling) profiling
=ON
;;
291 --no-profiling) profiling
=OFF
;;
293 --readline) readline
=ON
;;
294 --no-readline) readline
=OFF
;;
296 --language-bindings) die
"missing argument to $1 (try -h)" ;;
297 --language-bindings=*)
302 java
) language_bindings_java
=ON
;;
303 python
) language_bindings_python
=ON
;;
305 language_bindings_python
=ON
306 language_bindings_java
=ON
;;
307 *) die
"invalid language binding '$l' specified (try -h)" ;;
313 --abc-dir) die
"missing argument to $1 (try -h)" ;;
314 --abc-dir=*) abc_dir
=${1##*=} ;;
316 --antlr-dir) die
"missing argument to $1 (try -h)" ;;
317 --antlr-dir=*) antlr_dir
=${1##*=} ;;
319 --cadical-dir) die
"missing argument to $1 (try -h)" ;;
320 --cadical-dir=*) cadical_dir
=${1##*=} ;;
322 --cryptominisat-dir) die
"missing argument to $1 (try -h)" ;;
323 --cryptominisat-dir=*) cryptominisat_dir
=${1##*=} ;;
325 --cxxtest-dir) die
"missing argument to $1 (try -h)" ;;
326 --cxxtest-dir=*) cxxtest_dir
=${1##*=} ;;
328 --drat2er-dir) die
"missing argument to $1 (try -h)" ;;
329 --drat2er-dir=*) drat2er_dir
=${1##*=} ;;
331 --glpk-dir) die
"missing argument to $1 (try -h)" ;;
332 --glpk-dir=*) glpk_dir
=${1##*=} ;;
334 --gmp-dir) die
"missing argument to $1 (try -h)" ;;
335 --gmp-dir=*) gmp_dir
=${1##*=} ;;
337 --lfsc-dir) die
"missing argument to $1 (try -h)" ;;
338 --lfsc-dir=*) lfsc_dir
=${1##*=} ;;
340 --symfpu-dir) die
"missing argument to $1 (try -h)" ;;
341 --symfpu-dir=*) symfpu_dir
=${1##*=} ;;
343 -*) die
"invalid option '$1' (try -h)";;
346 production
) buildtype
=Production
;;
347 debug
) buildtype
=Debug
;;
348 testing
) buildtype
=Testing
;;
349 competition
) buildtype
=Competition
;;
350 competition-inc
) buildtype
=Competition
; comp_inc
=ON
;;
351 *) die
"invalid build type (try -h)";;
358 #--------------------------------------------------------------------------#
362 [ $buildtype != default
] \
363 && cmake_opts
="$cmake_opts -DCMAKE_BUILD_TYPE=$buildtype"
365 [ $asan != default
] \
366 && cmake_opts
="$cmake_opts -DENABLE_ASAN=$asan"
367 [ $ubsan != default
] \
368 && cmake_opts
="$cmake_opts -DENABLE_UBSAN=$ubsan"
369 [ $tsan != default
] \
370 && cmake_opts
="$cmake_opts -DENABLE_TSAN=$tsan"
371 [ $assertions != default
] \
372 && cmake_opts
="$cmake_opts -DENABLE_ASSERTIONS=$assertions"
373 [ $best != default
] \
374 && cmake_opts
="$cmake_opts -DENABLE_BEST=$best"
375 [ $comp_inc != default
] \
376 && cmake_opts
="$cmake_opts -DENABLE_COMP_INC_TRACK=$comp_inc"
377 [ $coverage != default
] \
378 && cmake_opts
="$cmake_opts -DENABLE_COVERAGE=$coverage"
379 [ $debug_symbols != default
] \
380 && cmake_opts
="$cmake_opts -DENABLE_DEBUG_SYMBOLS=$debug_symbols"
381 [ $debug_context_mm != default
] \
382 && cmake_opts
="$cmake_opts -DENABLE_DEBUG_CONTEXT_MM=$debug_context_mm"
383 [ $dumping != default
] \
384 && cmake_opts
="$cmake_opts -DENABLE_DUMPING=$dumping"
385 [ $gpl != default
] \
386 && cmake_opts
="$cmake_opts -DENABLE_GPL=$gpl"
387 [ $win64 != default
] \
388 && cmake_opts
="$cmake_opts -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw64.cmake"
389 [ $ninja != default
] && cmake_opts
="$cmake_opts -G Ninja"
390 [ $muzzle != default
] \
391 && cmake_opts
="$cmake_opts -DENABLE_MUZZLE=$muzzle"
392 [ $optimized != default
] \
393 && cmake_opts
="$cmake_opts -DENABLE_OPTIMIZED=$optimized"
394 [ $proofs != default
] \
395 && cmake_opts
="$cmake_opts -DENABLE_PROOFS=$proofs"
396 [ $replay != default
] \
397 && cmake_opts
="$cmake_opts -DENABLE_REPLAY=$replay"
398 [ $shared != default
] \
399 && cmake_opts
="$cmake_opts -DENABLE_SHARED=$shared"
400 [ $static_binary != default
] \
401 && cmake_opts
="$cmake_opts -DENABLE_STATIC_BINARY=$static_binary"
402 [ $statistics != default
] \
403 && cmake_opts
="$cmake_opts -DENABLE_STATISTICS=$statistics"
404 [ $tracing != default
] \
405 && cmake_opts
="$cmake_opts -DENABLE_TRACING=$tracing"
406 [ $unit_testing != default
] \
407 && cmake_opts
="$cmake_opts -DENABLE_UNIT_TESTING=$unit_testing"
408 [ $python2 != default
] \
409 && cmake_opts
="$cmake_opts -DUSE_PYTHON2=$python2"
410 [ $python3 != default
] \
411 && cmake_opts
="$cmake_opts -DUSE_PYTHON3=$python3"
412 [ $python_bindings != default
] \
413 && cmake_opts
="$cmake_opts -DBUILD_BINDINGS_PYTHON=$python_bindings"
414 [ $valgrind != default
] \
415 && cmake_opts
="$cmake_opts -DENABLE_VALGRIND=$valgrind"
416 [ $profiling != default
] \
417 && cmake_opts
="$cmake_opts -DENABLE_PROFILING=$profiling"
418 [ $readline != default
] \
419 && cmake_opts
="$cmake_opts -DUSE_READLINE=$readline"
420 [ $abc != default
] \
421 && cmake_opts
="$cmake_opts -DUSE_ABC=$abc"
422 [ $cadical != default
] \
423 && cmake_opts
="$cmake_opts -DUSE_CADICAL=$cadical"
424 [ $cln != default
] \
425 && cmake_opts
="$cmake_opts -DUSE_CLN=$cln"
426 [ $cryptominisat != default
] \
427 && cmake_opts
="$cmake_opts -DUSE_CRYPTOMINISAT=$cryptominisat"
428 [ $drat2er != default
] \
429 && cmake_opts
="$cmake_opts -DUSE_DRAT2ER=$drat2er"
430 [ $glpk != default
] \
431 && cmake_opts
="$cmake_opts -DUSE_GLPK=$glpk"
432 [ $lfsc != default
] \
433 && cmake_opts
="$cmake_opts -DUSE_LFSC=$lfsc"
434 [ $symfpu != default
] \
435 && cmake_opts
="$cmake_opts -DUSE_SYMFPU=$symfpu"
437 [ $language_bindings_java != default
] \
438 && cmake_opts
="$cmake_opts -DBUILD_SWIG_BINDINGS_JAVA=$language_bindings_java"
439 [ $language_bindings_python != default
] \
440 && cmake_opts
="$cmake_opts -DBUILD_SWIG_BINDINGS_PYTHON=$language_bindings_python"
442 [ "$abc_dir" != default
] \
443 && cmake_opts
="$cmake_opts -DABC_DIR=$abc_dir"
444 [ "$antlr_dir" != default
] \
445 && cmake_opts
="$cmake_opts -DANTLR_DIR=$antlr_dir"
446 [ "$cadical_dir" != default
] \
447 && cmake_opts
="$cmake_opts -DCADICAL_DIR=$cadical_dir"
448 [ "$cryptominisat_dir" != default
] \
449 && cmake_opts
="$cmake_opts -DCRYPTOMINISAT_DIR=$cryptominisat_dir"
450 [ "$cxxtest_dir" != default
] \
451 && cmake_opts
="$cmake_opts -DCXXTEST_DIR=$cxxtest_dir"
452 [ "$drat2er_dir" != default
] \
453 && cmake_opts
="$cmake_opts -DDRAT2ER_DIR=$drat2er_dir"
454 [ "$glpk_dir" != default
] \
455 && cmake_opts
="$cmake_opts -DGLPK_DIR=$glpk_dir"
456 [ "$gmp_dir" != default
] \
457 && cmake_opts
="$cmake_opts -DGMP_DIR=$gmp_dir"
458 [ "$lfsc_dir" != default
] \
459 && cmake_opts
="$cmake_opts -DLFSC_DIR=$lfsc_dir"
460 [ "$symfpu_dir" != default
] \
461 && cmake_opts
="$cmake_opts -DSYMFPU_DIR=$symfpu_dir"
462 [ "$install_prefix" != default
] \
463 && cmake_opts
="$cmake_opts -DCMAKE_INSTALL_PREFIX=$install_prefix"
464 [ -n "$program_prefix" ] \
465 && cmake_opts
="$cmake_opts -DPROGRAM_PREFIX=$program_prefix"
469 # The cmake toolchain can't be changed once it is configured in $build_dir.
470 # Thus, remove $build_dir and create an empty directory.
471 [ $win64 = ON
] && [ -e "$build_dir" ] && rm -r "$build_dir"
472 mkdir
-p "$build_dir"
474 cd "$build_dir" ||
exit 1
476 [ -e CMakeCache.txt
] && rm CMakeCache.txt
477 build_dir_escaped
=$
(echo "$build_dir" |
sed 's/\//\\\//g')
478 cmake
"$root_dir" $cmake_opts 2>&1 | \
479 sed "s/^Now just/Now change to '$build_dir_escaped' and/"