On Tue, Feb 1, 2011 at 04:25, Novak Elliott <n.s.j.elliott@curtin.edu.au> wrote:
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.  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.

It looks like you're not linking your program with mpfr library

Surya