cgal icon indicating copy to clipboard operation
cgal copied to clipboard

Use boost mp by default

Open sloriot opened this issue 2 years ago • 2 comments

As we are early in the release cycle, we switch to boost mp NT by default.

sloriot avatar Jul 13 '22 07:07 sloriot

The testsuite looks good but only one platform has a recent enough version of boost. All windows are using boost 1.66 It does not make sense to make this PR as tested if no windows test it IMO.

sloriot avatar Jul 27 '22 15:07 sloriot

Note that despite @janetournois updates, only 2 platforms are testing this PR (Ubuntu-GCC_master_CXX20-Release and MSVC-2022-Preview-Release CGAL-5.6-Ic-70). Boost 1.80 is required.

sloriot avatar Sep 15 '22 15:09 sloriot

The doc in SDG_2 says: If the GMP package is installed with CGAL, the template parameter EK has the default value: EK = Simple_cartesian<Gmpq>, otherwise its default value is EK = Simple_cartesian<Quotient<MP_Float> >., and I imagine there are other similar places.

Should Exact_field_selector be documented?

MaelRL avatar Sep 23 '22 10:09 MaelRL

Successfully tested in CGAL-5.6-Ic-79 but we are missing a test on MacOS (monet being down)

sloriot avatar Sep 29 '22 16:09 sloriot

Successfully tested in CGAL-5.6-Ic-79 but we are missing a test on MacOS (monet being down)

Let's wait a bit for more testing, then.

lrineau avatar Oct 04 '22 11:10 lrineau

Successfully tested in CGAL-5.6-Ic-84 on 9 platforms (GNU/Linux, MS Windows and macOS)

sloriot avatar Oct 06 '22 16:10 sloriot

Is there a way to check if ones local setup is using Boost MP?

lrineau avatar Jan 27 '23 23:01 lrineau

How to Use Boost Multiprecision with CGAL-5.6 (current master)

This PR "Use boost mp by default" has been merged October 2022. It requires Boost 1.80 or later (Boost 1.80 was published late August 2022, and Boost 1.81 mid-December 2022).

I did some experiment...

Is there a way to check if ones local setup is using Boost MP?

I have installed 1.81 using Homebrew on Linux (because Fedora Linux is lagging with Boost 1.79 and, and so is vcpkg).

Display_type

I have compiled a program with:

template<typename T>
struct Display_type;

Display_type<CGAL::Epick::Exact_nt> display_type;

so that the compiler displays an error message indicating the type CGAL::Epick::Exact_nt.

Without any option

Without anything special, I get:

issue_129.cpp:28:37: error: implicit instantiation of undefined template 'Display_type<__gmp_expr<mpq_t, mpq_t>>'
Display_type<CGAL::Epick::Exact_nt> display_type;
                                    ^

With #undef CGAL_USE_GMPXX

If I add

#undef CGAL_USE_GMPXX

to the program I get:

issue_129.cpp:28:37: error: implicit instantiation of undefined template 'Display_type<boost::multiprecision::number<boost::multiprecision::backends::rational_adaptor<boost::multiprecision::backends::cpp_int_backend<0, 0, boost::multiprecision::signed_magnitude, boost::multiprecision::unchecked, std::allocator<unsigned long long>>>, boost::multiprecision::et_on>>'
Display_type<CGAL::Epick::Exact_nt> display_type;
                                    ^

Conclusion

Should not we add a new pull-request so that CGAL_USE_GMPXX is no longer defined by default (if gmpxx.h is detected)? That way, Boost MP will really be by default.

lrineau avatar Jan 31 '23 14:01 lrineau