div.c and other questions

Mike Loehr michael635 at adelphia.net
Mon Sep 27 20:05:56 CEST 2004


Patrick;

Here's the modified div.c, no big deal really, just a search and replace of
'near' with 'mpfr_near'.

I'm sure that we could find a flag, or a compiler setting to get around
this, but changing the variable name seems to be the simplest solution (I
firmly believe in the KISS principle (Keep It Simple, Silly).  Changing the
internal variable name should eliminate follow on posts about the same
problem and doesn't hurt the code's integrity.

Yes I am using MSVC 6 with SP-5.  I don't use any pragma's (as a rule)
because many messages have multiple causes, and the law of unintended
consequences guarantees that if I switch one message off, I will produce a
bug.  The most common warning message compiling the open source projects is
signed/unsigned mismatches.  The code always seems to work and test fine,
but 100 warnings during compiling is tiresome but necessary.

As to whether MPFR is ready to become a DLL, it's actually pretty straight
forward to do.  The techniques have been used on other open source projects
(glib for example) with good results.  Brian Gladman's site has the DLL
versions for GMP and MPFR set-up (not including the MPFR_IMPL.H functions).

My other win32 projects have all used DLL's and the project that I need the
MPFR for is already linking to 5 DLL's, so I think I'll keep to the DLL
path.  I recognize the speed issue, but I'm not compiling with any of the
assembler optimizations since my base code is Pentium compatible (legacy
systems are always a problem and it seems as if I'm always 1 or 2 processor
generations behind, as I suspect some other people are).

I'll take your recommendation on modifying the MPFR_IMPL.H to produce the
DLL and work with Brian for a single solution.  I feel it is very important
to be able to run a test suite on any project, and want to get the MPFR
tests running under MSVC.  I have a rough version of the tests running, but
the edits were quite draconian.  I'm polishing up the changes and trying to
eliminate as many edits as possible.

Mike

-----Original Message-----
From: Patrick Pelissier [mailto:pelissip at greux.loria.fr]
Sent: Monday, September 27, 2004 9:56 AM
To: Mike Loehr
Cc: gmp-discuss at swox.com; mpfr at loria.fr
Subject: Re: div.c and other questions

<snip>

 MPFR is not ready to become a DLL (or a shared library).
 Couldn't you build just a static library? It is easier, and produces
 faster code.

 mpfr.h is designed to be the User interface, and it is designed to be
 as small as possible, whereas mpfr-impl defined all the internal
 stuff which may change for each version (and indeed it changes quite
often!).

 If you really want to produce a DLL, modifing mpfr-impl.h too is the best
 solution (and shouldn't be too difficult).

 By the way, could you send us (mpfr at loria.fr) the modified files?

> Thanks for all of the work on the library.
 Thanks.

 Sincerely,
  Patrick Pelissier


-------------- next part --------------
A non-text attachment was scrubbed...
Name: div.c
Type: application/octet-stream
Size: 13236 bytes
Desc: not available
Url : /list-archives/gmp-discuss/attachments/20040927/35abafcc/div-0001.obj


More information about the gmp-discuss mailing list