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 link against static system libraries
35 --auto-download automatically download dependencies if necessary
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 --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
54 --ipo build with interprocedural optimization
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 --cryptominisat use the CryptoMiniSat SAT solver
61 --kissat use the Kissat SAT solver
62 --poly use the LibPoly library [default=yes]
63 --cocoa use the CoCoA library
64 --editline support the editline library
66 Optional Path to Optional Packages:
67 --glpk-dir=PATH path to top level of GLPK installation
68 --dep-path=PATH path to a dependency installation dir
70 CMake Options (Advanced)
71 -DVAR=VALUE manually add CMake options
77 #--------------------------------------------------------------------------#
80 echo "*** configure.sh: $*" 1>&2
85 echo "[configure.sh] $*"
88 #--------------------------------------------------------------------------#
90 [ ! -e src
/theory
] && die
"$0 not called from CVC4 base directory"
92 #--------------------------------------------------------------------------#
95 install_prefix
=default
98 #--------------------------------------------------------------------------#
104 auto_download
=default
108 cryptominisat
=default
109 debug_context_mm
=default
110 debug_symbols
=default
121 python_bindings
=default
122 java_bindings
=default
125 static_binary
=default
139 #--------------------------------------------------------------------------#
150 --no-asan) asan
=OFF
;;
153 --no-ubsan) ubsan
=OFF
;;
156 --no-tsan) tsan
=OFF
;;
158 --werror) werror
=ON
;;
163 --assertions) assertions
=ON
;;
164 --no-assertions) assertions
=OFF
;;
175 --prefix) die
"missing argument to $1 (try -h)" ;;
177 install_prefix
=${1##*=}
178 # Check if install_prefix is an absolute path and if not, make it
180 case $install_prefix in
181 /*) ;; # absolute path
182 *) install_prefix
=$
(pwd)/$install_prefix ;; # make absolute path
186 --program-prefix) die
"missing argument to $1 (try -h)" ;;
187 --program-prefix=*) program_prefix
=${1##*=} ;;
189 --name) die
"missing argument to $1 (try -h)" ;;
190 --name=*) build_dir
=${1##*=} ;;
195 --coverage) coverage
=ON
;;
196 --no-coverage) coverage
=OFF
;;
198 --cryptominisat) cryptominisat
=ON
;;
199 --no-cryptominisat) cryptominisat
=OFF
;;
201 --debug-symbols) debug_symbols
=ON
;;
202 --no-debug-symbols) debug_symbols
=OFF
;;
204 --debug-context-mm) debug_context_mm
=ON
;;
205 --no-debug-context-mm) debug_context_mm
=OFF
;;
210 --kissat) kissat
=ON
;;
211 --no-kissat) kissat
=OFF
;;
220 --no-docs) docs
=OFF
;;
223 --no-glpk) glpk
=OFF
;;
226 --no-poly) poly
=OFF
;;
229 --no-cocoa) cocoa
=OFF
;;
231 --muzzle) muzzle
=ON
;;
232 --no-muzzle) muzzle
=OFF
;;
234 --static) build_shared
=OFF
;;
235 --no-static) build_shared
=ON
;;
237 --static-binary) static_binary
=ON
;;
238 --no-static-binary) static_binary
=OFF
;;
240 --auto-download) auto_download
=ON
;;
241 --no-auto-download) auto_download
=OFF
;;
243 --statistics) statistics
=ON
;;
244 --no-statistics) statistics
=OFF
;;
246 --tracing) tracing
=ON
;;
247 --no-tracing) tracing
=OFF
;;
249 --unit-testing) unit_testing
=ON
;;
250 --no-unit-testing) unit_testing
=OFF
;;
252 --python2) python2
=ON
;;
253 --no-python2) python2
=OFF
;;
255 --python-bindings) python_bindings
=ON
;;
256 --no-python-bindings) python_bindings
=OFF
;;
258 --java-bindings) java_bindings
=ON
;;
259 --no-java-bindings) java_bindings
=OFF
;;
265 --valgrind) valgrind
=ON
;;
266 --no-valgrind) valgrind
=OFF
;;
268 --profiling) profiling
=ON
;;
269 --no-profiling) profiling
=OFF
;;
271 --editline) editline
=ON
;;
272 --no-editline) editline
=OFF
;;
274 --glpk-dir) die
"missing argument to $1 (try -h)" ;;
275 --glpk-dir=*) glpk_dir
=${1##*=} ;;
277 --dep-path) die
"missing argument to $1 (try -h)" ;;
278 --dep-path=*) dep_path
="${dep_path};${1##*=}" ;;
280 -D*) cmake_opts
="${cmake_opts} $1" ;;
282 -*) die
"invalid option '$1' (try -h)";;
285 production
) buildtype
=Production
;;
286 debug
) buildtype
=Debug
;;
287 testing
) buildtype
=Testing
;;
288 competition
) buildtype
=Competition
;;
289 competition-inc
) buildtype
=Competition
; comp_inc
=ON
;;
290 *) die
"invalid build type (try -h)";;
297 #--------------------------------------------------------------------------#
299 if [ $werror != default
]; then
300 export CFLAGS
=-Werror
301 export CXXFLAGS
=-Werror
304 [ $buildtype != default
] \
305 && cmake_opts
="$cmake_opts -DCMAKE_BUILD_TYPE=$buildtype"
307 [ $asan != default
] \
308 && cmake_opts
="$cmake_opts -DENABLE_ASAN=$asan"
309 [ $auto_download != default
] \
310 && cmake_opts
="$cmake_opts -DENABLE_AUTO_DOWNLOAD=$auto_download"
311 [ $ubsan != default
] \
312 && cmake_opts
="$cmake_opts -DENABLE_UBSAN=$ubsan"
313 [ $tsan != default
] \
314 && cmake_opts
="$cmake_opts -DENABLE_TSAN=$tsan"
315 [ $ipo != default
] \
316 && cmake_opts
="$cmake_opts -DENABLE_IPO=$ipo"
317 [ $assertions != default
] \
318 && cmake_opts
="$cmake_opts -DENABLE_ASSERTIONS=$assertions"
319 [ $comp_inc != default
] \
320 && cmake_opts
="$cmake_opts -DENABLE_COMP_INC_TRACK=$comp_inc"
321 [ $coverage != default
] \
322 && cmake_opts
="$cmake_opts -DENABLE_COVERAGE=$coverage"
323 [ $debug_symbols != default
] \
324 && cmake_opts
="$cmake_opts -DENABLE_DEBUG_SYMBOLS=$debug_symbols"
325 [ $debug_context_mm != default
] \
326 && cmake_opts
="$cmake_opts -DENABLE_DEBUG_CONTEXT_MM=$debug_context_mm"
327 [ $gpl != default
] \
328 && cmake_opts
="$cmake_opts -DENABLE_GPL=$gpl"
329 [ $win64 != default
] \
330 && cmake_opts
="$cmake_opts -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw64.cmake"
331 [ $arm64 != default
] \
332 && cmake_opts
="$cmake_opts -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-aarch64.cmake"
333 [ $ninja != default
] && cmake_opts
="$cmake_opts -G Ninja"
334 [ $muzzle != default
] \
335 && cmake_opts
="$cmake_opts -DENABLE_MUZZLE=$muzzle"
336 [ $build_shared != default
] \
337 && cmake_opts
="$cmake_opts -DBUILD_SHARED_LIBS=$build_shared"
338 [ $static_binary != default
] \
339 && cmake_opts
="$cmake_opts -DSTATIC_BINARY=$static_binary"
340 [ $statistics != default
] \
341 && cmake_opts
="$cmake_opts -DENABLE_STATISTICS=$statistics"
342 [ $tracing != default
] \
343 && cmake_opts
="$cmake_opts -DENABLE_TRACING=$tracing"
344 [ $unit_testing != default
] \
345 && cmake_opts
="$cmake_opts -DENABLE_UNIT_TESTING=$unit_testing"
346 [ $python2 != default
] \
347 && cmake_opts
="$cmake_opts -DUSE_PYTHON2=$python2"
348 [ $docs != default
] \
349 && cmake_opts
="$cmake_opts -DBUILD_DOCS=$docs"
350 [ $python_bindings != default
] \
351 && cmake_opts
="$cmake_opts -DBUILD_BINDINGS_PYTHON=$python_bindings"
352 [ $java_bindings != default
] \
353 && cmake_opts
="$cmake_opts -DBUILD_BINDINGS_JAVA=$java_bindings"
354 [ $valgrind != default
] \
355 && cmake_opts
="$cmake_opts -DENABLE_VALGRIND=$valgrind"
356 [ $profiling != default
] \
357 && cmake_opts
="$cmake_opts -DENABLE_PROFILING=$profiling"
358 [ $editline != default
] \
359 && cmake_opts
="$cmake_opts -DUSE_EDITLINE=$editline"
360 [ $cln != default
] \
361 && cmake_opts
="$cmake_opts -DUSE_CLN=$cln"
362 [ $cryptominisat != default
] \
363 && cmake_opts
="$cmake_opts -DUSE_CRYPTOMINISAT=$cryptominisat"
364 [ $glpk != default
] \
365 && cmake_opts
="$cmake_opts -DUSE_GLPK=$glpk"
366 [ $kissat != default
] \
367 && cmake_opts
="$cmake_opts -DUSE_KISSAT=$kissat"
368 [ $poly != default
] \
369 && cmake_opts
="$cmake_opts -DUSE_POLY=$poly"
370 [ $cocoa != default
] \
371 && cmake_opts
="$cmake_opts -DUSE_COCOA=$cocoa"
372 [ "$glpk_dir" != default
] \
373 && cmake_opts
="$cmake_opts -DGLPK_DIR=$glpk_dir"
374 [ "$dep_path" != default
] \
375 && cmake_opts
="$cmake_opts -DCMAKE_PREFIX_PATH=$dep_path"
376 [ "$install_prefix" != default
] \
377 && cmake_opts
="$cmake_opts -DCMAKE_INSTALL_PREFIX=$install_prefix"
378 [ -n "$program_prefix" ] \
379 && cmake_opts
="$cmake_opts -DPROGRAM_PREFIX=$program_prefix"
383 # The cmake toolchain can't be changed once it is configured in $build_dir.
384 # Thus, remove $build_dir and create an empty directory.
385 [ $win64 = ON
] && [ -e "$build_dir" ] && rm -r "$build_dir"
386 [ $arm64 = ON
] && [ -e "$build_dir" ] && rm -r "$build_dir"
387 mkdir
-p "$build_dir"
391 [ -e CMakeCache.txt
] && rm CMakeCache.txt
392 build_dir_escaped
=$
(echo "$build_dir" |
sed 's/\//\\\//g')
393 cmake
"$root_dir" $cmake_opts 2>&1 | \
394 sed "s/^Now just/Now change to '$build_dir_escaped' and/"