mirror of
https://github.com/intel/llvm.git
synced 2026-01-21 12:19:23 +08:00
This PR adds the code of Boost.Math as of version 1.89 into the third-party directory, as discussed in a recent RFC [1]. The goal is for this code to be used as a back-end for the C++17 Math Special Functions. As explained in third-paty/README.md, this code is cleared for usage inside libc++ for the Math Special functions, however the LLVM Foundation should be consulted before using this code anywhere else in the LLVM project, due to the fact that it is under the Boost Software License (as opposed to the usual LLVM license). See the RFC [1] for more details. [1]: https://discourse.llvm.org/t/rfc-libc-taking-a-dependency-on-boost-math-for-the-c-17-math-special-functions
30 lines
1.2 KiB
Bash
Executable File
30 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e # stop at the first error
|
|
|
|
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
|
|
VERSION="1.89.0"
|
|
|
|
echo "This script deletes ${SCRIPT_DIR}/boost-math and re-downloads it from the standalone Boost.Math release version ${VERSION}."
|
|
echo "It then subsets it so it only contains the parts that are used in libc++."
|
|
echo
|
|
read -p "Press a key to continue, or Ctrl+C to cancel"
|
|
|
|
echo "****************************************"
|
|
echo "Downloading Boost.Math ${VERSION}"
|
|
echo "****************************************"
|
|
BOOST_URL="https://github.com/boostorg/math/archive/refs/tags/boost-${VERSION}.tar.gz"
|
|
function cleanup_tarball() {
|
|
rm ${SCRIPT_DIR}/boost-math-${VERSION}.tar.gz
|
|
}
|
|
trap cleanup_tarball EXIT
|
|
wget "${BOOST_URL}" -O ${SCRIPT_DIR}/boost-math-${VERSION}.tar.gz
|
|
rm -rf ${SCRIPT_DIR}/boost-math
|
|
mkdir ${SCRIPT_DIR}/boost-math
|
|
tar -x --file ${SCRIPT_DIR}/boost-math-${VERSION}.tar.gz -C ${SCRIPT_DIR}/boost-math --strip-components=1
|
|
|
|
echo "****************************************"
|
|
echo "Subsetting Boost.Math ${VERSION}"
|
|
echo "****************************************"
|
|
rm -rf ${SCRIPT_DIR}/boost-math/{.circleci,.drone,.github,build,config,doc,example,meta,reporting,src,test,tools}
|