|
3 | 3 | set -e # stop at the first error |
4 | 4 |
|
5 | 5 | SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) |
| 6 | +VERSION="1.89.0" |
6 | 7 |
|
7 | | -echo "This script deletes ${SCRIPT_DIR}/boost-math and re-downloads it from the standalone Boost.Math release." |
| 8 | +echo "This script deletes ${SCRIPT_DIR}/boost-math and re-downloads it from the standalone Boost.Math release version ${VERSION}." |
8 | 9 | echo "It then subsets it so it only contains the parts that are used in libc++." |
9 | 10 | echo |
10 | | -read -p "To continue, please enter the version you wish to download (e.g. 1.89.0), or Ctrl+C to cancel: " version |
11 | | - |
12 | | -# Boost versions are always 1.xx.yy so far, use this to validate. |
13 | | -# That will probably have to be updated at some point. |
14 | | -if [[ "${version}" != "1."* ]]; then |
15 | | - echo "Invalid version '${version}' provided, was expecting 1.XX.YY" |
16 | | - exit 1 |
17 | | -fi |
| 11 | +read -p "Press a key to continue, or Ctrl+C to cancel" |
18 | 12 |
|
19 | 13 | echo "****************************************" |
20 | | -echo "Downloading Boost.Math ${version}" |
| 14 | +echo "Downloading Boost.Math ${VERSION}" |
21 | 15 | echo "****************************************" |
22 | | -BOOST_URL="https://github.com/boostorg/math/archive/refs/tags/boost-${version}.tar.gz" |
| 16 | +BOOST_URL="https://github.com/boostorg/math/archive/refs/tags/boost-${VERSION}.tar.gz" |
23 | 17 | function cleanup_tarball() { |
24 | | - rm ${SCRIPT_DIR}/boost-math-${version}.tar.gz |
| 18 | + rm ${SCRIPT_DIR}/boost-math-${VERSION}.tar.gz |
25 | 19 | } |
26 | 20 | trap cleanup_tarball EXIT |
27 | | -wget "${BOOST_URL}" -O ${SCRIPT_DIR}/boost-math-${version}.tar.gz |
| 21 | +wget "${BOOST_URL}" -O ${SCRIPT_DIR}/boost-math-${VERSION}.tar.gz |
28 | 22 | rm -rf ${SCRIPT_DIR}/boost-math |
29 | 23 | mkdir ${SCRIPT_DIR}/boost-math |
30 | | -tar -x --file ${SCRIPT_DIR}/boost-math-${version}.tar.gz -C ${SCRIPT_DIR}/boost-math --strip-components=1 |
| 24 | +tar -x --file ${SCRIPT_DIR}/boost-math-${VERSION}.tar.gz -C ${SCRIPT_DIR}/boost-math --strip-components=1 |
31 | 25 |
|
32 | 26 | echo "****************************************" |
33 | | -echo "Subsetting Boost.Math ${version}" |
| 27 | +echo "Subsetting Boost.Math ${VERSION}" |
34 | 28 | echo "****************************************" |
35 | 29 | rm -rf ${SCRIPT_DIR}/boost-math/{.circleci,.drone,.github,build,config,doc,example,meta,reporting,test,tools} |
0 commit comments