5 [ ! -d contrib
] && echo "$0 not called from base directory" && exit 1
8 INSTALL_DIR
="$DEPS_DIR/install"
9 INSTALL_LIB_DIR
="$INSTALL_DIR/lib"
10 INSTALL_INCLUDE_DIR
="$INSTALL_DIR/include"
11 INSTALL_BIN_DIR
="$INSTALL_DIR/bin"
15 if ! [ -e src
/parser
/smt
2/Smt2.g
]; then
16 echo "$(basename $0): I expect to be in the contrib/ of a cvc5 source tree," >&2
17 echo "but apparently:" >&2
21 echo "is not a cvc5 source tree ?!" >&2
26 if [ -x "$(command -v wget)" ]; then
28 elif [ -x "$(command -v curl)" ]; then
31 echo "Can't figure out how to download from web. Please install wget or curl." >&2
36 for cmd
in python python2 python3
; do
37 if [ -x "$(command -v $cmd)" ]; then
43 if [ -z "$PYTHON" ]; then
44 echo "Error: Couldn't find python, python2, or python3." >&2
52 echo "Setting up $directory ..."
57 tar xf archive
--strip 1 # Strip top-most directory
61 # Some of our dependencies do not provide a make install rule. Use the
62 # following helper functions to copy libraries/headers/binaries into the
63 # corresponding directories in deps/install.
67 echo "Copying $1 to $INSTALL_LIB_DIR"
68 [ ! -d "$INSTALL_LIB_DIR" ] && mkdir
-p "$INSTALL_LIB_DIR"
69 cp "$1" "$INSTALL_LIB_DIR"
72 function install_includes
76 echo "Copying $1 to $INSTALL_INCLUDE_DIR/$subdir"
77 [ ! -d "$INSTALL_INCLUDE_DIR" ] && mkdir
-p "$INSTALL_INCLUDE_DIR"
78 [ -n "$subdir" ] && [ ! -d "$INSTALL_INCLUDE_DIR/$subdir" ] && mkdir
-p "$INSTALL_INCLUDE_DIR/$subdir"
79 cp -r "$include" "$INSTALL_INCLUDE_DIR/$subdir"
84 echo "Copying $1 to $INSTALL_BIN_DIR"
85 [ ! -d "$INSTALL_BIN_DIR" ] && mkdir
-p "$INSTALL_BIN_DIR"
86 cp "$1" "$INSTALL_BIN_DIR"
89 function guess_lib_dir
92 # On some systems the library may be installed to lib64/
95 # This function guesses the install lib directory
98 lib_dir
="$(dirname "$
(find "$INSTALL_DIR" -name "${lib_name}")")"
102 function rename_installed_lib
105 # This function uses the calculated library directory and
106 # then relocates the first argument to the second.
110 lib_dir
="$(guess_lib_dir "$src")"
111 mv "$lib_dir/$src" "$lib_dir/$dest"