Christian Schneider | 8 Sep 01:33 2011
Picon

Yet another C++ wrapper for MPFR library

*** Please CC me, as I am not subscribed to the list! ***

Dear MPFR developers and users,

although there are already some C++ wrappers for the MPFR library, I 
decided to write another one. Its design is quite different from other 
wrappers:

It consists of a template class with precision and rounding mode passed 
as template arguments. Hence, effectively a new type will be created for 
each precision and rounding that is used. All the operators available 
for fundamental floating point types as well as type conversions from 
and to other types, and the set of mathematical functions known from 
math.h/cmath are implemented. This should allow for an easy substitution 
of, e.g., a double with the wrapper class in most cases.

Furthermore, the class allows to configure the conversions and 
support/handling for other types (such as fundamental types like 
"double"s or "int"s, character strings, or GMP types) with the help of 
type traits and some template metaprogramming. Last but not least, the 
compiler (= g++ with "-O2" in different test cases) seems to be able to 
optimize away the class overhead such that the generated code is 
effectively the same as it would be for direct use of the "low-level" 
MPFR functions.

Some lines about the wrapper and, of course, the source code itself can 
be found here:
http://chschneider.eu/programming/mpfr_real/

I am really interested in comments. The documentation will (hopefully) 
(Continue reading)

Vincent Lefevre | 9 Sep 09:02 2011
Picon

Re: Yet another C++ wrapper for MPFR library

On 2011-09-08 01:33:50 +0200, Christian Schneider wrote:
> *** Please CC me, as I am not subscribed to the list! ***
[...]
> I am really interested in comments. The documentation will (hopefully) 
> be extended soon. Maybe you find the wrapper useful and could add a link 
> to it on your website?

Thanks. I've added a link on the MPFR web site (main page).

--

-- 
Vincent Lefèvre <vincent@...> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)

Vincent Lefevre | 11 Sep 00:49 2011
Picon

MPFR link failure on Linux/ia64 with GMP 4.3.2

I get the following error with the MPFR trunk on gcc60.fsffrance.org
(Linux/ia64), using the GMP version (4.3.2) installed on this machine,
when running the tests:

../src/.libs/libmpfr.so: undefined reference to `udiv_qrnnd_preinv'

I suppose that this is due to

/* invert_limb macro, copied from GMP 5.0.2, file gmp-impl.h.
   It returns invxl = floor((B^2-1)/xl)-B, where B=2^BITS_PER_LIMB,
   assuming the most significant bit of xl is set. */
#undef invert_limb
#define invert_limb(invxl,xl)                             \
  do {                                                    \
    mp_limb_t dummy;                                      \
    MPFR_ASSERTD ((xl) != 0);                             \
    udiv_qrnnd (invxl, dummy, ~(xl), ~(mp_limb_t)0, xl);  \
  } while (0)

from "src/mpfr-gmp.h".

Could someone look at this problem?

--

-- 
Vincent Lefèvre <vincent@...> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)

Vincent Lefevre | 18 Sep 01:45 2011
Picon

GNU MPFR 3.1.0 Release Candidate

The release of GNU MPFR 3.1.0 ("canard à l'orange") is imminent.
Please help to make this major release as good as possible by
downloading and testing this release candidate:

http://www.mpfr.org/mpfr-3.1.0/mpfr-3.1.0-rc1.tar.xz
http://www.mpfr.org/mpfr-3.1.0/mpfr-3.1.0-rc1.tar.bz2
http://www.mpfr.org/mpfr-3.1.0/mpfr-3.1.0-rc1.tar.gz
http://www.mpfr.org/mpfr-3.1.0/mpfr-3.1.0-rc1.zip

The MD5's:
b8db8526722c6b51066fc318c5acf420  mpfr-3.1.0-rc1.tar.bz2
0b2a3492e968f720739e657c35b56e58  mpfr-3.1.0-rc1.tar.gz
264ffcfa3c8f07e5f847db02d33b9320  mpfr-3.1.0-rc1.tar.xz
eac7b43bb6a795883e0f75e28ea58ceb  mpfr-3.1.0-rc1.zip

The SHA1's:
70a3ee399d3d866740acdc1981658eb6a103ea05  mpfr-3.1.0-rc1.tar.bz2
9e708d77858b66d72e9f34087903064fff42e9b5  mpfr-3.1.0-rc1.tar.gz
542fb7e84256880fa826be45e45994731766ba43  mpfr-3.1.0-rc1.tar.xz
b1629aa2c2ceb9ab18273ce0596df894215c340d  mpfr-3.1.0-rc1.zip

The signatures:
http://www.mpfr.org/mpfr-3.1.0/mpfr-3.1.0-rc1.tar.xz.asc
http://www.mpfr.org/mpfr-3.1.0/mpfr-3.1.0-rc1.tar.bz2.asc
http://www.mpfr.org/mpfr-3.1.0/mpfr-3.1.0-rc1.tar.gz.asc
http://www.mpfr.org/mpfr-3.1.0/mpfr-3.1.0-rc1.zip.asc

Changes from versions 3.0.* to version 3.1.0:
- The MPFR source has been reorganized.
- Dropped ansi2knr support.
(Continue reading)

Fumihiro Chiba | 18 Sep 02:11 2011
Picon

result of making "GNU MPFR 3.1.0 Release Candidate"

hello.

i did make GNU MPFR 3.1.0 Release Candidate with mpir-2.4.0 and Xcode 4.1 on Mac OS X 10.7.
it failed.

the tail of terminal message is: 

ld: illegal text reloc to ___gmp_binvert_limb_table from /usr/local/lib/libgmp.a(mp_minv_tab.o) in
___gmpn_divexact_1 for architecture x86_64
collect2: ld returned 1 exit status
make[2]: *** [libmpfr.la] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
MacBook2009:mpfr-3.1.0-rc1 chibaf$ ./config.guess
x86_64-apple-darwin11.1.0

chibaf

Vincent Lefevre | 18 Sep 02:56 2011
Picon

Re: result of making "GNU MPFR 3.1.0 Release Candidate"

Hi,

On 2011-09-18 09:11:29 +0900, Fumihiro Chiba wrote:
> i did make GNU MPFR 3.1.0 Release Candidate with mpir-2.4.0 and Xcode 4.1 on Mac OS X 10.7.
> it failed.
> 
> the tail of terminal message is: 
> 
> ld: illegal text reloc to ___gmp_binvert_limb_table from /usr/local/lib/libgmp.a(mp_minv_tab.o)
in ___gmpn_divexact_1 for architecture x86_64
> collect2: ld returned 1 exit status
> make[2]: *** [libmpfr.la] Error 1
> make[1]: *** [all] Error 2
> make: *** [all-recursive] Error 1
> MacBook2009:mpfr-3.1.0-rc1 chibaf$ ./config.guess
> x86_64-apple-darwin11.1.0

Thanks for the report. The MPFR source doesn't contain any reference
to *binvert_limb_table or *divexact_1. So, isn't it a bug in MPIR?

--

-- 
Vincent Lefèvre <vincent@...> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)

Fumihiro Chiba | 18 Sep 05:27 2011
Picon

Re: result of making "GNU MPFR 3.1.0 Release Candidate"

Hi, Vincent

thanks for your  taking time to checking my previous result. 

On 2011/09/18, at 9:56, Vincent Lefevre wrote:

> Thanks for the report. The MPFR source doesn't contain any reference
> to *binvert_limb_table or *divexact_1. So, isn't it a bug in MPIR?

in the previous case, i used MPIR configured on old OS (Mac OS X 10.6).
i retried to configure it on new OS (Mac OS X 10.7).
reconfigured MPIR library caused no problem for mpfr-3.1.0rc.

i report details of check as follows.

1.
i retried to check of mpfr-3.1.0rc in two cases:
PART I: with reconfigured mpir 2.4.0
PART II: with gmp-4.3.2

2.
the results:

PART I:
no problem occurred.
PART II:
build is possible.
some problems occurred with Segmentation fault, when make check. 

3.
(Continue reading)

Vincent Lefevre | 18 Sep 09:52 2011
Picon

Re: result of making "GNU MPFR 3.1.0 Release Candidate"

On 2011-09-18 12:27:54 +0900, Fumihiro Chiba wrote:
> 1.
> i retried to check of mpfr-3.1.0rc in two cases:
> PART I: with reconfigured mpir 2.4.0
> PART II: with gmp-4.3.2
> 
> 2.
> the results:
> 
> PART I:
> no problem occurred.
> PART II:
> build is possible.
> some problems occurred with Segmentation fault, when make check. 
> 
> 3.
> details of checks:
> 
> PART I:
> the result of "make check":
> tversion] MPIR: header 2.4.0, library 2.4.0
> [tversion] MPFR tuning parameters from src/x86_64/core2/mparam.h
> PASS: tversion
> ====================
> All 160 tests passed
> (1 test was not run)
> ====================
> Making check in tune
> make[1]: Nothing to be done for `check'.
> make[1]: Nothing to be done for `check-am'.
(Continue reading)

Fumihiro Chiba | 18 Sep 10:52 2011
Picon

Re: result of making "GNU MPFR 3.1.0 Release Candidate"

Hi, Vincent 

RESULTS:
under my environment (Mac OS X 10.7)
*TLS is not enabled.
*same problems occurred with mpfr 3.0.1 for gmp 4.3.2 because of "Segmentation fault".
     ======================
     56 of 156 tests failed
     ======================
*no problem occurred with mpfr 3.0.1 for mpir 2.4.0.
      ====================
      All 156 tests passed
      ====================

DETAILS OF THESE RESULTS is described as follows:

On 2011/09/18, at 16:52, Vincent Lefevre wrote:

> With 58 failed tests, that's probably a compiler or environment
> problem. Does config.log contain any warning?

config.log containing:
MacBook2009:mpfr-3.1.0-rc1 chibaf$ cat config.log | grep warning
conftest.c:54: warning: conflicting types for built-in function 'memmove'
conftest.c:55: warning: conflicting types for built-in function 'memset'
conftest.c:42: warning: unused variable 'x'
conftest.c:43: warning: no previous prototype for 'f'
conftest.c:44: warning: no previous prototype for 'f'
conftest.c:45: warning: no previous prototype for 'f'
conftest.c:46: warning: no previous prototype for 'f'
(Continue reading)

Maciej (Matchek) Bliziński | 18 Sep 10:59 2011

Building and testing mpfr 3.1.0 while 3.0.1 is installed

I've come across a problem when building mpfr-3.1.0 while mpfr-3.0.1
is installed.

FAIL: tsub
Incorrect MPFR version! (3.1.0-rc1 header vs 3.0.1 library)
Nothing else has been tested since for this reason,
any other test may fail. Please fix this one first.

You can try to avoid this problem by changing the value of
shlibpath_overrides_runpath in the libtool file and rebuild
MPFR (make clean && make && make check).
Otherwise this error may be due to a corrupted mpfr.h, an
incomplete build (try to rebuild MPFR from scratch and/or
use 'make clean'), or something wrong in the system.

I tried changing shlibpath_overrides_runpath from "yes" to "no", but
it didn't help.

Looking at the RPATH:

maciej <at> unstable9s :~/src/opencsw/pkg/libmpfr/branches/rc >
/usr/ccs/bin/dump -Lv
work/solaris9-sparc/build-isa-sparcv8/mpfr-3.1.0-rc1/tests/tversion |
grep RPATH
[7]     RUNPATH
/opt/csw/lib/$ISALIST:/opt/csw/lib:/home/maciej/src/opencsw/pkg/libmpfr/branches/rc/work/solaris9-sparc/build-isa-sparcv8/mpfr-3.1.0-rc1/src/.libs:/opt/csw/lib

It seems to me that the tests contain RPATH set to the local
directory, but this approach fails in environments where RPATH is used
day-to-day to find shared libraries.
(Continue reading)


Gmane