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 --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
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 --cryptominisat use the CryptoMiniSat SAT solver
63 --kissat use the Kissat SAT solver
64 --poly use the LibPoly library [default=yes]
65 --cocoa use the CoCoA library
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 --glpk-dir=PATH path to top level of GLPK installation
71 --dep-path=PATH path to a dependency installation dir
74 --lib-only only build the library, but not the executable or
75 the parser (default: off)
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 #--------------------------------------------------------------------------#
109 auto_download
=default
113 cryptominisat
=default
114 debug_context_mm
=default
115 debug_symbols
=default
127 python_bindings
=default
128 java_bindings
=default
131 static_binary
=default
147 #--------------------------------------------------------------------------#
159 --no-asan) asan
=OFF
;;
162 --no-ubsan) ubsan
=OFF
;;
165 --no-tsan) tsan
=OFF
;;
167 --werror) werror
=ON
;;
169 --assertions) assertions
=ON
;;
170 --no-assertions) assertions
=OFF
;;
181 --prefix) die
"missing argument to $1 (try -h)" ;;
183 install_prefix
=${1##*=}
184 # Check if install_prefix is an absolute path and if not, make it
186 case $install_prefix in
187 /*) ;; # absolute path
188 *) install_prefix
=$
(pwd)/$install_prefix ;; # make absolute path
192 --program-prefix) die
"missing argument to $1 (try -h)" ;;
193 --program-prefix=*) program_prefix
=${1##*=} ;;
195 --name) die
"missing argument to $1 (try -h)" ;;
196 --name=*) build_dir
=${1##*=} ;;
201 --coverage) coverage
=ON
;;
202 --no-coverage) coverage
=OFF
;;
204 --cryptominisat) cryptominisat
=ON
;;
205 --no-cryptominisat) cryptominisat
=OFF
;;
207 --debug-symbols) debug_symbols
=ON
;;
208 --no-debug-symbols) debug_symbols
=OFF
;;
210 --debug-context-mm) debug_context_mm
=ON
;;
211 --no-debug-context-mm) debug_context_mm
=OFF
;;
213 --dumping) dumping
=ON
;;
214 --no-dumping) dumping
=OFF
;;
219 --kissat) kissat
=ON
;;
220 --no-kissat) kissat
=OFF
;;
229 --no-docs) docs
=OFF
;;
232 --no-glpk) glpk
=OFF
;;
235 --no-poly) poly
=OFF
;;
238 --no-cocoa) cocoa
=OFF
;;
240 --muzzle) muzzle
=ON
;;
241 --no-muzzle) muzzle
=OFF
;;
243 --static) shared
=OFF
; static_binary
=ON
;;
244 --no-static) shared
=ON
;;
246 --static-binary) static_binary
=ON
;;
247 --no-static-binary) static_binary
=OFF
;;
249 --auto-download) auto_download
=ON
;;
250 --no-auto-download) auto_download
=OFF
;;
252 --statistics) statistics
=ON
;;
253 --no-statistics) statistics
=OFF
;;
255 --tracing) tracing
=ON
;;
256 --no-tracing) tracing
=OFF
;;
258 --unit-testing) unit_testing
=ON
;;
259 --no-unit-testing) unit_testing
=OFF
;;
261 --python2) python2
=ON
;;
262 --no-python2) python2
=OFF
;;
264 --python-bindings) python_bindings
=ON
;;
265 --no-python-bindings) python_bindings
=OFF
;;
267 --java-bindings) java_bindings
=ON
;;
268 --no-java-bindings) java_bindings
=OFF
;;
274 --valgrind) valgrind
=ON
;;
275 --no-valgrind) valgrind
=OFF
;;
277 --profiling) profiling
=ON
;;
278 --no-profiling) profiling
=OFF
;;
280 --editline) editline
=ON
;;
281 --no-editline) editline
=OFF
;;
283 --abc-dir) die
"missing argument to $1 (try -h)" ;;
284 --abc-dir=*) abc_dir
=${1##*=} ;;
286 --glpk-dir) die
"missing argument to $1 (try -h)" ;;
287 --glpk-dir=*) glpk_dir
=${1##*=} ;;
289 --dep-path) die
"missing argument to $1 (try -h)" ;;
290 --dep-path=*) dep_path
="${dep_path};${1##*=}" ;;
292 --lib-only) lib_only
=ON
;;
294 -*) die
"invalid option '$1' (try -h)";;
297 production
) buildtype
=Production
;;
298 debug
) buildtype
=Debug
;;
299 testing
) buildtype
=Testing
;;
300 competition
) buildtype
=Competition
;;
301 competition-inc
) buildtype
=Competition
; comp_inc
=ON
;;
302 *) die
"invalid build type (try -h)";;
309 #--------------------------------------------------------------------------#
311 if [ $werror != default
]; then
312 export CFLAGS
=-Werror
313 export CXXFLAGS
=-Werror
318 [ $buildtype != default
] \
319 && cmake_opts
="$cmake_opts -DCMAKE_BUILD_TYPE=$buildtype"
321 [ $asan != default
] \
322 && cmake_opts
="$cmake_opts -DENABLE_ASAN=$asan"
323 [ $auto_download != default
] \
324 && cmake_opts
="$cmake_opts -DENABLE_AUTO_DOWNLOAD=$auto_download"
325 [ $ubsan != default
] \
326 && cmake_opts
="$cmake_opts -DENABLE_UBSAN=$ubsan"
327 [ $tsan != default
] \
328 && cmake_opts
="$cmake_opts -DENABLE_TSAN=$tsan"
329 [ $assertions != default
] \
330 && cmake_opts
="$cmake_opts -DENABLE_ASSERTIONS=$assertions"
331 [ $comp_inc != default
] \
332 && cmake_opts
="$cmake_opts -DENABLE_COMP_INC_TRACK=$comp_inc"
333 [ $coverage != default
] \
334 && cmake_opts
="$cmake_opts -DENABLE_COVERAGE=$coverage"
335 [ $debug_symbols != default
] \
336 && cmake_opts
="$cmake_opts -DENABLE_DEBUG_SYMBOLS=$debug_symbols"
337 [ $debug_context_mm != default
] \
338 && cmake_opts
="$cmake_opts -DENABLE_DEBUG_CONTEXT_MM=$debug_context_mm"
339 [ $dumping != default
] \
340 && cmake_opts
="$cmake_opts -DENABLE_DUMPING=$dumping"
341 [ $gpl != default
] \
342 && cmake_opts
="$cmake_opts -DENABLE_GPL=$gpl"
343 [ $win64 != default
] \
344 && cmake_opts
="$cmake_opts -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw64.cmake"
345 [ $arm64 != default
] \
346 && cmake_opts
="$cmake_opts -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-aarch64.cmake"
347 [ $ninja != default
] && cmake_opts
="$cmake_opts -G Ninja"
348 [ $muzzle != default
] \
349 && cmake_opts
="$cmake_opts -DENABLE_MUZZLE=$muzzle"
350 [ $shared != default
] \
351 && cmake_opts
="$cmake_opts -DENABLE_SHARED=$shared"
352 [ $static_binary != default
] \
353 && cmake_opts
="$cmake_opts -DENABLE_STATIC_BINARY=$static_binary"
354 [ $statistics != default
] \
355 && cmake_opts
="$cmake_opts -DENABLE_STATISTICS=$statistics"
356 [ $tracing != default
] \
357 && cmake_opts
="$cmake_opts -DENABLE_TRACING=$tracing"
358 [ $unit_testing != default
] \
359 && cmake_opts
="$cmake_opts -DENABLE_UNIT_TESTING=$unit_testing"
360 [ $python2 != default
] \
361 && cmake_opts
="$cmake_opts -DUSE_PYTHON2=$python2"
362 [ $docs != default
] \
363 && cmake_opts
="$cmake_opts -DBUILD_DOCS=$docs"
364 [ $python_bindings != default
] \
365 && cmake_opts
="$cmake_opts -DBUILD_BINDINGS_PYTHON=$python_bindings"
366 [ $java_bindings != default
] \
367 && cmake_opts
="$cmake_opts -DBUILD_BINDINGS_JAVA=$java_bindings"
368 [ $valgrind != default
] \
369 && cmake_opts
="$cmake_opts -DENABLE_VALGRIND=$valgrind"
370 [ $profiling != default
] \
371 && cmake_opts
="$cmake_opts -DENABLE_PROFILING=$profiling"
372 [ $editline != default
] \
373 && cmake_opts
="$cmake_opts -DUSE_EDITLINE=$editline"
374 [ $abc != default
] \
375 && cmake_opts
="$cmake_opts -DUSE_ABC=$abc"
376 [ $cln != default
] \
377 && cmake_opts
="$cmake_opts -DUSE_CLN=$cln"
378 [ $cryptominisat != default
] \
379 && cmake_opts
="$cmake_opts -DUSE_CRYPTOMINISAT=$cryptominisat"
380 [ $glpk != default
] \
381 && cmake_opts
="$cmake_opts -DUSE_GLPK=$glpk"
382 [ $kissat != default
] \
383 && cmake_opts
="$cmake_opts -DUSE_KISSAT=$kissat"
384 [ $poly != default
] \
385 && cmake_opts
="$cmake_opts -DUSE_POLY=$poly"
386 [ $cocoa != default
] \
387 && cmake_opts
="$cmake_opts -DUSE_COCOA=$cocoa"
388 [ "$abc_dir" != default
] \
389 && cmake_opts
="$cmake_opts -DABC_DIR=$abc_dir"
390 [ "$glpk_dir" != default
] \
391 && cmake_opts
="$cmake_opts -DGLPK_DIR=$glpk_dir"
392 [ "$dep_path" != default
] \
393 && cmake_opts
="$cmake_opts -DCMAKE_PREFIX_PATH=$dep_path"
394 [ "$lib_only" != default
] \
395 && cmake_opts
="$cmake_opts -DBUILD_LIB_ONLY=$lib_only"
396 [ "$install_prefix" != default
] \
397 && cmake_opts
="$cmake_opts -DCMAKE_INSTALL_PREFIX=$install_prefix"
398 [ -n "$program_prefix" ] \
399 && cmake_opts
="$cmake_opts -DPROGRAM_PREFIX=$program_prefix"
403 # The cmake toolchain can't be changed once it is configured in $build_dir.
404 # Thus, remove $build_dir and create an empty directory.
405 [ $win64 = ON
] && [ -e "$build_dir" ] && rm -r "$build_dir"
406 [ $arm64 = ON
] && [ -e "$build_dir" ] && rm -r "$build_dir"
407 mkdir
-p "$build_dir"
411 [ -e CMakeCache.txt
] && rm CMakeCache.txt
412 build_dir_escaped
=$
(echo "$build_dir" |
sed 's/\//\\\//g')
413 cmake
"$root_dir" $cmake_opts 2>&1 | \
414 sed "s/^Now just/Now change to '$build_dir_escaped' and/"