Debian package and coexisting with GMP

97 views
Skip to first unread message

Doug Torrance

unread,
Mar 13, 2015, 11:45:52 PM3/13/15
to mpir-...@googlegroups.com
Hello!

I've recently been attempting to package MPIR for Debian. One concern that has come up is possible conflicts with GMP, which currently is in Debian while MPIR is not.

Suppose we have two libraries, libA, which is built with MPIR, and libB, which is built with GMP. If a program were to use both libA and libB, would there be any problems? If so, what could be done?

Thanks!
Doug Torrance

Bill Hart

unread,
Mar 14, 2015, 12:08:10 AM3/14/15
to mpir-devel
MPIR is designed as a "drop-in replacement" for GMP (and it is a fork). Precisely the sorts of situations you envision can happen if you try to make them coexist. 

It's probably an essential problem, as the vast majority of packages do not want a so-called "drop-in" replacement to require #including mpir.h and linking against libmpir.so (the default when building MPIR without the --enable-gmpcompat option). 

Users typically want the library and .h file to be named compatibly, and they want the public interface to be the same. For a start, that is likely to clobber any existing gmp.h currently installed.

As far as the interface is concerned, the user facing, publicly documented interface should be the same as that of GMP (<= 5 at this stage). The internals are quite often different. Of course some projects link against internal, undocumented GMP functions.

My advice would be to stick with the official GNU package if you have concerns.

Bill.

Doug Torrance

--
You received this message because you are subscribed to the Google Groups "mpir-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpir-devel+...@googlegroups.com.
To post to this group, send email to mpir-...@googlegroups.com.
Visit this group at http://groups.google.com/group/mpir-devel.
For more options, visit https://groups.google.com/d/optout.

Doug Torrance

unread,
Mar 14, 2015, 9:07:18 AM3/14/15
to mpir-...@googlegroups.com

On Friday, March 13, 2015 at 11:08:10 PM UTC-5, Bill Hart wrote:
MPIR is designed as a "drop-in replacement" for GMP (and it is a fork). Precisely the sorts of situations you envision can happen if you try to make them coexist. 

It's probably an essential problem, as the vast majority of packages do not want a so-called "drop-in" replacement to require #including mpir.h and linking against libmpir.so (the default when building MPIR without the --enable-gmpcompat option). 

Users typically want the library and .h file to be named compatibly, and they want the public interface to be the same. For a start, that is likely to clobber any existing gmp.h currently installed.

As far as the interface is concerned, the user facing, publicly documented interface should be the same as that of GMP (<= 5 at this stage). The internals are quite often different. Of course some projects link against internal, undocumented GMP functions.

My advice would be to stick with the official GNU package if you have concerns.

Great -- thanks for the response!

Doug 
Reply all
Reply to author
Forward
0 new messages