2 #--------------------------------------------------------------------------#
8 Usage: $0 [<build type>] [<option> ...]
19 -h, --help display this help and exit
20 --prefix=STR install directory
21 --program-prefix=STR prefix of binaries prepended on make install
22 --name=STR use custom build directory name (optionally: +path)
23 --best turn on dependencies known to give best performance
24 --gpl permit GPL dependencies, if available
25 --arm64 cross-compile for Linux ARM 64 bit
26 --win64 cross-compile for Windows 64 bit
27 --ninja use Ninja build system
28 --docs build Api documentation
32 The following flags enable optional features (disable with --no-<option name>).
33 --static build static libraries and binaries [default=no]
34 --static-binary statically link against system libraries
35 (must be disabled for static macOS builds) [default=yes]
36 --debug-symbols include debug symbols
37 --valgrind Valgrind instrumentation
38 --debug-context-mm use the debug context memory manager
39 --statistics include statistics
40 --assertions turn on assertions
41 --tracing include tracing code
42 --dumping include dumping code
43 --muzzle complete silence (no non-result output)
44 --coverage support for gcov coverage testing
45 --profiling support for gprof profiling
46 --unit-testing support for unit testing
47 --python2 force Python 2 (deprecated)
48 --python-bindings build Python bindings based on new C++ API
49 --java-bindings build Java bindings based on new C++ API
50 --all-bindings build bindings for all supported languages
51 --asan build with ASan instrumentation
52 --ubsan build with UBSan instrumentation
53 --tsan build with TSan instrumentation
54 --werror build with -Werror
57 The following flags enable optional packages (disable with --no-<option name>).
58 --cln use CLN instead of GMP
59 --glpk use GLPK simplex solver
60 --abc use the ABC AIG library
61 --cadical use the CaDiCaL SAT solver
62 --cryptominisat use the CryptoMiniSat SAT solver
63 --kissat use the Kissat SAT solver
64 --poly use the LibPoly library
65 --symfpu use SymFPU for floating point solver
66 --editline support the editline library
68 Optional Path to Optional Packages:
69 --abc-dir=PATH path to top level of ABC source tree
70 --cadical-dir=PATH path to top level of CaDiCaL source tree
71 --cryptominisat-dir=PATH path to top level of CryptoMiniSat source tree
72 --glpk-dir=PATH path to top level of GLPK installation
73 --gmp-dir=PATH path to top level of GMP installation
74 --kissat-dir=PATH path to top level of Kissat source tree
75 --poly-dir=PATH path to top level of LibPoly source tree
76 --symfpu-dir=PATH path to top level of SymFPU source tree
79 --lib-only only build the library, but not the executable or
80 the parser (default: off)
86 #--------------------------------------------------------------------------#
89 echo "*** configure.sh: $*" 1>&2
94 echo "[configure.sh] $*"
97 #--------------------------------------------------------------------------#
99 [ ! -e src
/theory
] && die
"$0 not called from CVC4 base directory"
101 #--------------------------------------------------------------------------#
104 install_prefix
=default
107 #--------------------------------------------------------------------------#
118 cryptominisat
=default
119 debug_context_mm
=default
120 debug_symbols
=default
131 python_bindings
=default
132 java_bindings
=default
135 static_binary
=default
149 cryptominisat_dir
=default
158 #--------------------------------------------------------------------------#
170 --no-asan) asan
=OFF
;;
173 --no-ubsan) ubsan
=OFF
;;
176 --no-tsan) tsan
=OFF
;;
178 --werror) werror
=ON
;;
180 --assertions) assertions
=ON
;;
181 --no-assertions) assertions
=OFF
;;
193 --prefix) die
"missing argument to $1 (try -h)" ;;
195 install_prefix
=${1##*=}
196 # Check if install_prefix is an absolute path and if not, make it
198 case $install_prefix in
199 /*) ;; # absolute path
200 *) install_prefix
=$
(pwd)/$install_prefix ;; # make absolute path
204 --program-prefix) die
"missing argument to $1 (try -h)" ;;
205 --program-prefix=*) program_prefix
=${1##*=} ;;
207 --name) die
"missing argument to $1 (try -h)" ;;
208 --name=*) build_dir
=${1##*=} ;;
210 --cadical) cadical
=ON
;;
211 --no-cadical) cadical
=OFF
;;
216 --coverage) coverage
=ON
;;
217 --no-coverage) coverage
=OFF
;;
219 --cryptominisat) cryptominisat
=ON
;;
220 --no-cryptominisat) cryptominisat
=OFF
;;
222 --debug-symbols) debug_symbols
=ON
;;
223 --no-debug-symbols) debug_symbols
=OFF
;;
225 --debug-context-mm) debug_context_mm
=ON
;;
226 --no-debug-context-mm) debug_context_mm
=OFF
;;
228 --dumping) dumping
=ON
;;
229 --no-dumping) dumping
=OFF
;;
234 --kissat) kissat
=ON
;;
235 --no-kissat) kissat
=OFF
;;
244 --no-docs) docs
=OFF
;;
247 --no-glpk) glpk
=OFF
;;
250 --no-poly) poly
=OFF
;;
252 --muzzle) muzzle
=ON
;;
253 --no-muzzle) muzzle
=OFF
;;
255 --static) shared
=OFF
; static_binary
=ON
;;
256 --no-static) shared
=ON
;;
258 --static-binary) static_binary
=ON
;;
259 --no-static-binary) static_binary
=OFF
;;
261 --statistics) statistics
=ON
;;
262 --no-statistics) statistics
=OFF
;;
264 --symfpu) symfpu
=ON
;;
265 --no-symfpu) symfpu
=OFF
;;
267 --tracing) tracing
=ON
;;
268 --no-tracing) tracing
=OFF
;;
270 --unit-testing) unit_testing
=ON
;;
271 --no-unit-testing) unit_testing
=OFF
;;
273 --python2) python2
=ON
;;
274 --no-python2) python2
=OFF
;;
276 --python-bindings) python_bindings
=ON
;;
277 --no-python-bindings) python_bindings
=OFF
;;
279 --java-bindings) java_bindings
=ON
;;
280 --no-java-bindings) java_bindings
=OFF
;;
286 --valgrind) valgrind
=ON
;;
287 --no-valgrind) valgrind
=OFF
;;
289 --profiling) profiling
=ON
;;
290 --no-profiling) profiling
=OFF
;;
292 --editline) editline
=ON
;;
293 --no-editline) editline
=OFF
;;
295 --abc-dir) die
"missing argument to $1 (try -h)" ;;
296 --abc-dir=*) abc_dir
=${1##*=} ;;
298 --cadical-dir) die
"missing argument to $1 (try -h)" ;;
299 --cadical-dir=*) cadical_dir
=${1##*=} ;;
301 --cryptominisat-dir) die
"missing argument to $1 (try -h)" ;;
302 --cryptominisat-dir=*) cryptominisat_dir
=${1##*=} ;;
304 --glpk-dir) die
"missing argument to $1 (try -h)" ;;
305 --glpk-dir=*) glpk_dir
=${1##*=} ;;
307 --gmp-dir) die
"missing argument to $1 (try -h)" ;;
308 --gmp-dir=*) gmp_dir
=${1##*=} ;;
310 --kissat-dir) die
"missing argument to $1 (try -h)" ;;
311 --kissat-dir=*) kissat_dir
=${1##*=} ;;
313 --poly-dir) die
"missing argument to $1 (try -h)" ;;
314 --poly-dir=*) poly_dir
=${1##*=} ;;
316 --symfpu-dir) die
"missing argument to $1 (try -h)" ;;
317 --symfpu-dir=*) symfpu_dir
=${1##*=} ;;
319 --lib-only) lib_only
=ON
;;
321 -*) die
"invalid option '$1' (try -h)";;
324 production
) buildtype
=Production
;;
325 debug
) buildtype
=Debug
;;
326 testing
) buildtype
=Testing
;;
327 competition
) buildtype
=Competition
;;
328 competition-inc
) buildtype
=Competition
; comp_inc
=ON
;;
329 *) die
"invalid build type (try -h)";;
336 #--------------------------------------------------------------------------#
338 if [ $werror != default
]; then
339 export CFLAGS
=-Werror
340 export CXXFLAGS
=-Werror
345 [ $buildtype != default
] \
346 && cmake_opts
="$cmake_opts -DCMAKE_BUILD_TYPE=$buildtype"
348 [ $asan != default
] \
349 && cmake_opts
="$cmake_opts -DENABLE_ASAN=$asan"
350 [ $ubsan != default
] \
351 && cmake_opts
="$cmake_opts -DENABLE_UBSAN=$ubsan"
352 [ $tsan != default
] \
353 && cmake_opts
="$cmake_opts -DENABLE_TSAN=$tsan"
354 [ $assertions != default
] \
355 && cmake_opts
="$cmake_opts -DENABLE_ASSERTIONS=$assertions"
356 [ $comp_inc != default
] \
357 && cmake_opts
="$cmake_opts -DENABLE_COMP_INC_TRACK=$comp_inc"
358 [ $coverage != default
] \
359 && cmake_opts
="$cmake_opts -DENABLE_COVERAGE=$coverage"
360 [ $debug_symbols != default
] \
361 && cmake_opts
="$cmake_opts -DENABLE_DEBUG_SYMBOLS=$debug_symbols"
362 [ $debug_context_mm != default
] \
363 && cmake_opts
="$cmake_opts -DENABLE_DEBUG_CONTEXT_MM=$debug_context_mm"
364 [ $dumping != default
] \
365 && cmake_opts
="$cmake_opts -DENABLE_DUMPING=$dumping"
366 [ $gpl != default
] \
367 && cmake_opts
="$cmake_opts -DENABLE_GPL=$gpl"
368 [ $win64 != default
] \
369 && cmake_opts
="$cmake_opts -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw64.cmake"
370 [ $arm64 != default
] \
371 && cmake_opts
="$cmake_opts -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-aarch64.cmake"
372 [ $ninja != default
] && cmake_opts
="$cmake_opts -G Ninja"
373 [ $muzzle != default
] \
374 && cmake_opts
="$cmake_opts -DENABLE_MUZZLE=$muzzle"
375 [ $shared != default
] \
376 && cmake_opts
="$cmake_opts -DENABLE_SHARED=$shared"
377 [ $static_binary != default
] \
378 && cmake_opts
="$cmake_opts -DENABLE_STATIC_BINARY=$static_binary"
379 [ $statistics != default
] \
380 && cmake_opts
="$cmake_opts -DENABLE_STATISTICS=$statistics"
381 [ $tracing != default
] \
382 && cmake_opts
="$cmake_opts -DENABLE_TRACING=$tracing"
383 [ $unit_testing != default
] \
384 && cmake_opts
="$cmake_opts -DENABLE_UNIT_TESTING=$unit_testing"
385 [ $python2 != default
] \
386 && cmake_opts
="$cmake_opts -DUSE_PYTHON2=$python2"
387 [ $docs != default
] \
388 && cmake_opts
="$cmake_opts -DBUILD_DOCS=$docs"
389 [ $python_bindings != default
] \
390 && cmake_opts
="$cmake_opts -DBUILD_BINDINGS_PYTHON=$python_bindings"
391 [ $java_bindings != default
] \
392 && cmake_opts
="$cmake_opts -DBUILD_BINDINGS_JAVA=$java_bindings"
393 [ $valgrind != default
] \
394 && cmake_opts
="$cmake_opts -DENABLE_VALGRIND=$valgrind"
395 [ $profiling != default
] \
396 && cmake_opts
="$cmake_opts -DENABLE_PROFILING=$profiling"
397 [ $editline != default
] \
398 && cmake_opts
="$cmake_opts -DUSE_EDITLINE=$editline"
399 [ $abc != default
] \
400 && cmake_opts
="$cmake_opts -DUSE_ABC=$abc"
401 [ $cadical != default
] \
402 && cmake_opts
="$cmake_opts -DUSE_CADICAL=$cadical"
403 [ $cln != default
] \
404 && cmake_opts
="$cmake_opts -DUSE_CLN=$cln"
405 [ $cryptominisat != default
] \
406 && cmake_opts
="$cmake_opts -DUSE_CRYPTOMINISAT=$cryptominisat"
407 [ $glpk != default
] \
408 && cmake_opts
="$cmake_opts -DUSE_GLPK=$glpk"
409 [ $kissat != default
] \
410 && cmake_opts
="$cmake_opts -DUSE_KISSAT=$kissat"
411 [ $poly != default
] \
412 && cmake_opts
="$cmake_opts -DUSE_POLY=$poly"
413 [ $symfpu != default
] \
414 && cmake_opts
="$cmake_opts -DUSE_SYMFPU=$symfpu"
415 [ "$abc_dir" != default
] \
416 && cmake_opts
="$cmake_opts -DABC_DIR=$abc_dir"
417 [ "$cadical_dir" != default
] \
418 && cmake_opts
="$cmake_opts -DCADICAL_DIR=$cadical_dir"
419 [ "$cryptominisat_dir" != default
] \
420 && cmake_opts
="$cmake_opts -DCRYPTOMINISAT_DIR=$cryptominisat_dir"
421 [ "$glpk_dir" != default
] \
422 && cmake_opts
="$cmake_opts -DGLPK_DIR=$glpk_dir"
423 [ "$gmp_dir" != default
] \
424 && cmake_opts
="$cmake_opts -DGMP_DIR=$gmp_dir"
425 [ "$kissat_dir" != default
] \
426 && cmake_opts
="$cmake_opts -DKISSAT=$kissat_dir"
427 [ "$poly_dir" != default
] \
428 && cmake_opts
="$cmake_opts -DPOLY_DIR=$poly_dir"
429 [ "$symfpu_dir" != default
] \
430 && cmake_opts
="$cmake_opts -DSYMFPU_DIR=$symfpu_dir"
431 [ "$lib_only" != default
] \
432 && cmake_opts
="$cmake_opts -DBUILD_LIB_ONLY=$lib_only"
433 [ "$install_prefix" != default
] \
434 && cmake_opts
="$cmake_opts -DCMAKE_INSTALL_PREFIX=$install_prefix"
435 [ -n "$program_prefix" ] \
436 && cmake_opts
="$cmake_opts -DPROGRAM_PREFIX=$program_prefix"
440 # The cmake toolchain can't be changed once it is configured in $build_dir.
441 # Thus, remove $build_dir and create an empty directory.
442 [ $win64 = ON
] && [ -e "$build_dir" ] && rm -r "$build_dir"
443 [ $arm64 = ON
] && [ -e "$build_dir" ] && rm -r "$build_dir"
444 mkdir
-p "$build_dir"
448 [ -e CMakeCache.txt
] && rm CMakeCache.txt
449 build_dir_escaped
=$
(echo "$build_dir" |
sed 's/\//\\\//g')
450 cmake
"$root_dir" $cmake_opts 2>&1 | \
451 sed "s/^Now just/Now change to '$build_dir_escaped' and/"