8000 Add mpdecimal 4.0.0 sources · python/cpython-source-deps@48316ec · GitHub
[go: up one dir, main page]

Skip to content

Commit 48316ec

Browse files
Add mpdecimal 4.0.0 sources
Signed-off-by: Erlend E. Aasland <erlend@python.org>
1 parent 5da6848 commit 48316ec

File tree

190 files changed

+7250
-74505
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+7250
-74505
lines changed

CHANGELOG.txt

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,156 @@
33
Changelog
44
=========
55

6+
Version 4.0.0
7+
-------------
8+
9+
general
10+
~~~~~~~
11+
12+
**sync soversion and major_version**
13+
14+
- The added number formatting feature requires an ABI change, hence the
15+
increase to SOVERSION=4.
16+
17+
- Packagers outside of the Linux distributions sometimes use the major
18+
version number as the equivalent of SOVERSION on their platforms and
19+
have an incorrect SOVERSION for 2.5.1, which requires SOVERSION=3.
20+
21+
- While SOVERSION is not required to match the major version number
22+
(example: glibc), mpdecimal will from now on take the path of least
23+
resistance and always use SOVERSION=MPD_MAJOR_VERSION.
24+
25+
- The jump to 4.0.0 should also remind users that a C++ library is
26+
available.
27+
28+
build/install
29+
~~~~~~~~~~~~~
30+
31+
**features**
32+
33+
- Support for out-of-tree build.
34+
35+
- Support for pkg-config.
36+
37+
- Unix: support for Loongson.
38+
39+
- Unix: support for CheriBSD.
40+
41+
- Compilers: support for icx, icpx, ibm-clang_r, ibm-clang++_r, CompCert,
42+
clang-cl and emscripten.
43+
44+
- Windows: support for MSYS2/MinGW.
45+
46+
- MSVC: the build now uses /O2 /DNDEBUG.
47+
48+
- MSVC: new arm64/arm32 cross build scripts.
49+
50+
- AIX: the shared libraries are now installed as versioned objects, e.g.,
51+
shr4.o, shr4_64.o.
52+
53+
- New ``./configure`` switches:
54+
55+
``--enable-static``: enable/disable the build of the static libraries
56+
(default: enabled).
57+
58+
``--enable-pc``: enable/disable the install of the pkgconfig files
59+
(default: enabled).
60+
61+
``--enable-doc``: enable/disable the install of the documentation
62+
(default: enabled).
63+
64+
- New ``./configure`` behavior:
65+
66+
On multilib platforms like AIX that default to 32-bit the 64-bit build can
67+
be forced with a single ``./configure MACHINE=uint128`` (ibm-clang, gcc)
68+
or ``./configure MACHINE=ansi64`` (xlc) rather than explicitly setting
69+
``CFLAGS``, ``LDFLAGS``, ``CXXFLAGS`` and ``LDXXFLAGS``.
70+
71+
Note that on most other (multilib) platforms the default is 64-bit and the
72+
optimal configuration is chosen by just using ``./configure``.
73+
74+
- New man pages direct users to the mpdecimal-doc package or the online
75+
HTML documentation.
76+
77+
**tests**
78+
79+
- The C++ tests now automatically skip a small number of bignum tests if
80+
the std::thread stack size (which cannot be altered) is less than 512K.
81+
82+
For all other tests a thread stack size of roughly 50K is sufficient.
83+
84+
- Files in the tests/testdata_dist directory have been significantly
85+
abbreviated in order to facilitate testing on slower platforms. The
86+
tests take 5s on a modern x86_64 platform.
87+
88+
The previous tests have been moved to the separate mpdecimal-testdata
89+
package (replace tests/testdata_dist with the renamed mpdecimal-testdata
90+
directory).
91+
92+
**toolchain issues**
93+
94+
- AIX: The preferred C/C++ compilers are ibm-clang_r and ibm-clang_r++.
95+
g++ has sporadic C++11 threading issues that only show up in long running
96+
programs (or short ones with a sufficient number of repetitions):
97+
98+
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98390
99+
100+
If you only use libmpdec (``--disable-cxx``), gcc and xlc are very stable.
101+
102+
**changed**
103+
104+
- The ``--enable-profile`` configure option has been removed due to fragile
105+
integration with a sequence like ``make && make install``. The new method
106+
is ``make profile && make install``.
107+
108+
**removed**
109+
110+
- The prebuilt HTML documentation is now in the separate mpdecimal-doc
111+
package, which gives distributions that reject prebuilt documentation
112+
the option to disregard it and use the new man pages.
113+
114+
libmpdec
115+
~~~~~~~~
116+
117+
**features**
118+
119+
- Add the "z" format specifier (coerce negative zeros to positive).
120+
121+
- In extremely rare cases the transcendental functions (exp, ln, log10) did
122+
not set the Subnormal/Underflow flags. The reason is that in the case of
123+
an exponent boundary the Ziv correction loop for correct rounding requires
124+
very few iterations to arrive at the correctly rounded result, but may
125+
need many more iterations to arrive at the correct flags.
126+
127+
In these cases, Subnormal/Underflow is not very informative, so the status
128+
quo was to skip the extra iterations.
129+
130+
Version 4.0.0 now specializes exponent boundary cases and uses up to five
131+
additional iterations to set Subnormal/Underflow. The refactored code has
132+
no speed penalty on average; in fact, in the deccheck tests (random tests
133+
with a bias towards corner cases) it is slightly faster.
134+
135+
No cases have been found where more than two additional iterations are
136+
required, but they may exist.
137+
138+
**reliability fixes**
139+
140+
- mpd_qset_string_exact(), mpd_qset_i64_exact() and mpd_qset_u64_exact()
141+
can now be called with a nonzero status. Previously, the functions
142+
could return NaN/Invalid_operation in that case.
143+
144+
This is listed under "reliability fixes" since there is no possible
145+
scenario under which these functions would legitimately be called with
146+
a nonzero status.
147+
148+
libmpdec++
149+
~~~~~~~~~~
150+
151+
**features**
152+
153+
- Add input validation for Decimal.shiftl(), Decimal.shiftr() and
154+
Decimal::ln10().
155+
6156

7157
Version 2.5.1
8158
-------------

COPYRIGHT.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Copyright (c) 2008-2024 Stefan Krah. All rights reserved.
2+
3+
Redistribution and use in source and binary forms, with or without
4+
modification, are permitted provided that the following conditions
5+
are met:
6+
7+
1. Redistributions of source code must retain the above copyright
8+
notice, this list of conditions and the following disclaimer.
9+
2. Redistributions in binary form must reproduce the above copyright
10+
notice, this list of conditions and the following disclaimer in the
11+
documentation and/or other materials provided with the distribution.
12+
13+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23+
SUCH DAMAGE.

INSTALL.txt

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,40 @@
11

2-
# ======================================================================
3-
# Unix: library install instructions
4-
# ======================================================================
2+
# ==============================================================================
3+
# Unix: library install instructions
4+
# ==============================================================================
55

66
# NONGNU: gmake required!
77

8-
# Section 'Custom build' explains how to change the relevant
9-
# build parameters.
8+
# This automatically selects the optimal build on all architectures except
9+
# for multilib systems that default to 32-bit builds (AIX, Solaris):
1010
./configure
11+
make
1112

12-
13-
#
14-
# Short tests. On a fast machine 30s for CONFIG_64 and 60s for CONFIG_32.
15-
#
16-
# ./runshort.sh attempts to download the official tests from
17-
# http://speleotrove.com/decimal/dectest.zip. If wget is
18-
# not installed, download dectest.zip and put the contents
19-
# into the tests/testdata directory.
13+
# The default tests suite attempts to download the official tests cases:
2014
make check
2115

22-
#
23-
# Alternatively: Short tests with allocation failure testing.
24-
# On a fast machine 5 min for CONFIG_64 and 10 min for CONFIG_32.
25-
make check_alloc
16+
# Alternatively, if wget is not installed or no network is available, run:
17+
make check_local
2618

27-
# Install.
19+
# Install:
2820
make install
2921

22+
# On some systems it is necessary to run ``ldconfig'', so the newly installed
23+
# library is found by the system linker. The Makefile does not run `ldconfig''
24+
# because it is not portable:
25+
ldconfig
3026

31-
# ======================================================================
32-
# Custom build
33-
# ======================================================================
27+
28+
# ==============================================================================
29+
# Custom build
30+
# ==============================================================================
3431

3532
#
3633
# MACHINE variable:
3734
#
3835
# If ./configure fails to detect the optimal configuration, a specific
39-
# configuration can be enforced by providing the MACHINE variable.
36+
# configuration can be enforced by providing the MACHINE variable. This
37+
# should only be necessary on AIX, Solaris or for a MacOS universal build.
4038
#
4139
# Example:
4240
#
@@ -70,10 +68,10 @@ make install
7068
#
7169

7270
#
73-
# CFLAGS, LDFLAGS:
71+
# CFLAGS, LDFLAGS, CXXFLAGS, LDXXFLAGS:
7472
#
75-
# If CFLAGS or LDFLAGS are passed to ./configure, they are appended to the
76-
# minimal libmpdec configuration:
73+
# If CFLAGS or LDFLAGS (or the C++ counterparts) are passed to ./configure,
74+
# they are appended to the minimal libmpdec (or libmpdec++) configuration:
7775
#
7876
# ./configure CFLAGS="-m32 -march=i586 -O3" LDFLAGS="-m32"
7977
#
@@ -86,14 +84,12 @@ make install
8684
#
8785
# ==> -DCONFIG_32 -DANSI -Wall -W -O3 -g
8886
#
89-
#
90-
9187

9288
# ======================================================================
9389
# Windows: library install instructions
9490
# ======================================================================
9591

96-
# Build scripts for Visual Studio are in the vcbuild directory.
92+
Build scripts for Visual Studio are in the vcbuild directory.
9793

9894

9995

LICENSE.txt

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0