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
31 The following flags enable optional features (disable with --no-<option name>).
32 --static build static libraries and binaries [default=no]
33 --static-binary statically link against system libraries
34 (must be disabled for static macOS builds) [default=yes]
35 --debug-symbols include debug symbols
36 --valgrind Valgrind instrumentation
37 --debug-context-mm use the debug context memory manager
38 --statistics include statistics
39 --assertions turn on assertions
40 --tracing include tracing code
41 --dumping include dumping code
42 --muzzle complete silence (no non-result output)
43 --coverage support for gcov coverage testing
44 --profiling support for gprof profiling
45 --unit-testing support for unit testing
46 --python2 force Python 2 (deprecated)
47 --python-bindings build Python bindings based on new C++ API
48 --java-bindings build Java bindings based on new C++ API
49 --all-bindings build bindings for all supported languages
50 --asan build with ASan instrumentation
51 --ubsan build with UBSan instrumentation
52 --tsan build with TSan instrumentation
53 --werror build with -Werror
56 The following flags enable optional packages (disable with --no-<option name>).
57 --cln use CLN instead of GMP
58 --glpk use GLPK simplex solver
59 --abc use the ABC AIG library
60 --cadical use the CaDiCaL SAT solver
61 --cryptominisat use the CryptoMiniSat SAT solver
62 --kissat use the Kissat SAT solver
63 --poly use the LibPoly library
64 --symfpu use SymFPU for floating point solver
65 --editline support the editline library
67 Optional Path to Optional Packages:
68 --abc-dir=PATH path to top level of ABC source tree
69 --cadical-dir=PATH path to top level of CaDiCaL source tree
70 --cryptominisat-dir=PATH path to top level of CryptoMiniSat source tree
71 --glpk-dir=PATH path to top level of GLPK installation
72 --gmp-dir=PATH path to top level of GMP installation
73 --kissat-dir=PATH path to top level of Kissat source tree
74 --poly-dir=PATH path to top level of LibPoly source tree
75 --symfpu-dir=PATH path to top level of SymFPU source tree
78 --lib-only only build the library, but not the executable or
79 the parser (default: off)
85 #--------------------------------------------------------------------------#
88 echo "*** configure.sh: $*" 1>&2
93 echo "[configure.sh] $*"
96 #--------------------------------------------------------------------------#
98 [ ! -e src
/theory
] && die
"$0 not called from CVC4 base directory"
100 #--------------------------------------------------------------------------#
103 install_prefix
=default
106 #--------------------------------------------------------------------------#
117 cryptominisat
=default
118 debug_context_mm
=default
119 debug_symbols
=default
129 python_bindings
=default
130 java_bindings
=default
133 static_binary
=default
147 cryptominisat_dir
=default
156 #--------------------------------------------------------------------------#
168 --no-asan) asan
=OFF
;;
171 --no-ubsan) ubsan
=OFF
;;
174 --no-tsan) tsan
=OFF
;;
176 --werror) werror
=ON
;;
178 --assertions) assertions
=ON
;;
179 --no-assertions) assertions
=OFF
;;
191 --prefix) die
"missing argument to $1 (try -h)" ;;
193 install_prefix
=${1##*=}
194 # Check if install_prefix is an absolute path and if not, make it
196 case $install_prefix in
197 /*) ;; # absolute path
198 *) install_prefix
=$
(pwd)/$install_prefix ;; # make absolute path
202 --program-prefix) die
"missing argument to $1 (try -h)" ;;
203 --program-prefix=*) program_prefix
=${1##*=} ;;
205 --name) die
"missing argument to $1 (try -h)" ;;
206 --name=*) build_dir
=${1##*=} ;;
208 --cadical) cadical
=ON
;;
209 --no-cadical) cadical
=OFF
;;
214 --coverage) coverage
=ON
;;
215 --no-coverage) coverage
=OFF
;;
217 --cryptominisat) cryptominisat
=ON
;;
218 --no-cryptominisat) cryptominisat
=OFF
;;
220 --debug-symbols) debug_symbols
=ON
;;
221 --no-debug-symbols) debug_symbols
=OFF
;;
223 --debug-context-mm) debug_context_mm
=ON
;;
224 --no-debug-context-mm) debug_context_mm
=OFF
;;
226 --dumping) dumping
=ON
;;
227 --no-dumping) dumping
=OFF
;;
232 --kissat) kissat
=ON
;;
233 --no-kissat) kissat
=OFF
;;
242 --no-glpk) glpk
=OFF
;;
245 --no-poly) poly
=OFF
;;
247 --muzzle) muzzle
=ON
;;
248 --no-muzzle) muzzle
=OFF
;;
250 --static) shared
=OFF
; static_binary
=ON
;;
251 --no-static) shared
=ON
;;
253 --static-binary) static_binary
=ON
;;
254 --no-static-binary) static_binary
=OFF
;;
256 --statistics) statistics
=ON
;;
257 --no-statistics) statistics
=OFF
;;
259 --symfpu) symfpu
=ON
;;
260 --no-symfpu) symfpu
=OFF
;;
262 --tracing) tracing
=ON
;;
263 --no-tracing) tracing
=OFF
;;
265 --unit-testing) unit_testing
=ON
;;
266 --no-unit-testing) unit_testing
=OFF
;;
268 --python2) python2
=ON
;;
269 --no-python2) python2
=OFF
;;
271 --python-bindings) python_bindings
=ON
;;
272 --no-python-bindings) python_bindings
=OFF
;;
274 --java-bindings) java_bindings
=ON
;;
275 --no-java-bindings) java_bindings
=OFF
;;
281 --valgrind) valgrind
=ON
;;
282 --no-valgrind) valgrind
=OFF
;;
284 --profiling) profiling
=ON
;;
285 --no-profiling) profiling
=OFF
;;
287 --editline) editline
=ON
;;
288 --no-editline) editline
=OFF
;;
290 --abc-dir) die
"missing argument to $1 (try -h)" ;;
291 --abc-dir=*) abc_dir
=${1##*=} ;;
293 --cadical-dir) die
"missing argument to $1 (try -h)" ;;
294 --cadical-dir=*) cadical_dir
=${1##*=} ;;
296 --cryptominisat-dir) die
"missing argument to $1 (try -h)" ;;
297 --cryptominisat-dir=*) cryptominisat_dir
=${1##*=} ;;
299 --glpk-dir) die
"missing argument to $1 (try -h)" ;;
300 --glpk-dir=*) glpk_dir
=${1##*=} ;;
302 --gmp-dir) die
"missing argument to $1 (try -h)" ;;
303 --gmp-dir=*) gmp_dir
=${1##*=} ;;
305 --kissat-dir) die
"missing argument to $1 (try -h)" ;;
306 --kissat-dir=*) kissat_dir
=${1##*=} ;;
308 --poly-dir) die
"missing argument to $1 (try -h)" ;;
309 --poly-dir=*) poly_dir
=${1##*=} ;;
311 --symfpu-dir) die
"missing argument to $1 (try -h)" ;;
312 --symfpu-dir=*) symfpu_dir
=${1##*=} ;;
314 --lib-only) lib_only
=ON
;;
316 -*) die
"invalid option '$1' (try -h)";;
319 production
) buildtype
=Production
;;
320 debug
) buildtype
=Debug
;;
321 testing
) buildtype
=Testing
;;
322 competition
) buildtype
=Competition
;;
323 competition-inc
) buildtype
=Competition
; comp_inc
=ON
;;
324 *) die
"invalid build type (try -h)";;
331 #--------------------------------------------------------------------------#
333 if [ $werror != default
]; then
334 export CFLAGS
=-Werror
335 export CXXFLAGS
=-Werror
340 [ $buildtype != default
] \
341 && cmake_opts
="$cmake_opts -DCMAKE_BUILD_TYPE=$buildtype"
343 [ $asan != default
] \
344 && cmake_opts
="$cmake_opts -DENABLE_ASAN=$asan"
345 [ $ubsan != default
] \
346 && cmake_opts
="$cmake_opts -DENABLE_UBSAN=$ubsan"
347 [ $tsan != default
] \
348 && cmake_opts
="$cmake_opts -DENABLE_TSAN=$tsan"
349 [ $assertions != default
] \
350 && cmake_opts
="$cmake_opts -DENABLE_ASSERTIONS=$assertions"
351 [ $comp_inc != default
] \
352 && cmake_opts
="$cmake_opts -DENABLE_COMP_INC_TRACK=$comp_inc"
353 [ $coverage != default
] \
354 && cmake_opts
="$cmake_opts -DENABLE_COVERAGE=$coverage"
355 [ $debug_symbols != default
] \
356 && cmake_opts
="$cmake_opts -DENABLE_DEBUG_SYMBOLS=$debug_symbols"
357 [ $debug_context_mm != default
] \
358 && cmake_opts
="$cmake_opts -DENABLE_DEBUG_CONTEXT_MM=$debug_context_mm"
359 [ $dumping != default
] \
360 && cmake_opts
="$cmake_opts -DENABLE_DUMPING=$dumping"
361 [ $gpl != default
] \
362 && cmake_opts
="$cmake_opts -DENABLE_GPL=$gpl"
363 [ $win64 != default
] \
364 && cmake_opts
="$cmake_opts -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw64.cmake"
365 [ $arm64 != default
] \
366 && cmake_opts
="$cmake_opts -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-aarch64.cmake"
367 [ $ninja != default
] && cmake_opts
="$cmake_opts -G Ninja"
368 [ $muzzle != default
] \
369 && cmake_opts
="$cmake_opts -DENABLE_MUZZLE=$muzzle"
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 [ $python_bindings != default
] \
383 && cmake_opts
="$cmake_opts -DBUILD_BINDINGS_PYTHON=$python_bindings"
384 [ $java_bindings != default
] \
385 && cmake_opts
="$cmake_opts -DBUILD_BINDINGS_JAVA=$java_bindings"
386 [ $valgrind != default
] \
387 && cmake_opts
="$cmake_opts -DENABLE_VALGRIND=$valgrind"
388 [ $profiling != default
] \
389 && cmake_opts
="$cmake_opts -DENABLE_PROFILING=$profiling"
390 [ $editline != default
] \
391 && cmake_opts
="$cmake_opts -DUSE_EDITLINE=$editline"
392 [ $abc != default
] \
393 && cmake_opts
="$cmake_opts -DUSE_ABC=$abc"
394 [ $cadical != default
] \
395 && cmake_opts
="$cmake_opts -DUSE_CADICAL=$cadical"
396 [ $cln != default
] \
397 && cmake_opts
="$cmake_opts -DUSE_CLN=$cln"
398 [ $cryptominisat != default
] \
399 && cmake_opts
="$cmake_opts -DUSE_CRYPTOMINISAT=$cryptominisat"
400 [ $glpk != default
] \
401 && cmake_opts
="$cmake_opts -DUSE_GLPK=$glpk"
402 [ $kissat != default
] \
403 && cmake_opts
="$cmake_opts -DUSE_KISSAT=$kissat"
404 [ $poly != default
] \
405 && cmake_opts
="$cmake_opts -DUSE_POLY=$poly"
406 [ $symfpu != default
] \
407 && cmake_opts
="$cmake_opts -DUSE_SYMFPU=$symfpu"
408 [ "$abc_dir" != default
] \
409 && cmake_opts
="$cmake_opts -DABC_DIR=$abc_dir"
410 [ "$cadical_dir" != default
] \
411 && cmake_opts
="$cmake_opts -DCADICAL_DIR=$cadical_dir"
412 [ "$cryptominisat_dir" != default
] \
413 && cmake_opts
="$cmake_opts -DCRYPTOMINISAT_DIR=$cryptominisat_dir"
414 [ "$glpk_dir" != default
] \
415 && cmake_opts
="$cmake_opts -DGLPK_DIR=$glpk_dir"
416 [ "$gmp_dir" != default
] \
417 && cmake_opts
="$cmake_opts -DGMP_DIR=$gmp_dir"
418 [ "$kissat_dir" != default
] \
419 && cmake_opts
="$cmake_opts -DKISSAT=$kissat_dir"
420 [ "$poly_dir" != default
] \
421 && cmake_opts
="$cmake_opts -DPOLY_DIR=$poly_dir"
422 [ "$symfpu_dir" != default
] \
423 && cmake_opts
="$cmake_opts -DSYMFPU_DIR=$symfpu_dir"
424 [ "$lib_only" != default
] \
425 && cmake_opts
="$cmake_opts -DBUILD_LIB_ONLY=$lib_only"
426 [ "$install_prefix" != default
] \
427 && cmake_opts
="$cmake_opts -DCMAKE_INSTALL_PREFIX=$install_prefix"
428 [ -n "$program_prefix" ] \
429 && cmake_opts
="$cmake_opts -DPROGRAM_PREFIX=$program_prefix"
433 # The cmake toolchain can't be changed once it is configured in $build_dir.
434 # Thus, remove $build_dir and create an empty directory.
435 [ $win64 = ON
] && [ -e "$build_dir" ] && rm -r "$build_dir"
436 [ $arm64 = ON
] && [ -e "$build_dir" ] && rm -r "$build_dir"
437 mkdir
-p "$build_dir"
441 [ -e CMakeCache.txt
] && rm CMakeCache.txt
442 build_dir_escaped
=$
(echo "$build_dir" |
sed 's/\//\\\//g')
443 cmake
"$root_dir" $cmake_opts 2>&1 | \
444 sed "s/^Now just/Now change to '$build_dir_escaped' and/"