Opened 2 years ago

Closed 2 years ago

#5178 closed enhancement (fixed)

mpc-1.3.0

Reported by: Douglas R. Reno Owned by: lfs-book
Priority: normal Milestone: 11.3
Component: Book Version: git
Severity: normal Keywords:
Cc:

Description

New minor version

Change History (9)

comment:1 by thomas, 2 years ago

There is an issue with gcc later on:

gcc configure failes with

...
checking for the correct version of mpc.h... no
configure: error: Building GCC requires GMP 4.2+, MPFR 3.1.0+ and MPC 0.8.0+.
...

it is an issue with not declared type FILE. Can be fixed by adding

sed -e "/<stdint.h>/a #include <stdio.h>" -i src/mpc.h

in mpc.xml

comment:2 by pierre, 2 years ago

According to this upstream commit, the proper fix is to remove one line containing FILE *. Don't know whether it is easy with a sed.

Last edited 2 years ago by pierre (previous) (diff)

comment:3 by pierre, 2 years ago

I cannot read: a line should be moved, not removed.

in reply to:  2 comment:4 by Bruce Dubbs, 2 years ago

Replying to pierre:

According to this upstream commit, the proper fix is to move one line containing FILE *. Don't know whether it is easy with a sed.

That change is difficult with a sed because the line needs to be moved up. Since sed goes through the file once, there is a hold operator (h), and the line can be moved down. I found some examples using ed, but that won't work for us. Perhaps gawk might work or even vi, but I'm not sure how to do that.

For sed, what is needed is something like:

sed -e '272a __MPC_DECLSPEC void mpcr_out_str (FILE *f, mpcr_srcptr r);' \
    -e '287d' \
    -i src/mpc.h

comment:5 by pierre, 2 years ago

This sed works. Not sure it is much better:

sed -i '/mpcb_out_str/{n; :x; N; /mpcr_out_str/!{ h; bx;}; s/.*\n//; G; }' src/mpc.h

It avoids using line numbers

Last edited 2 years ago by pierre (previous) (diff)

comment:6 by pierre, 2 years ago

A short one proposed by Thomas:

sed -i '273,286 { H; d; }; 287 G' src/mpc.h

But it add a spurious (though harmless) newline. The same with no blank line:

sed -i '273{ h; d; }; 274,286 { H; d; }; 287 G' src/mpc.h

comment:7 by thomas, 2 years ago

Chances are good that with the next release of mpc the patch won't be neccessary anylonger (as upstream has made that patch already). So, IMHO, referring to line numbers is not that evil in this case. The explanation to the sed might be something like

Command explanations

sed -e '273...' : This sed holds the line 273 in a buffer, adds lines 274-286 to it and writes the buffer out after line 287 is read. Result is that the line 287 appears being moved upwards from an incorrect location to its correct location in a #ifdef block.

comment:8 by Bruce Dubbs, 2 years ago

Changes in version 1.3.0 ("Ipomoea batatas"), released in December 2022:

  • New function: mpc_agm
  • New rounding modes "away from zero", indicated by the letter "A" and corresponding to MPFR_RNDA on the designated real or imaginary part.
  • New experimental ball arithmetic.
  • New experimental function: mpc_eta_fund
  • Bug fixes:
    • mpc_asin for asin(z) with small |Re(z)| and tiny |Im(z)|
    • mpc_pow_fr: sign of zero part of result when the base has up to sign the same real and imaginary part, and the exponent is an even positive integer
    • mpc_fma: the returned 'int' value was incorrect in some cases (indicating whether the rounded real/imaginary parts were smaller/equal/greater than the exact values), but the computed complex value was correct.
  • Remove the unmaintained Makefile.vc; build files for Visual Studio can be found at https://github.com/BrianGladman/mpc .

comment:9 by Bruce Dubbs, 2 years ago

Resolution: fixed
Status: newclosed

Fixed at commit c9aabf13a1e8e1fb57688a7dea2f2ca2f1a9e1ab

    Ensure a gawk hard link is updated in Chapter 8.
    Update to iana-etc-20221209.
    Update to vim-9.0.1060.
    Update to iproute2-6.1.0.
    Update to xz-5.4.0.
    Update to bash-5.2.15.
    Update to psmisc-23.6.
    Update to mpc-1.3.0.
    Update to python3-3.11.1.
    Update to procps-ng-4.0.2.
Note: See TracTickets for help on using tickets.