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 --python-bindings build Python bindings based on new C++ API
47 --java-bindings build Java bindings based on new C++ API
48 --all-bindings build bindings for all supported languages
49 --asan build with ASan instrumentation
50 --ubsan build with UBSan instrumentation
51 --tsan build with TSan instrumentation
52 --werror build with -Werror
53 --ipo build with interprocedural optimization
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 --cryptominisat use the CryptoMiniSat SAT solver
60 --kissat use the Kissat SAT solver
61 --poly use the LibPoly library [default=yes]
62 --cocoa use the CoCoA library
63 --editline support the editline library
65 Optional Path to Optional Packages:
66 --glpk-dir=PATH path to top level of GLPK installation
67 --dep-path=PATH path to a dependency installation dir
69 CMake Options (Advanced)
70 -DVAR=VALUE manually add CMake options
76 #--------------------------------------------------------------------------#
79 echo "*** configure.sh: $*" 1>&2
84 echo "[configure.sh] $*"
87 #--------------------------------------------------------------------------#
89 [ ! -e src
/theory
] && die
"$0 not called from CVC4 base directory"
91 #--------------------------------------------------------------------------#
94 install_prefix
=default
97 #--------------------------------------------------------------------------#
103 auto_download
=default
107 cryptominisat
=default
108 debug_context_mm
=default
109 debug_symbols
=default
119 python_bindings
=default
120 java_bindings
=default
123 static_binary
=default
137 #--------------------------------------------------------------------------#
148 --no-asan) asan
=OFF
;;
151 --no-ubsan) ubsan
=OFF
;;
154 --no-tsan) tsan
=OFF
;;
156 --werror) werror
=ON
;;
161 --assertions) assertions
=ON
;;
162 --no-assertions) assertions
=OFF
;;
173 --prefix) die
"missing argument to $1 (try -h)" ;;
175 install_prefix
=${1##*=}
176 # Check if install_prefix is an absolute path and if not, make it
178 case $install_prefix in
179 /*) ;; # absolute path
180 *) install_prefix
=$
(pwd)/$install_prefix ;; # make absolute path
184 --program-prefix) die
"missing argument to $1 (try -h)" ;;
185 --program-prefix=*) program_prefix
=${1##*=} ;;
187 --name) die
"missing argument to $1 (try -h)" ;;
188 --name=*) build_dir
=${1##*=} ;;
193 --coverage) coverage
=ON
;;
194 --no-coverage) coverage
=OFF
;;
196 --cryptominisat) cryptominisat
=ON
;;
197 --no-cryptominisat) cryptominisat
=OFF
;;
199 --debug-symbols) debug_symbols
=ON
;;
200 --no-debug-symbols) debug_symbols
=OFF
;;
202 --debug-context-mm) debug_context_mm
=ON
;;
203 --no-debug-context-mm) debug_context_mm
=OFF
;;
208 --kissat) kissat
=ON
;;
209 --no-kissat) kissat
=OFF
;;
218 --no-docs) docs
=OFF
;;
221 --no-glpk) glpk
=OFF
;;
224 --no-poly) poly
=OFF
;;
227 --no-cocoa) cocoa
=OFF
;;
229 --muzzle) muzzle
=ON
;;
230 --no-muzzle) muzzle
=OFF
;;
232 --static) build_shared
=OFF
;;
233 --no-static) build_shared
=ON
;;
235 --static-binary) static_binary
=ON
;;
236 --no-static-binary) static_binary
=OFF
;;
238 --auto-download) auto_download
=ON
;;
239 --no-auto-download) auto_download
=OFF
;;
241 --statistics) statistics
=ON
;;
242 --no-statistics) statistics
=OFF
;;
244 --tracing) tracing
=ON
;;
245 --no-tracing) tracing
=OFF
;;
247 --unit-testing) unit_testing
=ON
;;
248 --no-unit-testing) unit_testing
=OFF
;;
250 --python-bindings) python_bindings
=ON
;;
251 --no-python-bindings) python_bindings
=OFF
;;
253 --java-bindings) java_bindings
=ON
;;
254 --no-java-bindings) java_bindings
=OFF
;;
260 --valgrind) valgrind
=ON
;;
261 --no-valgrind) valgrind
=OFF
;;
263 --profiling) profiling
=ON
;;
264 --no-profiling) profiling
=OFF
;;
266 --editline) editline
=ON
;;
267 --no-editline) editline
=OFF
;;
269 --glpk-dir) die
"missing argument to $1 (try -h)" ;;
270 --glpk-dir=*) glpk_dir
=${1##*=} ;;
272 --dep-path) die
"missing argument to $1 (try -h)" ;;
273 --dep-path=*) dep_path
="${dep_path};${1##*=}" ;;
275 -D*) cmake_opts
="${cmake_opts} $1" ;;
277 -*) die
"invalid option '$1' (try -h)";;
280 production
) buildtype
=Production
;;
281 debug
) buildtype
=Debug
;;
282 testing
) buildtype
=Testing
;;
283 competition
) buildtype
=Competition
;;
284 competition-inc
) buildtype
=Competition
; comp_inc
=ON
;;
285 *) die
"invalid build type (try -h)";;
292 #--------------------------------------------------------------------------#
294 if [ $werror != default
]; then
295 export CFLAGS
=-Werror
296 export CXXFLAGS
=-Werror
299 [ $buildtype != default
] \
300 && cmake_opts
="$cmake_opts -DCMAKE_BUILD_TYPE=$buildtype"
302 [ $asan != default
] \
303 && cmake_opts
="$cmake_opts -DENABLE_ASAN=$asan"
304 [ $auto_download != default
] \
305 && cmake_opts
="$cmake_opts -DENABLE_AUTO_DOWNLOAD=$auto_download"
306 [ $ubsan != default
] \
307 && cmake_opts
="$cmake_opts -DENABLE_UBSAN=$ubsan"
308 [ $tsan != default
] \
309 && cmake_opts
="$cmake_opts -DENABLE_TSAN=$tsan"
310 [ $ipo != default
] \
311 && cmake_opts
="$cmake_opts -DENABLE_IPO=$ipo"
312 [ $assertions != default
] \
313 && cmake_opts
="$cmake_opts -DENABLE_ASSERTIONS=$assertions"
314 [ $comp_inc != default
] \
315 && cmake_opts
="$cmake_opts -DENABLE_COMP_INC_TRACK=$comp_inc"
316 [ $coverage != default
] \
317 && cmake_opts
="$cmake_opts -DENABLE_COVERAGE=$coverage"
318 [ $debug_symbols != default
] \
319 && cmake_opts
="$cmake_opts -DENABLE_DEBUG_SYMBOLS=$debug_symbols"
320 [ $debug_context_mm != default
] \
321 && cmake_opts
="$cmake_opts -DENABLE_DEBUG_CONTEXT_MM=$debug_context_mm"
322 [ $gpl != default
] \
323 && cmake_opts
="$cmake_opts -DENABLE_GPL=$gpl"
324 [ $win64 != default
] \
325 && cmake_opts
="$cmake_opts -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw64.cmake"
326 [ $arm64 != default
] \
327 && cmake_opts
="$cmake_opts -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-aarch64.cmake"
328 [ $ninja != default
] && cmake_opts
="$cmake_opts -G Ninja"
329 [ $muzzle != default
] \
330 && cmake_opts
="$cmake_opts -DENABLE_MUZZLE=$muzzle"
331 [ $build_shared != default
] \
332 && cmake_opts
="$cmake_opts -DBUILD_SHARED_LIBS=$build_shared"
333 [ $static_binary != default
] \
334 && cmake_opts
="$cmake_opts -DSTATIC_BINARY=$static_binary"
335 [ $statistics != default
] \
336 && cmake_opts
="$cmake_opts -DENABLE_STATISTICS=$statistics"
337 [ $tracing != default
] \
338 && cmake_opts
="$cmake_opts -DENABLE_TRACING=$tracing"
339 [ $unit_testing != default
] \
340 && cmake_opts
="$cmake_opts -DENABLE_UNIT_TESTING=$unit_testing"
341 [ $docs != default
] \
342 && cmake_opts
="$cmake_opts -DBUILD_DOCS=$docs"
343 [ $python_bindings != default
] \
344 && cmake_opts
="$cmake_opts -DBUILD_BINDINGS_PYTHON=$python_bindings"
345 [ $java_bindings != default
] \
346 && cmake_opts
="$cmake_opts -DBUILD_BINDINGS_JAVA=$java_bindings"
347 [ $valgrind != default
] \
348 && cmake_opts
="$cmake_opts -DENABLE_VALGRIND=$valgrind"
349 [ $profiling != default
] \
350 && cmake_opts
="$cmake_opts -DENABLE_PROFILING=$profiling"
351 [ $editline != default
] \
352 && cmake_opts
="$cmake_opts -DUSE_EDITLINE=$editline"
353 [ $cln != default
] \
354 && cmake_opts
="$cmake_opts -DUSE_CLN=$cln"
355 [ $cryptominisat != default
] \
356 && cmake_opts
="$cmake_opts -DUSE_CRYPTOMINISAT=$cryptominisat"
357 [ $glpk != default
] \
358 && cmake_opts
="$cmake_opts -DUSE_GLPK=$glpk"
359 [ $kissat != default
] \
360 && cmake_opts
="$cmake_opts -DUSE_KISSAT=$kissat"
361 [ $poly != default
] \
362 && cmake_opts
="$cmake_opts -DUSE_POLY=$poly"
363 [ $cocoa != default
] \
364 && cmake_opts
="$cmake_opts -DUSE_COCOA=$cocoa"
365 [ "$glpk_dir" != default
] \
366 && cmake_opts
="$cmake_opts -DGLPK_DIR=$glpk_dir"
367 [ "$dep_path" != default
] \
368 && cmake_opts
="$cmake_opts -DCMAKE_PREFIX_PATH=$dep_path"
369 [ "$install_prefix" != default
] \
370 && cmake_opts
="$cmake_opts -DCMAKE_INSTALL_PREFIX=$install_prefix"
371 [ -n "$program_prefix" ] \
372 && cmake_opts
="$cmake_opts -DPROGRAM_PREFIX=$program_prefix"
376 # The cmake toolchain can't be changed once it is configured in $build_dir.
377 # Thus, remove $build_dir and create an empty directory.
378 [ $win64 = ON
] && [ -e "$build_dir" ] && rm -r "$build_dir"
379 [ $arm64 = ON
] && [ -e "$build_dir" ] && rm -r "$build_dir"
380 mkdir
-p "$build_dir"
384 [ -e CMakeCache.txt
] && rm CMakeCache.txt
385 build_dir_escaped
=$
(echo "$build_dir" |
sed 's/\//\\\//g')
386 cmake
"$root_dir" $cmake_opts 2>&1 | \
387 sed "s/^Now just/Now change to '$build_dir_escaped' and/"