-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[third-party] Add a snapshot of Boost.Math 1.89 standalone #141508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@llvm/pr-subscribers-libcxx Author: Louis Dionne (ldionne) ChangesThis PR adds the code of Boost.Math as of version 1.88 into the third-party directory. This PR is a support in the licensing discussion that needs to happen due to the code being under the Boost Software License as opposed to the LLVM license, according to the LLVM Developer Policy: https://llvm.org/docs/DeveloperPolicy.html#copyright-license-and-patents The end goal of adding this code into the third-party directory is to use it as a basis for implementing the Math Special Functions, a feature that has been missing from libc++ for very long. This was previously discussed in https://reviews.llvm.org/D142806 where we got stuck on the need to get the license cleared, which I am now bringing up for discussion again after a long hiatus. Patch is 73.64 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/141508.diff 4414 Files Affected:
diff --git a/third-party/boost-math/.circleci/config.yml b/third-party/boost-math/.circleci/config.yml
new file mode 100644
index 0000000000000..d77b8b620d0d1
--- /dev/null
+++ b/third-party/boost-math/.circleci/config.yml
@@ -0,0 +1,62 @@
+version: 2
+
+jobs:
+ inspect:
+ environment:
+ - BOOST_LIBRARY=math
+ - CXX_STANDARD=gnu++11
+ docker:
+ - image: gcc:9
+ steps:
+ - checkout
+ - run:
+ name: Setting up Environment
+ command: |
+ echo 'export BOOST="$HOME/boost-local"' >> $BASH_ENV
+ if [ $CIRCLE_BRANCH = "master" ]; then
+ echo 'export BOOST_BRANCH="master"' >> $BASH_ENV;
+ else
+ echo 'export BOOST_BRANCH="develop"' >> $BASH_ENV;
+ fi
+ echo 'export BOOST_REMOVE="$BOOST/boost/libs/$BOOST_LIBRARY"' >> $BASH_ENV
+ HOME_SED_=$(echo $HOME | sed -e 's/\//\\\//g')
+ echo 'export HOME_SED=$HOME_SED_' >> $BASH_ENV
+ - run:
+ name: install pre dependencies
+ command: |
+ apt-get update -yqq
+ apt-get install git xsltproc docbook-xsl docbook-xml -y
+ - run:
+ name: Initializing git repo for boost
+ command: |
+ echo BOOST=$BOOST BOOST_REMOVE=$BOOST_REMOVE BOOST_LIBRARY=$BOOST_LIBRARY BOOST_BRANCH=$BOOST_BRANCH PWD=$PWD
+ mkdir $BOOST
+ cd $BOOST
+ git clone --single-branch --branch $BOOST_BRANCH https://github.com/boostorg/boost.git
+ cd boost
+ git submodule update --init --merge
+ rm -rf $BOOST_REMOVE
+ mv $HOME/project $BOOST_REMOVE
+ - run:
+ name: Bootstrapping boost-build
+ command: |
+ cd $BOOST/boost && ./bootstrap.sh && ./b2 headers
+ echo "using xsltproc ;" | tee $HOME/user-config.jam
+ echo "using boostbook : /usr/share/xml/docbook/stylesheet/docbook-xsl : /usr/share/sgml/docbook/dtd/xml/4.2 ;" | tee -a $HOME/user-config.jam
+ - run:
+ name: Building inspect
+ command: |
+ cd $BOOST/boost/tools/inspect/build && ../../../b2 -j2 address-model=64 architecture=x86 toolset=gcc cxxflags="-std=gnu++14" release dist-bin
+ - run:
+ name: Building docs
+ command: |
+ cd $BOOST_REMOVE/doc && rm -rf html/boost_math && ../../../b2 -j2 address-model=64 architecture=x86 toolset=gcc cxxflags="-std=gnu++14" release
+ - run:
+ name: Running Inspect
+ command: |
+ cd $BOOST_REMOVE && ../../dist/bin/inspect -text
+workflows:
+ version: 2
+ build_and_test:
+ jobs:
+ - inspect
diff --git a/third-party/boost-math/.codecov.yml b/third-party/boost-math/.codecov.yml
new file mode 100644
index 0000000000000..751f83ac9668d
--- /dev/null
+++ b/third-party/boost-math/.codecov.yml
@@ -0,0 +1,26 @@
+# Copyright 2019 - 2021 Alexander Grund
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
+#
+# Sample codecov configuration file. Edit as required
+
+codecov:
+ max_report_age: off
+ require_ci_to_pass: yes
+ notify:
+ # Increase this if you have multiple coverage collection jobs
+ after_n_builds: 1
+ wait_for_ci: yes
+
+# Change how pull request comments look
+comment:
+ layout: "reach,diff,flags,files,footer"
+
+# Ignore specific files or folders. Glob patterns are supported.
+# See https://docs.codecov.com/docs/ignoring-paths
+ignore:
+ - extra/**/*
+ - reporting/**/*
+ - example/**/*
+ - include_private/**/*
+ - tools/**/*
diff --git a/third-party/boost-math/.drone.star b/third-party/boost-math/.drone.star
new file mode 100644
index 0000000000000..2202c601779c8
--- /dev/null
+++ b/third-party/boost-math/.drone.star
@@ -0,0 +1,72 @@
+# Use, modification, and distribution are
+# subject to the Boost Software License, Version 1.0. (See accompanying
+# file LICENSE.txt)
+#
+# Copyright Rene Rivera 2020.
+# Copyright John Maddock 2021.
+
+# For Drone CI we use the Starlark scripting language to reduce duplication.
+# As the yaml syntax for Drone CI is rather limited.
+#
+#
+globalenv={}
+linuxglobalimage="cppalliance/droneubuntu1604:1"
+windowsglobalimage="cppalliance/dronevs2019"
+
+def main(ctx):
+
+ things_to_test = [ "special_fun", "distribution_tests", "mp", "misc", "interpolators", "quadrature", "autodiff", "long-running-tests", "float128_tests", "concepts" ]
+ gcc13_things_to_test = [ "special_fun", "distribution_tests", "mp", "misc", "interpolators", "quadrature", "autodiff", "long-running-tests", "float128_tests", "concepts", "new_floats" ]
+ sanitizer_test = [ "special_fun", "distribution_tests", "misc", "interpolators", "quadrature", "float128_tests" ]
+ gnu_5_stds = [ "gnu++14", "c++14" ]
+ gnu_6_stds = [ "gnu++14", "c++14", "gnu++17", "c++17" ]
+ clang_6_stds = [ "c++14", "c++17" ]
+ gnu_9_stds = [ "gnu++14", "c++14", "gnu++17", "c++17", "gnu++2a", "c++2a" ]
+ clang_10_stds = [ "c++14", "c++17", "c++2a" ]
+ gnu_non_native = [ "gnu++17" ]
+ gcc13_stds = [ "c++23" ]
+
+ result = []
+
+ for suite in sanitizer_test:
+ #
+ # Sanitizers:
+ #
+ result.append(linux_cxx("Ubuntu Clang-18 C++20 ASAN" + " " + suite, "clang++-18", packages="clang-18", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-18', 'CXXSTD': 'gnu++20', 'TEST_SUITE': suite, 'OPTIONS': '<cxxflags>-fsanitize=address <linkflags>-fsanitize=address <cxxflags>-DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv))
+ result.append(linux_cxx("Ubuntu Clang-18 C++20 USAN" + " " + suite, "clang++-18", packages="clang-18", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-18', 'CXXSTD': 'gnu++20', 'TEST_SUITE': suite, 'OPTIONS': '<cxxflags>-fsanitize=undefined <linkflags>-fsanitize=undefined <cxxflags>-DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv))
+ result.append(linux_cxx("Ubuntu Clang-18 C++20 TSAN" + " " + suite, "clang++-18", packages="clang-18", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-18', 'CXXSTD': 'gnu++20', 'TEST_SUITE': suite, 'OPTIONS': '<cxxflags>-fsanitize=thread <linkflags>-fsanitize=thread <cxxflags>-DBOOST_CI_SANITIZER_BUILD' }, globalenv=globalenv))
+ result.append(linux_cxx("Ubuntu Clang-18 C++20 ISAN" + " " + suite, "clang++-18", packages="clang-18", privileged=True, buildtype="boost", image="cppalliance/droneubuntu2404:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-18', 'CXXSTD': 'gnu++20', 'TEST_SUITE': suite, 'OPTIONS': '<cxxflags>-fsanitize=integer <linkflags>-fsanitize=integer' }, globalenv=globalenv))
+
+ for suite in things_to_test:
+ for cxx in gnu_5_stds:
+ result.append(linux_cxx("Ubuntu g++-5 " + cxx + " " + suite, "g++-5", packages="g++-5", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-5', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
+ for cxx in gnu_6_stds:
+ result.append(linux_cxx("Ubuntu g++-6 " + cxx + " " + suite, "g++-6", packages="g++-6", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
+ result.append(linux_cxx("Ubuntu g++-7 " + cxx + " " + suite, "g++-7", packages="g++-7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
+ result.append(linux_cxx("Ubuntu g++-8 " + cxx + " " + suite, "g++-8", packages="g++-8", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-8', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
+ result.append(linux_cxx("Ubuntu g++-9 " + cxx + " " + suite, "g++-9", packages="g++-9", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-9', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
+ for cxx in clang_6_stds:
+ result.append(linux_cxx("Ubuntu clang++-6 " + cxx + " " + suite, "clang++-6.0", packages="clang-6.0", llvm_os="xenial", llvm_ver="6.0", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-6.0', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
+ result.append(linux_cxx("Ubuntu clang++-7 " + cxx + " " + suite, "clang++-7", packages="clang-7", llvm_os="xenial", llvm_ver="7", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
+ result.append(linux_cxx("Ubuntu clang++-8 " + cxx + " " + suite, "clang++-8", packages="clang-8", llvm_os="xenial", llvm_ver="8", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-8', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
+ result.append(linux_cxx("Ubuntu clang++-9 " + cxx + " " + suite, "clang++-9", packages="clang-9", llvm_os="xenial", llvm_ver="9", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-9', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
+ for cxx in gnu_9_stds:
+ result.append(linux_cxx("Ubuntu g++-10 " + cxx + " " + suite, "g++-10", packages="g++-10", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-10', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
+ result.append(linux_cxx("Ubuntu g++-11 " + cxx + " " + suite, "g++-11", packages="g++-11", buildtype="boost", image="cppalliance/droneubuntu2004:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-11', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
+ for cxx in clang_10_stds:
+ result.append(linux_cxx("Ubuntu clang++-10 " + cxx + " " + suite, "clang++-10", packages="clang-10", llvm_os="xenial", llvm_ver="10", buildtype="boost", image="cppalliance/droneubuntu1804:1", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-10', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
+ for cxx in gnu_non_native:
+ result.append(linux_cxx("Ubuntu g++ s390s " + cxx + " " + suite, "g++", packages="g++", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="s390x", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
+ for cxx in gnu_non_native:
+ result.append(linux_cxx("Ubuntu g++ ARM64" + cxx + " " + suite, "g++", packages="g++", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="arm64", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
+ for cxx in gnu_non_native:
+ result.append(osx_cxx("M1 Clang " + cxx + " " + suite, "clang++", buildscript="drone", buildtype="boost", xcode_version="14.1", environment={'TOOLSET': 'clang', 'CXXSTD': cxx, 'TEST_SUITE': suite, 'DEFINE': 'BOOST_MATH_NO_REAL_CONCEPT_TESTS,BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS,BOOST_MATH_MULTI_ARCH_CI_RUN', }, globalenv=globalenv))
+ for suite in gcc13_things_to_test:
+ for cxx in gcc13_stds:
+ result.append(linux_cxx("Ubuntu g++-13 " + cxx + " " + suite, "g++-13", packages="g++-13", buildtype="boost", image="cppalliance/droneubuntu2404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-13', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
+ result.append(linux_cxx("Ubuntu g++-14 " + cxx + " " + suite, "g++-14", packages="g++-14", buildtype="boost", image="cppalliance/droneubuntu2404:1", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-14', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv))
+
+ return result
+
+# from https://github.com/boostorg/boost-ci
+load("@boost_ci//ci/drone/:functions.star", "linux_cxx","windows_cxx","osx_cxx","freebsd_cxx")
diff --git a/third-party/boost-math/.drone/after-success.sh b/third-party/boost-math/.drone/after-success.sh
new file mode 100755
index 0000000000000..7a693aac0b811
--- /dev/null
+++ b/third-party/boost-math/.drone/after-success.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+
diff --git a/third-party/boost-math/.drone/before-install.sh b/third-party/boost-math/.drone/before-install.sh
new file mode 100755
index 0000000000000..7a693aac0b811
--- /dev/null
+++ b/third-party/boost-math/.drone/before-install.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+
diff --git a/third-party/boost-math/.drone/before-script.sh b/third-party/boost-math/.drone/before-script.sh
new file mode 100755
index 0000000000000..7a693aac0b811
--- /dev/null
+++ b/third-party/boost-math/.drone/before-script.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+
diff --git a/third-party/boost-math/.drone/boost.sh b/third-party/boost-math/.drone/boost.sh
new file mode 100755
index 0000000000000..baa747311f719
--- /dev/null
+++ b/third-party/boost-math/.drone/boost.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+set -ex
+export TRAVIS_BUILD_DIR=$(pwd)
+export DRONE_BUILD_DIR=$(pwd)
+export TRAVIS_BRANCH=$DRONE_BRANCH
+export VCS_COMMIT_ID=$DRONE_COMMIT
+export GIT_COMMIT=$DRONE_COMMIT
+export PATH=~/.local/bin:/usr/local/bin:$PATH
+
+echo '==================================> BEFORE_INSTALL'
+
+. .drone/before-install.sh
+
+echo '==================================> INSTALL'
+
+cd ..
+if [ "$DRONE_BRANCH" == "master" ] || [[ "$DRONE_BRANCH" == */master ]]; then
+ export BOOST_BRANCH="master"
+else
+ export BOOST_BRANCH="develop"
+fi
+git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
+cd boost-root
+git submodule update --init tools/build
+git submodule update --init libs/config
+git submodule update --init libs/polygon
+git submodule update --init tools/boost_install
+git submodule update --init libs/headers
+git submodule update --init tools/boostdep
+cp -r $TRAVIS_BUILD_DIR/* libs/math
+python tools/boostdep/depinst/depinst.py math
+./bootstrap.sh
+./b2 headers
+
+echo '==================================> BEFORE_SCRIPT'
+
+. $DRONE_BUILD_DIR/.drone/before-script.sh
+
+echo '==================================> SCRIPT'
+
+echo "using $TOOLSET : : $COMPILER : <cxxflags>-std=$CXXSTD $OPTIONS ;" > ~/user-config.jam
+(cd libs/config/test && ../../../b2 print_config_info print_math_info toolset=$TOOLSET)
+(cd libs/math/test && ../../../b2 -j3 toolset=$TOOLSET $TEST_SUITE)
+
+echo '==================================> AFTER_SUCCESS'
+
+. $DRONE_BUILD_DIR/.drone/after-success.sh
diff --git a/third-party/boost-math/.drone/drone.sh b/third-party/boost-math/.drone/drone.sh
new file mode 100644
index 0000000000000..86dbf129f58df
--- /dev/null
+++ b/third-party/boost-math/.drone/drone.sh
@@ -0,0 +1,59 @@
+# Use, modification, and distribution are
+# subject to the Boost Software License, Version 1.0. (See accompanying
+# file LICENSE.txt)
+#
+# Copyright Rene Rivera 2020.
+# Copyright John Maddock 2021.
+
+#!/bin/bash
+
+set -ex
+export TRAVIS_BUILD_DIR=$(pwd)
+export DRONE_BUILD_DIR=$(pwd)
+export TRAVIS_BRANCH=$DRONE_BRANCH
+export VCS_COMMIT_ID=$DRONE_COMMIT
+export GIT_COMMIT=$DRONE_COMMIT
+export PATH=~/.local/bin:/usr/local/bin:$PATH
+
+echo '==================================> BEFORE_INSTALL'
+
+. .drone/before-install.sh
+
+echo '==================================> INSTALL'
+
+cd ..
+if [ "$DRONE_BRANCH" == "master" ] || [[ "$DRONE_BRANCH" == */master ]]; then
+ export BOOST_BRANCH="master"
+else
+ export BOOST_BRANCH="develop"
+fi
+git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
+cd boost-root
+git submodule update --init tools/build
+git submodule update --init libs/config
+git submodule update --init libs/polygon
+git submodule update --init tools/boost_install
+git submodule update --init libs/headers
+git submodule update --init tools/boostdep
+cp -r $TRAVIS_BUILD_DIR/* libs/math
+python tools/boostdep/depinst/depinst.py math
+./bootstrap.sh
+./b2 headers
+
+if [[ $(uname) == "Linux" ]]; then
+ echo 0 | sudo tee /proc/sys/kernel/randomize_va_space
+fi
+
+echo '==================================> BEFORE_SCRIPT'
+
+. $DRONE_BUILD_DIR/.drone/before-script.sh
+
+echo '==================================> SCRIPT'
+
+echo "using $TOOLSET : : $COMPILER : <cxxflags>-std=$CXXSTD $OPTIONS ;" > ~/user-config.jam
+(cd libs/config/test && ../../../b2 config_info_travis_install toolset=$TOOLSET && ./config_info_travis)
+(cd libs/math/test && ../../../b2 toolset=$TOOLSET $TEST_SUITE define=$DEFINE)
+
+echo '==================================> AFTER_SUCCESS'
+
+. $DRONE_BUILD_DIR/.drone/after-success.sh
diff --git a/third-party/boost-math/.gitattributes b/third-party/boost-math/.gitattributes
new file mode 100644
index 0000000000000..3e84d7c704432
--- /dev/null
+++ b/third-party/boost-math/.gitattributes
@@ -0,0 +1,96 @@
+* text=auto !eol svneol=native#text/plain
+*.gitattributes text svneol=native#text/plain
+
+# Scriptish formats
+*.bat text svneol=native#text/plain
+*.bsh text svneol=native#text/x-beanshell
+*.cgi text svneol=native#text/plain
+*.cmd text svneol=native#text/plain
+*.js text svneol=native#text/javascript
+*.php text svneol=native#text/x-php
+*.pl text svneol=native#text/x-perl
+*.pm text svneol=native#text/x-perl
+*.py text svneol=native#text/x-python
+*.sh eol=lf svneol=LF#text/x-sh
+configure eol=lf svneol=LF#text/x-sh
+
+# Image formats
+*.bmp binary svneol=unset#image/bmp
+*.gif binary svneol=unset#image/gif
+*.ico binary svneol=unset#image/ico
+*.jpeg binary svneol=unset#image/jpeg
+*.jpg binary svneol=unset#image/jpeg
+*.png binary svneol=unset#image/png
+*.tif binary svneol=unset#image/tiff
+*.tiff binary svneol=unset#image/tiff
+*.svg text svneol=native#image/svg%2Bxml
+
+# Data formats
+*.pdf binary svneol=unset#application/pdf
+*.avi binary svneol=unset#video/avi
+*.doc binary svneol=unset#application/msword
+*.dsp text svneol=crlf#text/plain
+*.dsw text svneol=crlf#text/plain
+*.eps binary svneol=unset#application/postscript
+*.gz binary svneol=unset#application/gzip
+*.mov binary svneol=unset#video/quicktime
+*.mp3 binary svneol=unset#audio/mpeg
+*.ppt binary svneol=unset#application/vnd.ms-powerpoint
+*.ps binary svneol=unset#application/postscript
+*.psd binary svneol=unset#application/photoshop
+*.rdf binary svneol=unset#text/rdf
+*.rss text svneol=unset#text/xml
+*.rtf binary svneol=unset#text/rtf
+*.sln text svneol=native#text/plain
+*.swf binary svneol=unset#application/x-shockwave-flash
+*.tgz binary svneol=unset#application/gzip
+*.vcproj text svneol=native#text/xml
+*.vcxproj text svneol=native#text/xml
+*.vsprops text svneol=native#text/xml
+*.wav binary svneol=unset#audio/wav
+*.xls binary svneol=unset#application/vnd.ms-excel
+*.zip binary svneol=unset#application/zip
+
+# Text formats
+.htaccess text svneol=native#text/plain
+*.bbk text svneol=native#text/xml
+*.cmake text svneol=native#text/plain
+*.css text svneol=native#text/css
+*.dtd text svneol=native#text/xml
+*.htm text svneol=native#text/html
+*.html text svneol=native#text/html
+*.ini text svneol=native#text/plain
+*.log text svneol=native#text/plain
+*.mak text svneol=native#text/plain
+*.qbk text svneol=native#text/plain
+*.rst text svneol=native#text/plain
+*.sql text svneol=native#text/x-sql
+*.txt text svneol=native#text/plain
+*.xhtml text svneol=native#text/xhtml%2Bxml
+*.xml text svneol=native#text/xml
+*.xsd text svneol=native#text/xml
+*.xsl text svneol=native#text/xml
+*.xslt text svneol=native#text/xml
+*.xul text svneol=native#text/xul
+*.yml text svneol=native#text/plain
+boost-no-inspect text svneol=native#text/plain
+CHANGES text svneol=native#text/plain
+COPYING text svneol=native#text/plain
+INSTALL text s...
[truncated]
|
More references on this topic/discussion in #99939 |
Is there any reason this couldn't be a git submodule? I don't think it makes a difference from a license perspective, but it would probably make a difference from the POV of the usage model. Apologies if this is what you meant by
|
I'm open to any approach. We've typically been making copies for third-party modules but IDK if this is a conscious choice or just the way it was done. This can definitely be discussed as part of the technical discussion subsequent to the license approval. |
I created a RFC here: https://discourse.llvm.org/t/rfc-libc-taking-a-dependency-on-boost-math-for-the-c-17-math-special-functions Please chime in! |
This PR adds the code of Boost.Math as of version 1.88 into the third-party directory. This PR is a support in the licensing discussion that needs to happen due to the code being under the Boost Software License as opposed to the LLVM license, according to the LLVM Developer Policy: https://llvm.org/docs/DeveloperPolicy.html#copyright-license-and-patents The end goal of adding this code into the third-party directory is to use it as a basis for implementing the Math Special Functions, a feature that has been missing from libc++ for very long. This was previously discussed in https://reviews.llvm.org/D142806 where we got stuck on the need to get the license cleared, which I am now bringing up for discussion again after a long hiatus.
d2e2ade
to
52ac4c6
Compare
@@ -0,0 +1,10 @@ | |||
# Third-party LLVM dependencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Endilll @AaronBallman What do you think about this README for third-party dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second paragraph leaves an impression that libc++ specifically got some kind of permission from Boost to use their library, while it seems that we've just looked at Boost license and came to conclusion that libc++ usage is fine.
Otherwise SGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reworded!
@tstellar Are we going to need an option to build against a system-provided Boost.Math instead of the vendored one? (Though that's not really for this PR but the libcxx integration.) |
I think we shouldn't. The way we've envisioned this is that Boost.Math becomes a part of libc++ itself just as if we had copy-pasted the sources. We might need to apply some changes to Boost.Math to integrate it, etc. It's also possible that libc++ would only work with a specific version of Boost.Math, so then you'd have to match the exact version on your system. All in all, I don't think it's impossible, but it seems to me that making it possible to build against a system-provided Boost goes against the philosophy of the integration we discussed in the RFC. If that's requested, I'd like to understand the rationale for that need. |
@ldionne Do you think you will ever update the bundled version of boost in third-party/ or is it always going to be based off of 1.89? |
It's likely that we'll want to update it from time to time, but that will depend on what the integration is like. If the integration requires a lot of manual work, we might end up keeping it the same for the foreseeable future. If not, then I guess we'd update it whenever we get the chance. |
We have a general policy to build against system packages instead of bundled sources (see https://docs.fedoraproject.org/en-US/packaging-guidelines/#bundling). Though given that Boost.Math is a header-only dependency, I think building against the bundled version is probably fine. And if modification to the library will be needed (e.g. to avoid symbol clashes in static archives) then there wouldn't be a choice anyway... |
Are we comfortable with merging this patch in its current state? I believe I addressed all comments and we have agreement on the integration method (i.e. not a submodule, subsetting the sources, etc). |
This PR adds the code of Boost.Math as of version 1.89 into the third-party directory. This PR is a support in the licensing discussion that needs to happen due to the code being under the Boost Software License as opposed to the LLVM license, according to the LLVM Developer Policy: https://llvm.org/docs/DeveloperPolicy.html#copyright-license-and-patents
The end goal of adding this code into the third-party directory is to use it as a basis for implementing the Math Special Functions, a feature that has been missing from libc++ for very long. This was previously discussed in https://reviews.llvm.org/D142806 where we got stuck on the need to get the license cleared, which I am now bringing up for discussion again after a long hiatus.
NOTE: This PR is in support of a licensing discussion with the LLVM Board to see if the proposed usage model and license is acceptable from a legal standpoint. The overall approach for implementing these functions will be the subject of a RFC to establish consensus on the technical approach if the usage model is cleared with the board.
UPDATE October 8th 2025: The RFC obtained consensus so we will be moving forward and merging this PR.