Boost logo

Boost Users :

Subject: [Boost-users] MPFR in Boost 1.45.0
From: Novak Elliott (n.s.j.elliott_at_[hidden])
Date: 2011-01-31 17:55:52


Hi,

I searched the boost mailing list archives on MPFR and the last query was in
Feb 2010 so I think this may be worth a new thread.

I'm interested in using MPFR (C library for multiple-precision
floating-point computations with *correct rounding - *http://www.mpfr.org/)
with some of the boost math libraries (vectors, matrices). Support is
available to do this via the bindings in
boost/math/bindings/mpfr.hpp<http://www.boost.org/doc/libs/1_45_0/boost/math/bindings/mpfr.hpp>.
As per the documentation (
http://www.boost.org/doc/libs/1_45_0/libs/math/doc/sf_and_dist/html/math_toolkit/using_udt/use_mpfr.html
):

"In order to use these bindings you will need to have installed MPFR plus
it's dependency the GMP library and the C++ wrapper for MPFR known as
gmpfrxx (or mpfr_class)."

However, when compiling the example listed in the documentation:

#include <boost/math/bindings/mpfr.hpp>

#include <boost/math/special_functions/gamma.hpp>

int main()
{
   mpfr_class::set_dprec(500); // 500 bit precision

   //
   // Note that the argument to tgamma is an expression template,
   // that's just fine here:
   //

   mpfr_class v = boost::math::tgamma(sqrt(mpfr_class(2)));

   std::cout << std::setprecision(50) << v << std::endl;

}

I get a large number of compile errors (attached).

I do have GMP, MPFR and gmpfrxx installed, although to get the gmpfrxx
example to work (source: example.cpp) I had to comment out the reference to
GMP_RND_MAX as this enumerated type value, present in MPFR version 2.4.2,
has been removed from mpfr.h from version 3.0.0.

Does anyone have any experience is getting boost 1.45.0 running with MPFR
3.0.0? I'm wondering whether this an MPFR problem, a boost bindings
problem, or both.

cheers,
Novak.





Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net