diff --git a/config/Jamfile.v2 b/config/Jamfile.v2 index 91f9cbb3..639b2e67 100644 --- a/config/Jamfile.v2 +++ b/config/Jamfile.v2 @@ -10,9 +10,31 @@ local gmp_path = [ modules.peek : GMP_PATH ] ; local mpfr_path = [ modules.peek : MPFR_PATH ] ; local tommath_path = [ modules.peek : TOMMATH_PATH ] ; -obj has_gmp : has_gmp.cpp : +project : requirements + $(gmp_path) + $(gmp_path)/mpfr + $(gmp_path)/gmpfrxx + $(mpfr_path) + $(tommath_path) + ../../.. + $(gmp_path) + $(mpfr_path) + $(mpfr_path)/build.vc10/lib/Win32/Debug + $(tommath_path) + # We set these to make it easier to set up and test GMP and MPFR under Win32: + msvc:static + msvc:static + msvc:all + gcc:-Wall + gcc:-Wextra + ; + +lib gmp ; +lib mpfr ; + +exe has_gmp : has_gmp.cpp gmp : $(gmp_path) $(gmp_path)/mpfr $(gmp_path)/gmpfrxx ; -obj has_mpfr : has_mpfr.cpp : +exe has_mpfr : has_mpfr.cpp mpfr gmp : $(mpfr_path) $(gmp_path)/mpfr $(gmp_path)/gmpfrxx $(gmp_path) ; obj has_tommath : has_tommath.cpp : $(tommath_path) ; diff --git a/config/has_gmp.cpp b/config/has_gmp.cpp index 0f1142f1..f3484001 100644 --- a/config/has_gmp.cpp +++ b/config/has_gmp.cpp @@ -15,6 +15,12 @@ #error "Incompatible GMP version" #endif +int main() +{ + mpz_t integ; + mpz_init (integ); + mpz_clear (integ); - + return 0; +} diff --git a/config/has_mpfr.cpp b/config/has_mpfr.cpp index 96afb972..2198cafc 100644 --- a/config/has_mpfr.cpp +++ b/config/has_mpfr.cpp @@ -17,4 +17,18 @@ #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() +{ + mpfr_buildopt_tls_p(); + return 0; +} diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 43529770..85917970 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -158,22 +158,106 @@ run test_arithmetic.cpp : # command line : # input files : # requirements - TEST_CPP_INT_1A - : test_arithmetic_cpp_int_1a ; + TEST_CPP_INT_4 + : test_arithmetic_cpp_int_4 ; run test_arithmetic.cpp : # command line : # input files : # requirements - TEST_CPP_INT_2A - : test_arithmetic_cpp_int_2a ; + TEST_CPP_INT_5 + : test_arithmetic_cpp_int_5 ; run test_arithmetic.cpp : # command line : # input files : # requirements - TEST_CPP_INT_3A - : test_arithmetic_cpp_int_3a ; + TEST_CPP_INT_6 + : test_arithmetic_cpp_int_6 ; + +run test_arithmetic.cpp + : # command line + : # input files + : # requirements + TEST_CPP_INT_7 + : test_arithmetic_cpp_int_7 ; + +run test_arithmetic.cpp + : # command line + : # input files + : # requirements + TEST_CPP_INT_8 + : test_arithmetic_cpp_int_8 ; + +run test_arithmetic.cpp + : # command line + : # input files + : # requirements + TEST_CPP_INT_9 + : test_arithmetic_cpp_int_9 ; + +run test_arithmetic.cpp + : # command line + : # input files + : # requirements + TEST_CPP_INT_10 + : test_arithmetic_cpp_int_10 ; + +run test_arithmetic.cpp + : # command line + : # input files + : # requirements + TEST_CPP_INT_11 + : test_arithmetic_cpp_int_11 ; + +run test_arithmetic.cpp + : # command line + : # input files + : # requirements + TEST_CPP_INT_12 + : test_arithmetic_cpp_int_12 ; + +run test_arithmetic.cpp + : # command line + : # input files + : # requirements + TEST_CPP_INT_13 + : test_arithmetic_cpp_int_13 ; + +run test_arithmetic.cpp + : # command line + : # input files + : # requirements + TEST_CPP_INT_14 + : test_arithmetic_cpp_int_14 ; + +run test_arithmetic.cpp + : # command line + : # input files + : # requirements + TEST_CPP_INT_15 + : test_arithmetic_cpp_int_15 ; + +run test_arithmetic.cpp + : # command line + : # input files + : # requirements + TEST_CPP_INT_16 + : test_arithmetic_cpp_int_16 ; + +run test_arithmetic.cpp + : # command line + : # input files + : # requirements + TEST_CPP_INT_17 + : test_arithmetic_cpp_int_17 ; + +run test_arithmetic.cpp + : # command line + : # input files + : # requirements + TEST_CPP_INT_18 + : test_arithmetic_cpp_int_18 ; run test_arithmetic.cpp : # command line diff --git a/test/test_arithmetic.cpp b/test/test_arithmetic.cpp index dd97caf4..74feb133 100644 --- a/test/test_arithmetic.cpp +++ b/test/test_arithmetic.cpp @@ -15,39 +15,6 @@ #include #include "test.hpp" -#if !defined(TEST_MPF_50) && !defined(TEST_MPF) && !defined(TEST_BACKEND) && !defined(TEST_MPZ) && \ - !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR) && !defined(TEST_MPFR_50) && !defined(TEST_MPQ) \ - && !defined(TEST_TOMMATH) && !defined(TEST_TOMMATH_BOOST_RATIONAL) && !defined(TEST_MPZ_BOOST_RATIONAL)\ - && !defined(TEST_CPP_INT_1) && !defined(TEST_CPP_INT_2) && !defined(TEST_CPP_INT_3) \ - && !defined(TEST_CPP_INT_1A) && !defined(TEST_CPP_INT_2A) && !defined(TEST_CPP_INT_3A) \ - && !defined(TEST_CPP_INT_BR) && !defined(TEST_ARITHMETIC_BACKEND) -# define TEST_MPF_50 -# define TEST_MPF -# define TEST_BACKEND -# define TEST_MPZ -# define TEST_MPFR -# define TEST_MPFR_50 -# define TEST_CPP_DEC_FLOAT -# define TEST_MPQ -# define TEST_TOMMATH -# define TEST_CPP_INT_1 -# define TEST_CPP_INT_2 -# define TEST_CPP_INT_3 -# define TEST_CPP_INT_1A -# define TEST_CPP_INT_2A -# define TEST_CPP_INT_3A -# define TEST_CPP_INT_BR -# define TEST_ARITHMETIC_BACKEND - -#ifdef _MSC_VER -#pragma message("CAUTION!!: No backend type specified so testing everything.... this will take some time!!") -#endif -#ifdef __GNUC__ -#pragma warning "CAUTION!!: No backend type specified so testing everything.... this will take some time!!" -#endif - -#endif - #if defined(TEST_ARITHMETIC_BACKEND) # include "../performance/arithmetic_backend.hpp" #endif @@ -68,7 +35,11 @@ #include #include #endif -#if defined(TEST_CPP_INT_1) || defined(TEST_CPP_INT_2) || defined(TEST_CPP_INT_3) || defined(TEST_CPP_INT_BR) || defined(TEST_CPP_INT_1A) || defined(TEST_CPP_INT_2A) || defined(TEST_CPP_INT_3A) +#if defined(TEST_CPP_INT_1) || defined(TEST_CPP_INT_2) || defined(TEST_CPP_INT_3) || defined(TEST_CPP_INT_4)\ + || defined(TEST_CPP_INT_5) || defined(TEST_CPP_INT_6) || defined(TEST_CPP_INT_7) || defined(TEST_CPP_INT_8)\ + || defined(TEST_CPP_INT_9) || defined(TEST_CPP_INT_10) || defined(TEST_CPP_INT_11) || defined(TEST_CPP_INT_12)\ + || defined(TEST_CPP_INT_13) || defined(TEST_CPP_INT_14) || defined(TEST_CPP_INT_15) || defined(TEST_CPP_INT_16)\ + || defined(TEST_CPP_INT_17) || defined(TEST_CPP_INT_18) || defined(TEST_CPP_INT_BR) #include #endif @@ -154,7 +125,11 @@ struct is_twos_complement_integer : public boost::mpl::true_ {}; template <> struct is_twos_complement_integer : public boost::mpl::false_ {}; #endif -#if defined(TEST_CPP_INT_1) || defined(TEST_CPP_INT_2) || defined(TEST_CPP_INT_3) || defined(TEST_CPP_INT_BR) || defined(TEST_CPP_INT_1A) || defined(TEST_CPP_INT_2A) || defined(TEST_CPP_INT_3A) +#if defined(TEST_CPP_INT_1) || defined(TEST_CPP_INT_2) || defined(TEST_CPP_INT_3) || defined(TEST_CPP_INT_4)\ + || defined(TEST_CPP_INT_5) || defined(TEST_CPP_INT_6) || defined(TEST_CPP_INT_7) || defined(TEST_CPP_INT_8)\ + || defined(TEST_CPP_INT_9) || defined(TEST_CPP_INT_10) || defined(TEST_CPP_INT_11) || defined(TEST_CPP_INT_12)\ + || defined(TEST_CPP_INT_13) || defined(TEST_CPP_INT_14) || defined(TEST_CPP_INT_15) || defined(TEST_CPP_INT_16)\ + || defined(TEST_CPP_INT_17) || defined(TEST_CPP_INT_18) || defined(TEST_CPP_INT_BR) template struct is_twos_complement_integer, ExpressionTemplates> > : public boost::mpl::false_ {}; #endif @@ -201,7 +176,11 @@ struct related_type > type; }; #endif -#if defined(TEST_CPP_INT_1) || defined(TEST_CPP_INT_2) || defined(TEST_CPP_INT_3) || defined(TEST_CPP_INT_BR) || defined(TEST_CPP_INT_1A) || defined(TEST_CPP_INT_2A) || defined(TEST_CPP_INT_3A) +#if defined(TEST_CPP_INT_1) || defined(TEST_CPP_INT_2) || defined(TEST_CPP_INT_3) || defined(TEST_CPP_INT_4)\ + || defined(TEST_CPP_INT_5) || defined(TEST_CPP_INT_6) || defined(TEST_CPP_INT_7) || defined(TEST_CPP_INT_8)\ + || defined(TEST_CPP_INT_9) || defined(TEST_CPP_INT_10) || defined(TEST_CPP_INT_11) || defined(TEST_CPP_INT_12)\ + || defined(TEST_CPP_INT_13) || defined(TEST_CPP_INT_14) || defined(TEST_CPP_INT_15) || defined(TEST_CPP_INT_16)\ + || defined(TEST_CPP_INT_17) || defined(TEST_CPP_INT_18) || defined(TEST_CPP_INT_BR) template <> struct related_type { @@ -1853,34 +1832,58 @@ int main() #endif #ifdef TEST_CPP_INT_1 test(); - test(); - test(); -#endif -#ifdef TEST_CPP_INT_1A - test(); - test(); - test(); #endif #ifdef TEST_CPP_INT_2 - test(); - test, boost::multiprecision::et_off> >(); - test > >(); -#endif -#ifdef TEST_CPP_INT_2A - test(); - test, boost::multiprecision::et_off> >(); - test > >(); + test(); #endif #ifdef TEST_CPP_INT_3 + test(); +#endif +#ifdef TEST_CPP_INT_4 + test(); +#endif +#ifdef TEST_CPP_INT_5 + test(); +#endif +#ifdef TEST_CPP_INT_6 + test(); +#endif +#ifdef TEST_CPP_INT_7 + test(); +#endif +#ifdef TEST_CPP_INT_8 + test, boost::multiprecision::et_off> >(); +#endif +#ifdef TEST_CPP_INT_9 +test > >(); +#endif +#ifdef TEST_CPP_INT_10 + test(); +#endif +#ifdef TEST_CPP_INT_11 + test, boost::multiprecision::et_off> >(); +#endif +#ifdef TEST_CPP_INT_12 + test > >(); +#endif +#ifdef TEST_CPP_INT_13 // Again with "trivial" backends: test > >(); +#endif +#ifdef TEST_CPP_INT_14 test > >(); +#endif +#ifdef TEST_CPP_INT_15 test > >(); #endif -#ifdef TEST_CPP_INT_3A +#ifdef TEST_CPP_INT_16 // Again with "trivial" checked backends: test > >(); +#endif +#ifdef TEST_CPP_INT_17 test > >(); +#endif +#ifdef TEST_CPP_INT_18 test > >(); #endif #ifdef TEST_CPP_INT_BR