On Nov 6, 2007 3:35 AM, Stefan Teleman <Stefan.Teleman at sun.com> wrote:
> Including The GNU Multiple Precision Library [GNU MP] with Solaris
>
> Stefan Teleman <Stefan.Teleman at Sun.COM>
> 5 November 2007
>
> 1. Summary and motivation
>
> The GNU MP Bignum Library [1] is described as "[...] a portable
> library written in C for arbitrary precision arithmetic on integers,
> rational numbers, and floating-point numbers. It aims to provide
> the fastest possible arithmetic for all applications that need
> higher precision than is directly supported by the basic C types.
>
> Many applications use just a few hundred bits of precision; but some
> applications may need thousands or even millions of bits. GMP is
> designed to give good performance for both, by choosing algorithms
> based on the sizes of the operands, and by carefully keeping the
> overhead at a minimum."
>
> The inclusion of the GNU MP Library in Solaris will provide
> Solaris software developers with a recognized and widely used
> multiple precision math library.
>
> The GNU MP Library borrows ideas from Richard P. Brent's
> "MP, A Fortran Multiple-Precision Arithmetic Package" [3],
> and implements extensions to the IEEE 754-1985 [4] Standard for
> floating-point arithmetic. Several other MP Libraries have been
> developed on top of GNU MP, most notably MPFR [5].
>
> The code of the GNU MP Library emphasizes speed over simplicity
> and elegance.
>
> This case seeks Mirco/Patch relase Binding.
>
> 2. Technical issues
>
> 2.1. Key objects
>
> /usr/lib/libgmp.so.3.4.2
> /usr/lib/libgmp.so.3 -> /usr/lib/libgmp.so.3.4.2
> /usr/lib/libgmp.so -> /usr/lib/libgmp.so.3.4.2
>
> /usr/lib/libgmpxx.so.4.0.2
> /usr/lib/libgmpxx.so.4 -> /usr/lib/libgmpxx.so.4.0.2
> /usr/lib/libgmpxx.so -> /usr/lib/libgmpxx.so.4.0.2
>
> /usr/lib/libmp.so.3.1.11
> /usr/lib/libmp.so.3 -> /usr/lib/libmp.so.3.1.11
> /usr/lib/libmp.so -> /usr/lib/libmp.so.3.1.11
>
> /usr/lib/${MACH64}/libgmp.so.3.4.2
> /usr/lib/${MACH64}/libgmp.so.3 -> /usr/lib/${MACH64}/libgmp.so.3.4.2
> /usr/lib/${MACH64}/libgmp.so -> /usr/lib/${MACH64}/libgmp.so.3.4.2
>
> /usr/lib/${MACH64}/libgmpxx.so.4.0.2
> /usr/lib/${MACH64}/libgmpxx.so.4 ->
> /usr/lib/${MACH64}/libgmpxx.so.4.0.2
> /usr/lib/${MACH64}/libgmpxx.so -> /usr/lib/${MACH64}/libgmpxx.so.4.0.2
>
> /usr/lib/${MACH64}/libmp.so.3.1.11
> /usr/lib/${MACH64}/libmp.so.3 -> /usr/lib/${MACH64}/libmp.so.3.1.11
> /usr/lib/${MACH64}/libmp.so -> /usr/lib/${MACH64}/libmp.so.3.1.11
>
> /usr/include/gmp/gmp.h
> /usr/include/gmp/gmpxx.h
> /usr/include/gmp/mp.h
>
> /usr/share/doc/gmp/html/index.html
> /usr/share/doc/gmp/html/Algorithms.html
> /usr/share/doc/gmp/html/BSD-Compatible-Functions.html
> /usr/share/doc/gmp/html/C_002b_002b-Class-Interface.html
> /usr/share/doc/gmp/html/Concept-Index.html
> /usr/share/doc/gmp/html/Contributors.html
> /usr/share/doc/gmp/html/Copying.html
> /usr/share/doc/gmp/html/Custom-Allocation.html
> /usr/share/doc/gmp/html/Floating_002dpoint-Functions.html
> /usr/share/doc/gmp/html/Formatted-Input.html
> /usr/share/doc/gmp/html/Formatted-Output.html
> /usr/share/doc/gmp/html/Function-Index.html
> /usr/share/doc/gmp/html/GMP-Basics.html
> /usr/share/doc/gmp/html/GNU-Free-Documentation-License.html
> /usr/share/doc/gmp/html/Installing-GMP.html
> /usr/share/doc/gmp/html/Integer-Functions.html
> /usr/share/doc/gmp/html/Internals.html
> /usr/share/doc/gmp/html/Introduction-to-GMP.html
> /usr/share/doc/gmp/html/Language-Bindings.html
> /usr/share/doc/gmp/html/Low_002dlevel-Functions.html
> /usr/share/doc/gmp/html/Random-Number-Functions.html
> /usr/share/doc/gmp/html/Rational-Number-Functions.html
> /usr/share/doc/gmp/html/References.html
> /usr/share/doc/gmp/html/Reporting-Bugs.html
>
> /usr/share/info/gmp.info
> /usr/share/info/gmp.info-1
> /usr/share/info/gmp.info-2
>
> /usr/share/man/man3/gmp.3
>
> This case proposes the integration of GNU MP Version 4.2.2.
>
> The version of GNU MP [4.2.2] proposed for Integration is 64-bit
> clean and largefile aware. The 64-bit GNU MP libraries will be
> delivered with this Integration.
>
> By default, GNU MP installs its header files under /usr/include.
> We propose changing this default installation location to a more
> suitable /usr/include/gmp, for the purpose of avoiding namespace
> pollution in /usr/include.
>
> GNU MP does not provide documentation in UNIX man format. A wrapper
> man page, to be delivered in Section 3 of the Manual, will provide
> pointers to the HTML and Texinfo documentation delivered by GNU MP.
>
> 2.2. Programmatic Facilities
>
> GNU MP provides a large set of arithmetic and mathematical functions.
> The documentation provided by GNU MP[2] categorizes several high-level
> subsets for these functions:
>
> - Integer Functions
> - Rational Number Functions
> - Floating-point Functions
> - Low-level Functions
> - Random Number Functions
> - Formatted Output
> - Formatted Input
> - C++ Class Interface
> - Berkeley MP Compatible Functions
> - Custom Allocation
> - Language Bindings
> - Algorithms
> - Internals
>
> Key aspects of GNU MP's functionality are discussed below.
>
> libgmp.so.3.4.2 is the C implementation of the GNU MP Bignum
> Library. This shared object delivers the API's implementing
> the functions contained in the subclassing enumerated above.
>
> libmp.so.3.1.11 is the C wrapper providing the BSD MP
> Compatibility API Layer. This library does not implement any
> new functionality in GNU MP; its purpose is restricted to API
> compatibility.
>
> libgmpxx.so.4.0.2 is the C++ Library in GNU MP. It provides
> iostream operator overloading, as well as a class hierarchy
> interface to GNU MP's fundamental types [mpz_t, mpq_t and mpf_t].
> Its purpose is to provide a native C++ language binding.
>
> 2.3. Build and ABI Considerations
>
> Several aspects of the build system configuration for GNU MP,
> affecting GNU MP's ABI, are discussed below.
>
> GNU MP's build system is based on the auto*tools/configure shell
> script. In addition to the standard ./configure arguments, GNU MP
> provides specific options for handling temporary memory allocations:
>
> --enable-alloca=<value>
>
> The allowed options are:
>
> --enable-alloca=alloca
> --enable-alloca=malloc-reentrant
> --enable-alloca=malloc-notreentrant
>
> This option is particularily relevant when the consumer of the
> GNU MP interfaces must allocate very large temporary objects.
> For the purposes of this Integration, GNU MP will be built with
> the --enable-alloca=malloc-reentrant option.
Stefan, please change this to --enable-alloca=alloca.
--enable-alloca=malloc-reentrant will use the default Solaris memory
allocator which *severely* reduces libgmp's performance in multi
threaded applications with many threads. It's up to the caller to
allocate sufficient stack space for temporary allocations.
Irek