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 and options 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 --auto-download automatically download dependencies if necessary
37 --debug-symbols include debug symbols
38 --valgrind Valgrind instrumentation
39 --debug-context-mm use the debug context memory manager
40 --statistics include statistics
41 --assertions turn on assertions
42 --tracing include tracing code
43 --dumping include dumping code
44 --muzzle complete silence (no non-result output)
45 --coverage support for gcov coverage testing
46 --profiling support for gprof profiling
47 --unit-testing support for unit testing
48 --python2 force Python 2 (deprecated)
49 --python-bindings build Python bindings based on new C++ API
50 --java-bindings build Java bindings based on new C++ API
51 --all-bindings build bindings for all supported languages
52 --asan build with ASan instrumentation
53 --ubsan build with UBSan instrumentation
54 --tsan build with TSan instrumentation
55 --werror build with -Werror
56 --ipo build with interprocedural optimization
59 The following flags enable optional packages (disable with --no-<option name>).
60 --cln use CLN instead of GMP
61 --glpk use GLPK simplex solver
62 --abc use the ABC AIG library
63 --cryptominisat use the CryptoMiniSat SAT solver
64 --kissat use the Kissat SAT solver
65 --poly use the LibPoly library [default=yes]
66 --cocoa use the CoCoA library
67 --editline support the editline library
69 Optional Path to Optional Packages:
70 --abc-dir=PATH path to top level of ABC source tree
71 --glpk-dir=PATH path to top level of GLPK installation
72 --dep-path=PATH path to a dependency installation dir
75 --lib-only only build the library, but not the executable or
76 the parser (default: off)
78 CMake Options (Advanced)
79 -DVAR=VALUE manually add CMake options
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 #--------------------------------------------------------------------------#
113 auto_download
=default
117 cryptominisat
=default
118 debug_context_mm
=default
119 debug_symbols
=default
131 python_bindings
=default
132 java_bindings
=default
134 static_library
=default
135 static_binary
=default
150 #--------------------------------------------------------------------------#
164 --no-asan) asan
=OFF
;;
167 --no-ubsan) ubsan
=OFF
;;
170 --no-tsan) tsan
=OFF
;;
172 --werror) werror
=ON
;;
177 --assertions) assertions
=ON
;;
178 --no-assertions) assertions
=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##*=} ;;
210 --coverage) coverage
=ON
;;
211 --no-coverage) coverage
=OFF
;;
213 --cryptominisat) cryptominisat
=ON
;;
214 --no-cryptominisat) cryptominisat
=OFF
;;
216 --debug-symbols) debug_symbols
=ON
;;
217 --no-debug-symbols) debug_symbols
=OFF
;;
219 --debug-context-mm) debug_context_mm
=ON
;;
220 --no-debug-context-mm) debug_context_mm
=OFF
;;
222 --dumping) dumping
=ON
;;
223 --no-dumping) dumping
=OFF
;;
228 --kissat) kissat
=ON
;;
229 --no-kissat) kissat
=OFF
;;
238 --no-docs) docs
=OFF
;;
241 --no-glpk) glpk
=OFF
;;
244 --no-poly) poly
=OFF
;;
247 --no-cocoa) cocoa
=OFF
;;
249 --muzzle) muzzle
=ON
;;
250 --no-muzzle) muzzle
=OFF
;;
252 --static) static_library
=ON
; static_binary
=ON
;;
253 --no-static) static_library
=OFF
;;
255 --static-binary) static_binary
=ON
;;
256 --no-static-binary) static_binary
=OFF
;;
258 --auto-download) auto_download
=ON
;;
259 --no-auto-download) auto_download
=OFF
;;
261 --statistics) statistics
=ON
;;
262 --no-statistics) statistics
=OFF
;;
264 --tracing) tracing
=ON
;;
265 --no-tracing) tracing
=OFF
;;
267 --unit-testing) unit_testing
=ON
;;
268 --no-unit-testing) unit_testing
=OFF
;;
270 --python2) python2
=ON
;;
271 --no-python2) python2
=OFF
;;
273 --python-bindings) python_bindings
=ON
;;
274 --no-python-bindings) python_bindings
=OFF
;;
276 --java-bindings) java_bindings
=ON
;;
277 --no-java-bindings) java_bindings
=OFF
;;
283 --valgrind) valgrind
=ON
;;
284 --no-valgrind) valgrind
=OFF
;;
286 --profiling) profiling
=ON
;;
287 --no-profiling) profiling
=OFF
;;
289 --editline) editline
=ON
;;
290 --no-editline) editline
=OFF
;;
292 --abc-dir) die
"missing argument to $1 (try -h)" ;;
293 --abc-dir=*) abc_dir
=${1##*=} ;;
295 --glpk-dir) die
"missing argument to $1 (try -h)" ;;
296 --glpk-dir=*) glpk_dir
=${1##*=} ;;
298 --dep-path) die
"missing argument to $1 (try -h)" ;;
299 --dep-path=*) dep_path
="${dep_path};${1##*=}" ;;
301 -D*) cmake_opts
="${cmake_opts} $1" ;;
303 -*) die
"invalid option '$1' (try -h)";;
306 production
) buildtype
=Production
;;
307 debug
) buildtype
=Debug
;;
308 testing
) buildtype
=Testing
;;
309 competition
) buildtype
=Competition
;;
310 competition-inc
) buildtype
=Competition
; comp_inc
=ON
;;
311 *) die
"invalid build type (try -h)";;
318 #--------------------------------------------------------------------------#
320 if [ $werror != default
]; then
321 export CFLAGS
=-Werror
322 export CXXFLAGS
=-Werror
325 [ $buildtype != default
] \
326 && cmake_opts
="$cmake_opts -DCMAKE_BUILD_TYPE=$buildtype"
328 [ $asan != default
] \
329 && cmake_opts
="$cmake_opts -DENABLE_ASAN=$asan"
330 [ $auto_download != default
] \
331 && cmake_opts
="$cmake_opts -DENABLE_AUTO_DOWNLOAD=$auto_download"
332 [ $ubsan != default
] \
333 && cmake_opts
="$cmake_opts -DENABLE_UBSAN=$ubsan"
334 [ $tsan != default
] \
335 && cmake_opts
="$cmake_opts -DENABLE_TSAN=$tsan"
336 [ $ipo != default
] \
337 && cmake_opts
="$cmake_opts -DENABLE_IPO=$ipo"
338 [ $assertions != default
] \
339 && cmake_opts
="$cmake_opts -DENABLE_ASSERTIONS=$assertions"
340 [ $comp_inc != default
] \
341 && cmake_opts
="$cmake_opts -DENABLE_COMP_INC_TRACK=$comp_inc"
342 [ $coverage != default
] \
343 && cmake_opts
="$cmake_opts -DENABLE_COVERAGE=$coverage"
344 [ $debug_symbols != default
] \
345 && cmake_opts
="$cmake_opts -DENABLE_DEBUG_SYMBOLS=$debug_symbols"
346 [ $debug_context_mm != default
] \
347 && cmake_opts
="$cmake_opts -DENABLE_DEBUG_CONTEXT_MM=$debug_context_mm"
348 [ $dumping != default
] \
349 && cmake_opts
="$cmake_opts -DENABLE_DUMPING=$dumping"
350 [ $gpl != default
] \
351 && cmake_opts
="$cmake_opts -DENABLE_GPL=$gpl"
352 [ $win64 != default
] \
353 && cmake_opts
="$cmake_opts -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw64.cmake"
354 [ $arm64 != default
] \
355 && cmake_opts
="$cmake_opts -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-aarch64.cmake"
356 [ $ninja != default
] && cmake_opts
="$cmake_opts -G Ninja"
357 [ $muzzle != default
] \
358 && cmake_opts
="$cmake_opts -DENABLE_MUZZLE=$muzzle"
359 [ $static_library != default
] \
360 && cmake_opts
="$cmake_opts -DENABLE_STATIC_LIBRARY=$static_library"
361 [ $static_binary != default
] \
362 && cmake_opts
="$cmake_opts -DENABLE_STATIC_BINARY=$static_binary"
363 [ $statistics != default
] \
364 && cmake_opts
="$cmake_opts -DENABLE_STATISTICS=$statistics"
365 [ $tracing != default
] \
366 && cmake_opts
="$cmake_opts -DENABLE_TRACING=$tracing"
367 [ $unit_testing != default
] \
368 && cmake_opts
="$cmake_opts -DENABLE_UNIT_TESTING=$unit_testing"
369 [ $python2 != default
] \
370 && cmake_opts
="$cmake_opts -DUSE_PYTHON2=$python2"
371 [ $docs != default
] \
372 && cmake_opts
="$cmake_opts -DBUILD_DOCS=$docs"
373 [ $python_bindings != default
] \
374 && cmake_opts
="$cmake_opts -DBUILD_BINDINGS_PYTHON=$python_bindings"
375 [ $java_bindings != default
] \
376 && cmake_opts
="$cmake_opts -DBUILD_BINDINGS_JAVA=$java_bindings"
377 [ $valgrind != default
] \
378 && cmake_opts
="$cmake_opts -DENABLE_VALGRIND=$valgrind"
379 [ $profiling != default
] \
380 && cmake_opts
="$cmake_opts -DENABLE_PROFILING=$profiling"
381 [ $editline != default
] \
382 && cmake_opts
="$cmake_opts -DUSE_EDITLINE=$editline"
383 [ $abc != default
] \
384 && cmake_opts
="$cmake_opts -DUSE_ABC=$abc"
385 [ $cln != default
] \
386 && cmake_opts
="$cmake_opts -DUSE_CLN=$cln"
387 [ $cryptominisat != default
] \
388 && cmake_opts
="$cmake_opts -DUSE_CRYPTOMINISAT=$cryptominisat"
389 [ $glpk != default
] \
390 && cmake_opts
="$cmake_opts -DUSE_GLPK=$glpk"
391 [ $kissat != default
] \
392 && cmake_opts
="$cmake_opts -DUSE_KISSAT=$kissat"
393 [ $poly != default
] \
394 && cmake_opts
="$cmake_opts -DUSE_POLY=$poly"
395 [ $cocoa != default
] \
396 && cmake_opts
="$cmake_opts -DUSE_COCOA=$cocoa"
397 [ "$abc_dir" != default
] \
398 && cmake_opts
="$cmake_opts -DABC_DIR=$abc_dir"
399 [ "$glpk_dir" != default
] \
400 && cmake_opts
="$cmake_opts -DGLPK_DIR=$glpk_dir"
401 [ "$dep_path" != default
] \
402 && cmake_opts
="$cmake_opts -DCMAKE_PREFIX_PATH=$dep_path"
403 [ "$install_prefix" != default
] \
404 && cmake_opts
="$cmake_opts -DCMAKE_INSTALL_PREFIX=$install_prefix"
405 [ -n "$program_prefix" ] \
406 && cmake_opts
="$cmake_opts -DPROGRAM_PREFIX=$program_prefix"
410 # The cmake toolchain can't be changed once it is configured in $build_dir.
411 # Thus, remove $build_dir and create an empty directory.
412 [ $win64 = ON
] && [ -e "$build_dir" ] && rm -r "$build_dir"
413 [ $arm64 = ON
] && [ -e "$build_dir" ] && rm -r "$build_dir"
414 mkdir
-p "$build_dir"
418 [ -e CMakeCache.txt
] && rm CMakeCache.txt
419 build_dir_escaped
=$
(echo "$build_dir" |
sed 's/\//\\\//g')
420 cmake
"$root_dir" $cmake_opts 2>&1 | \
421 sed "s/^Now just/Now change to '$build_dir_escaped' and/"