brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 96cd73e Raw
30 lines · bash
1#!/usr/bin/env bash2 3set -e # stop at the first error4 5SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)6VERSION="1.89.0"7 8echo "This script deletes ${SCRIPT_DIR}/boost-math and re-downloads it from the standalone Boost.Math release version ${VERSION}."9echo "It then subsets it so it only contains the parts that are used in libc++."10echo11read -p "Press a key to continue, or Ctrl+C to cancel"12 13echo "****************************************"14echo "Downloading Boost.Math ${VERSION}"15echo "****************************************"16BOOST_URL="https://github.com/boostorg/math/archive/refs/tags/boost-${VERSION}.tar.gz"17function cleanup_tarball() {18    rm ${SCRIPT_DIR}/boost-math-${VERSION}.tar.gz19}20trap cleanup_tarball EXIT21wget "${BOOST_URL}" -O ${SCRIPT_DIR}/boost-math-${VERSION}.tar.gz22rm -rf ${SCRIPT_DIR}/boost-math23mkdir ${SCRIPT_DIR}/boost-math24tar -x --file ${SCRIPT_DIR}/boost-math-${VERSION}.tar.gz -C ${SCRIPT_DIR}/boost-math --strip-components=125 26echo "****************************************"27echo "Subsetting Boost.Math ${VERSION}"28echo "****************************************"29rm -rf ${SCRIPT_DIR}/boost-math/{.circleci,.drone,.github,build,config,doc,example,meta,reporting,src,test,tools}30