Inaccurate/inconsistent output from mpf_out_str

Leif Leonhardy not.really at online.de
Fri Oct 30 13:01:57 UTC 2015


Yihang Ho wrote:
> Hi Marco,
> 
> Statically linking the library as you showed works nicely. But why does the
> first version says version 6.0.0? (I sudo make install after compiling.)

In case you're on Linux, presumably due to ld.so caching.

If so, run 'ldconfig' after 'make install' such that the dynamic linker
will pick up the /new/ version of the library.

(You could also specify the absolute path to the new dynamic library
when linking to avoid using an old one, provided the version numbers
sufficiently differ; otherwise you have to make sure the loader picks up
the correct one when loading your program as well.)


-leif


> On Fri, Oct 30, 2015 at 4:06 AM Marco Bodrato <bodrato at mail.dm.unipi.it>
> wrote:
> 
>> Ciao,
>>
>> Il Gio, 29 Ottobre 2015 6:05 pm, Yihang Ho ha scritto:
>>> Not sure if I compiled the RC correctly, but I am still seeing the same
>>> results.
>>
>> If "make check" did not fail, it was correctly compiled. Are you using for
>> your test? I added a line at the beginning of your code:
>> printf("%s\n",gmp_version);
>>
>> I get:
>>
>> $ g++ sample.cpp -lgmp && ./a.out
>> 6.0.0
>> 0.2628983284e208987640249978734
>> 0.2628978818679220467407506489160042807743550216147e208987640249978734
>> ....
>>
>> $ g++ sample.cpp .libs/libgmp.a && ./a.out
>> 6.0.99
>> 0.2628978819e208987640249978734
>> 0.26289788186792204674075064891600428077435502009263e208987640249978734
>> ....
>>
>> (the second instance is statically linked with the compiled, but not
>> installed, library, and it prints 6.0.99 for the version)
>>
>> Regards,
>> m
>>
>> --
>> http://bodrato.it/papers/



More information about the gmp-bugs mailing list