diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/boost/libs/multiprecision/config | |
parent | Initial commit. (diff) | |
download | ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/multiprecision/config')
11 files changed, 379 insertions, 0 deletions
diff --git a/src/boost/libs/multiprecision/config/Jamfile.v2 b/src/boost/libs/multiprecision/config/Jamfile.v2 new file mode 100644 index 00000000..ac88473b --- /dev/null +++ b/src/boost/libs/multiprecision/config/Jamfile.v2 @@ -0,0 +1,87 @@ +# copyright John Maddock 2008 +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt. + +import modules ; +import path ; + +local gmp_path = [ modules.peek : GMP_PATH ] ; +local mpfr_path = [ modules.peek : MPFR_PATH ] ; +local mpfi_path = [ modules.peek : MPFI_PATH ] ; +local tommath_path = [ modules.peek : TOMMATH_PATH ] ; + +project : requirements + <include>$(gmp_path) + <include>$(gmp_path)/mpfr + <include>$(gmp_path)/gmpfrxx + <include>$(mpfr_path) + <include>$(mpfi_path) + <include>$(mpfi_path)/src + <include>$(tommath_path) + <include>../../.. + <search>$(gmp_path) + <search>$(mpfr_path) + <search>$(mpfr_path)/build.vc10/lib/Win32/Debug + <search>$(tommath_path) + <search>$(mpfi_path) + <search>$(mpfi_path)/src + # We set these to make it easier to set up and test GMP and MPFR under Win32: + <toolset>msvc:<runtime-link>static + <toolset>msvc:<link>static + <toolset>intel-win:<runtime-link>static + <toolset>intel-win:<link>static + <toolset>msvc:<warnings>all + <toolset>gcc:<cxxflags>-Wall + <toolset>gcc:<cxxflags>-Wextra + ; + +lib gmp ; +lib mpfr ; +lib mpfi ; +lib mpc ; +lib quadmath ; +lib tommath ; + +actions mp_simple_run_action +{ + $(>) > $(<) +} + +rule mp-run-simple ( sources + : args * : input-files * : requirements * : target-name ) +{ + exe $(target-name)_exe : $(sources) : $(requirements) ; + explicit $(target-name)_exe ; + make $(target-name).output : $(target-name)_exe : @mp_simple_run_action ; + explicit $(target-name).output ; + alias $(target-name) : $(target-name).output ; +} + +mp-run-simple has_gmp.cpp gmp : : : + <include>$(gmp_path) <include>$(gmp_path)/mpfr <include>$(gmp_path)/gmpfrxx : has_gmp ; +mp-run-simple has_mpfr.cpp mpfr gmp : : : + <include>$(mpfr_path) <include>$(gmp_path)/mpfr <include>$(gmp_path)/gmpfrxx <include>$(gmp_path) : has_mpfr ; +mp-run-simple has_mpfi.cpp mpfi mpfr gmp : : : + <include>$(mpfr_path) <include>$(gmp_path)/mpfr <include>$(gmp_path)/gmpfrxx <include>$(gmp_path) : has_mpfi ; +mp-run-simple has_mpc.cpp mpc mpfr gmp : : : + <include>$(mpfr_path) <include>$(gmp_path)/mpfr <include>$(gmp_path)/gmpfrxx <include>$(gmp_path) : has_mpc ; +mp-run-simple has_tommath.cpp tommath : : : + <include>$(tommath_path) : has_tommath ; +mp-run-simple has_float128.cpp quadmath : : : : has_float128 ; +exe has_intel_quad : has_intel_quad.cpp : <cxxflags>-Qoption,cpp,--extended_float_type ; +exe has_eigen : has_eigen.cpp ; +obj has_is_constant_evaluated : has_is_constant_evaluated.cpp ; +obj has_constexpr_limits : has_constexpr_limits_cmd.cpp : <cxxflags>-fconstexpr-ops-limit=268435456 ; + +explicit has_gmp ; +explicit has_mpfr ; +explicit has_mpfi ; +explicit has_tommath ; +explicit has_float128 ; +explicit has_intel_quad ; +explicit has_mpc ; +explicit has_eigen ; +explicit has_is_constant_evaluated ; +explicit has_constexpr_limits ; + + diff --git a/src/boost/libs/multiprecision/config/has_constexpr_limits_cmd.cpp b/src/boost/libs/multiprecision/config/has_constexpr_limits_cmd.cpp new file mode 100644 index 00000000..8c96958e --- /dev/null +++ b/src/boost/libs/multiprecision/config/has_constexpr_limits_cmd.cpp @@ -0,0 +1,16 @@ +// Copyright John Maddock 2019. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef __GNUC__ +#error "Compiler is not GCC" +#endif +#if __GNUC__ < 9 +#error "Older GCC versions don't support -fconstexpr-ops-limit" +#endif + +int main() +{ + return 0; +} diff --git a/src/boost/libs/multiprecision/config/has_eigen.cpp b/src/boost/libs/multiprecision/config/has_eigen.cpp new file mode 100644 index 00000000..57d84bae --- /dev/null +++ b/src/boost/libs/multiprecision/config/has_eigen.cpp @@ -0,0 +1,15 @@ +// Copyright John Maddock 2011. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include <Eigen/Dense> + +int main() +{ +#if EIGEN_VERSION_AT_LEAST(3, 3, 0) +#else +#error "Obsolete Eigen" +#endif + return 0; +} diff --git a/src/boost/libs/multiprecision/config/has_float128.cpp b/src/boost/libs/multiprecision/config/has_float128.cpp new file mode 100644 index 00000000..f46dbdcc --- /dev/null +++ b/src/boost/libs/multiprecision/config/has_float128.cpp @@ -0,0 +1,23 @@ +// Copyright John Maddock 2013. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include <boost/config.hpp> + +#ifndef BOOST_HAS_FLOAT128 +#error "This doesn't work unless Boost.Config enables __float128 support" +#endif + +extern "C" { +#include <quadmath.h> +} + +int main() +{ + __float128 f = -2.0Q; + f = fabsq(f); + f = expq(f); + + return 0; +} diff --git a/src/boost/libs/multiprecision/config/has_gmp.cpp b/src/boost/libs/multiprecision/config/has_gmp.cpp new file mode 100644 index 00000000..196b6e2f --- /dev/null +++ b/src/boost/libs/multiprecision/config/has_gmp.cpp @@ -0,0 +1,33 @@ +// Copyright John Maddock 2008. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include <cstddef> // See https://gcc.gnu.org/gcc-4.9/porting_to.html +#include <gmp.h> +#include <boost/config.hpp> + +#ifdef __GNUC__ +#pragma message "__GNU_MP_VERSION=" BOOST_STRINGIZE(__GNU_MP_VERSION) +#pragma message "__GNU_MP_VERSION_MINOR=" BOOST_STRINGIZE(__GNU_MP_VERSION_MINOR) +#endif + +#if (__GNU_MP_VERSION < 4) || ((__GNU_MP_VERSION == 4) && (__GNU_MP_VERSION_MINOR < 2)) +#error "Incompatible GMP version" +#endif + +int main() +{ + void* (*alloc_func_ptr)(size_t); + void* (*realloc_func_ptr)(void*, size_t, size_t); + void (*free_func_ptr)(void*, size_t); + + mp_get_memory_functions(&alloc_func_ptr, &realloc_func_ptr, &free_func_ptr); + + mpz_t integ; + mpz_init(integ); + if (integ[0]._mp_d) + mpz_clear(integ); + + return 0; +} diff --git a/src/boost/libs/multiprecision/config/has_intel_quad.cpp b/src/boost/libs/multiprecision/config/has_intel_quad.cpp new file mode 100644 index 00000000..e0b23eb0 --- /dev/null +++ b/src/boost/libs/multiprecision/config/has_intel_quad.cpp @@ -0,0 +1,14 @@ +// Copyright John Maddock 2013. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +extern "C" _Quad __fabs(_Quad); + +int main() +{ + _Quad f = -2.0Q; + f = __fabsq(f); + + return 0; +} diff --git a/src/boost/libs/multiprecision/config/has_is_constant_evaluated.cpp b/src/boost/libs/multiprecision/config/has_is_constant_evaluated.cpp new file mode 100644 index 00000000..808c396f --- /dev/null +++ b/src/boost/libs/multiprecision/config/has_is_constant_evaluated.cpp @@ -0,0 +1,10 @@ +// Copyright John Maddock 2013. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include <boost/multiprecision/number.hpp> + +#ifdef BOOST_MP_NO_CONSTEXPR_DETECTION +#error 1 +#endif diff --git a/src/boost/libs/multiprecision/config/has_mpc.cpp b/src/boost/libs/multiprecision/config/has_mpc.cpp new file mode 100644 index 00000000..256a70a9 --- /dev/null +++ b/src/boost/libs/multiprecision/config/has_mpc.cpp @@ -0,0 +1,59 @@ +// Copyright John Maddock 2018. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include <cstddef> // See https://gcc.gnu.org/gcc-4.9/porting_to.html +#include <mpc.h> +#include <boost/config.hpp> + +#ifdef __GNUC__ +#pragma message "MPFR_VERSION_STRING=" MPFR_VERSION_STRING +#endif + +#if (__GNU_MP_VERSION < 4) || ((__GNU_MP_VERSION == 4) && (__GNU_MP_VERSION_MINOR < 2)) +#error "Incompatible GMP version" +#endif + +#if (MPFR_VERSION < 3) +#error "Incompatible MPFR version" +#endif + +#ifdef __GNUC__ +#pragma message "__GNU_MP_VERSION=" BOOST_STRINGIZE(__GNU_MP_VERSION) +#pragma message "__GNU_MP_VERSION_MINOR=" BOOST_STRINGIZE(__GNU_MP_VERSION_MINOR) +#endif + +#if (__GNU_MP_VERSION < 4) || ((__GNU_MP_VERSION == 4) && (__GNU_MP_VERSION_MINOR < 2)) +#error "Incompatible GMP version" +#endif + +/* +#ifdef __GNUC__ +#pragma message "MPFI_VERSION_MAJOR=" BOOST_STRINGIZE(MPFI_VERSION_MAJOR) +#pragma message "MPFI_VERSION_MAJOR=" BOOST_STRINGIZE(MPFI_VERSION_MAJOR) +#endif + +#if MPFI_VERSION_MAJOR < 1 +#error "Incompatible MPFI version" +#endif +#if (MPFI_VERSION_MAJOR == 1) && (MPFI_VERSION_MINOR < 5) +#error "Incompatible MPFI version" +#endif +*/ +int main() +{ + void* (*alloc_func_ptr)(size_t); + void* (*realloc_func_ptr)(void*, size_t, size_t); + void (*free_func_ptr)(void*, size_t); + + mp_get_memory_functions(&alloc_func_ptr, &realloc_func_ptr, &free_func_ptr); + + mpfr_buildopt_tls_p(); + + mpc_t t; + mpc_init2(t, 128); + mpc_clear(t); + + return 0; +} diff --git a/src/boost/libs/multiprecision/config/has_mpfi.cpp b/src/boost/libs/multiprecision/config/has_mpfi.cpp new file mode 100644 index 00000000..bc2e9c68 --- /dev/null +++ b/src/boost/libs/multiprecision/config/has_mpfi.cpp @@ -0,0 +1,60 @@ +// Copyright John Maddock 2012. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include <cstddef> // See https://gcc.gnu.org/gcc-4.9/porting_to.html +#include <mpfi.h> +#include <boost/config.hpp> + +#ifdef __GNUC__ +#pragma message "MPFR_VERSION_STRING=" MPFR_VERSION_STRING +#endif + +#if (__GNU_MP_VERSION < 4) || ((__GNU_MP_VERSION == 4) && (__GNU_MP_VERSION_MINOR < 2)) +#error "Incompatible GMP version" +#endif + +#if (MPFR_VERSION < 3) +#error "Incompatible MPFR version" +#endif + +#ifdef __GNUC__ +#pragma message "__GNU_MP_VERSION=" BOOST_STRINGIZE(__GNU_MP_VERSION) +#pragma message "__GNU_MP_VERSION_MINOR=" BOOST_STRINGIZE(__GNU_MP_VERSION_MINOR) +#endif + +#if (__GNU_MP_VERSION < 4) || ((__GNU_MP_VERSION == 4) && (__GNU_MP_VERSION_MINOR < 2)) +#error "Incompatible GMP version" +#endif + +/* +#ifdef __GNUC__ +#pragma message "MPFI_VERSION_MAJOR=" BOOST_STRINGIZE(MPFI_VERSION_MAJOR) +#pragma message "MPFI_VERSION_MAJOR=" BOOST_STRINGIZE(MPFI_VERSION_MAJOR) +#endif + +#if MPFI_VERSION_MAJOR < 1 +#error "Incompatible MPFI version" +#endif +#if (MPFI_VERSION_MAJOR == 1) && (MPFI_VERSION_MINOR < 5) +#error "Incompatible MPFI version" +#endif +*/ +int main() +{ + void* (*alloc_func_ptr)(size_t); + void* (*realloc_func_ptr)(void*, size_t, size_t); + void (*free_func_ptr)(void*, size_t); + + mp_get_memory_functions(&alloc_func_ptr, &realloc_func_ptr, &free_func_ptr); + + mpfr_buildopt_tls_p(); + + mpfi_t t; + mpfi_init2(t, 128); + if (t[0].left._mpfr_d) + mpfi_clear(t); + + return 0; +} diff --git a/src/boost/libs/multiprecision/config/has_mpfr.cpp b/src/boost/libs/multiprecision/config/has_mpfr.cpp new file mode 100644 index 00000000..c82f28d7 --- /dev/null +++ b/src/boost/libs/multiprecision/config/has_mpfr.cpp @@ -0,0 +1,47 @@ +// Copyright John Maddock 2012. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include <cstddef> // See https://gcc.gnu.org/gcc-4.9/porting_to.html +#include <mpfr.h> +#include <boost/config.hpp> + +#ifdef __GNUC__ +#pragma message "MPFR_VERSION_STRING=" MPFR_VERSION_STRING +#endif + +#if (__GNU_MP_VERSION < 4) || ((__GNU_MP_VERSION == 4) && (__GNU_MP_VERSION_MINOR < 2)) +#error "Incompatible GMP version" +#endif + +#if (MPFR_VERSION < 3) +#error "Incompatible MPFR version" +#endif + +#ifdef __GNUC__ +#pragma message "__GNU_MP_VERSION=" BOOST_STRINGIZE(__GNU_MP_VERSION) +#pragma message "__GNU_MP_VERSION_MINOR=" BOOST_STRINGIZE(__GNU_MP_VERSION_MINOR) +#endif + +#if (__GNU_MP_VERSION < 4) || ((__GNU_MP_VERSION == 4) && (__GNU_MP_VERSION_MINOR < 2)) +#error "Incompatible GMP version" +#endif + +int main() +{ + void* (*alloc_func_ptr)(size_t); + void* (*realloc_func_ptr)(void*, size_t, size_t); + void (*free_func_ptr)(void*, size_t); + + mp_get_memory_functions(&alloc_func_ptr, &realloc_func_ptr, &free_func_ptr); + + mpfr_buildopt_tls_p(); + + mpfr_t t; + mpfr_init2(t, 128); + if (t[0]._mpfr_d) + mpfr_clear(t); + + return 0; +} diff --git a/src/boost/libs/multiprecision/config/has_tommath.cpp b/src/boost/libs/multiprecision/config/has_tommath.cpp new file mode 100644 index 00000000..e5d0a668 --- /dev/null +++ b/src/boost/libs/multiprecision/config/has_tommath.cpp @@ -0,0 +1,15 @@ +// Copyright John Maddock 2011. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include <tommath.h> + +int main() +{ + mp_int v; + mp_init(&v); + if (v.dp) + mp_clear(&v); + return 0; +} |