Bug 232802 - math/mpfr: libmpfr 4.0.2 missing at the moment
Summary: math/mpfr: libmpfr 4.0.2 missing at the moment
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Alex Dupre
URL: https://www.mpfr.org/mpfr-current/#do...
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2018-10-30 05:50 UTC by Dennis Clarke
Modified: 2019-02-18 14:19 UTC (History)
1 user (show)

See Also:
koobs: maintainer-feedback? (ale)
koobs: merge-quarterly?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Clarke 2018-10-30 05:50:50 UTC
The mpfr project releases patches on a regular schedule and these are 
quite important to normal function. 

Following test code will confirm : 

#define _XOPEN_SOURCE 600

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <gmp.h>
#include <mpfr.h>

int main (int argc, char *argv[])
{

    printf("GMP library version : %d.%d.%d\n",
            __GNU_MP_VERSION,
            __GNU_MP_VERSION_MINOR,
            __GNU_MP_VERSION_PATCHLEVEL );

    printf("MPFR library: %-12s\n", mpfr_get_version ());
    printf("MPFR header: %s (based on %d.%d.%d)\n",
            MPFR_VERSION_STRING,
            MPFR_VERSION_MAJOR,
            MPFR_VERSION_MINOR,
            MPFR_VERSION_PATCHLEVEL);

    if (mpfr_buildopt_tls_p()!=0)
        printf("          : compiled as thread safe using TLS\n");

    if (mpfr_buildopt_float128_p()!=0) 
        printf("          : __float128 support enabled\n");

    if (mpfr_buildopt_decimal_p()!=0)
        printf("          : decimal float support enabled\n");

    if (mpfr_buildopt_gmpinternals_p()!=0)
        printf("          : compiled with GMP internals\n");

    if (mpfr_buildopt_sharedcache_p()!=0)
        printf("          : threads share cache per MPFR const\n");

    printf("MPFR thresholds file used at compile time : %s\n",
                                      mpfr_buildopt_tune_case ());

    return EXIT_SUCCESS;
}

Output on a system with up to date libmpfr should say : 
c$ ./ver
GMP library version : 6.1.2
MPFR library: 4.0.1-p13   
MPFR header: 4.0.1-p13 (based on 4.0.1)
          : compiled as thread safe using TLS
          : __float128 support enabled
MPFR thresholds file used at compile time : default
c$ 

Or perhaps : 
n0x$ ./ver
GMP library version : 6.1.2
MPFR library: 4.0.1-p13   
MPFR header: 4.0.1-p13 (based on 4.0.1)
MPFR thresholds file used at compile time : src/sparc64/mparam.h
n0x$ 

However FreeBSD 12.0 beta 2 reports : 

hydra $ uname -a 
FreeBSD hydra 12.0-BETA2 FreeBSD 12.0-BETA2 r339753 GENERIC  amd64
hydra $ ldd ver
ver:
        libgmp.so.10 => /usr/local/lib/libgmp.so.10 (0x800646000)
        libmpfr.so.6 => /usr/local/lib/libmpfr.so.6 (0x8006c9000)
        libc.so.7 => /lib/libc.so.7 (0x800742000)
hydra $ ./ver
GMP library version : 6.1.2
MPFR library: 4.0.1       
MPFR header: 4.0.1 (based on 4.0.1)
          : compiled as thread safe using TLS
MPFR thresholds file used at compile time : src/amd/k8/mparam.h
hydra $

Patches are trivial to apply and are available at the project site

    https://www.mpfr.org/mpfr-current/#download

See section "Bugs" there. 

Be advised that while both gmp and mpfr are compiler and system agnostic the
gcc compiler normally needs them during bootstrap phase and thus the gcc8 
package may also be updated but this is not strictly necessary.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2018-10-30 06:34:52 UTC
Canonicalize title, assign to maintainer
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-10-30 06:57:46 UTC
A commit references this bug:

Author: ale
Date: Tue Oct 30 06:56:55 UTC 2018
New revision: 483455
URL: https://svnweb.freebsd.org/changeset/ports/483455

Log:
  Add post 4.0.1 patches.

  PR:		232802
  Submitted by:	Dennis Clarke <dclarke@blastwave.org>

Changes:
  head/math/mpfr/Makefile
  head/math/mpfr/distinfo
Comment 3 Dennis Clarke 2018-10-30 19:55:03 UTC
Also enable float128 support : 

hydra $ ./ver
GMP library version : 6.1.2
MPFR library: 4.0.1-p13   
MPFR header: 4.0.1-p13 (based on 4.0.1)
          : compiled as thread safe using TLS
          : __float128 support enabled
MPFR thresholds file used at compile time : default
hydra $
Comment 4 Dennis Clarke 2018-11-06 19:54:55 UTC
Not sure what is going on here : 


===>  License LGPL3+ accepted by the user
===>   mpfr-4.0.1_1 depends on file: /usr/local/sbin/pkg - found
=> mpfr-4.0.1.tar.xz doesn't seem to exist in /usr/ports/distfiles/mpfr-4.0.1.
=> Attempting to fetch http://www.mpfr.org/mpfr-current/mpfr-4.0.1.tar.xz
mpfr-4.0.1.tar.xz                                     1379 kB  731 kBps    01s
=> patch01 doesn't seem to exist in /usr/ports/distfiles/mpfr-4.0.1.
=> Attempting to fetch http://www.mpfr.org/mpfr-current/patch01
patch01                                                 10 kB   36 MBps    00s
=> patch02 doesn't seem to exist in /usr/ports/distfiles/mpfr-4.0.1.
=> Attempting to fetch http://www.mpfr.org/mpfr-current/patch02
patch02                                                 32 kB  277 kBps    00s
=> patch03 doesn't seem to exist in /usr/ports/distfiles/mpfr-4.0.1.
=> Attempting to fetch http://www.mpfr.org/mpfr-current/patch03
patch03                                               8905  B   32 MBps    00s
=> patch04 doesn't seem to exist in /usr/ports/distfiles/mpfr-4.0.1.
=> Attempting to fetch http://www.mpfr.org/mpfr-current/patch04
patch04                                                 10 kB   36 MBps    00s
=> patch05 doesn't seem to exist in /usr/ports/distfiles/mpfr-4.0.1.
=> Attempting to fetch http://www.mpfr.org/mpfr-current/patch05
patch05                                               5176  B   23 MBps    00s
=> patch06 doesn't seem to exist in /usr/ports/distfiles/mpfr-4.0.1.
=> Attempting to fetch http://www.mpfr.org/mpfr-current/patch06
patch06                                               2030  B   10 MBps    00s
=> patch07 doesn't seem to exist in /usr/ports/distfiles/mpfr-4.0.1.
=> Attempting to fetch http://www.mpfr.org/mpfr-current/patch07
patch07                                               3749  B   17 MBps    00s
=> patch08 doesn't seem to exist in /usr/ports/distfiles/mpfr-4.0.1.
=> Attempting to fetch http://www.mpfr.org/mpfr-current/patch08
^Cfetch: transfer interrupted
*** Signal 2
*** Signal 2

The patch url should just be https://www.mpfr.org/mpfr-current/allpatches

That is all that should be needed. 

Regardless mpfr.h looks good : 

#define MPFR_VERSION_MAJOR 4
#define MPFR_VERSION_MINOR 0
#define MPFR_VERSION_PATCHLEVEL 1
#define MPFR_VERSION_STRING "4.0.1-p13"

yep .. cool .. I will test.
Comment 5 Dennis Clarke 2018-11-06 22:03:07 UTC
Looks good ! 

$ readelf -del ver | grep -Ee 'NEED|PATH'
 0x000000000000001d RUNPATH              Library runpath: [/usr/local/lib]
 0x0000000000000001 NEEDED               Shared library: [libgmp.so.10]
 0x0000000000000001 NEEDED               Shared library: [libm.so.5]
 0x0000000000000001 NEEDED               Shared library: [libmpfr.so.6]
 0x0000000000000001 NEEDED               Shared library: [libc.so.7]
 0x000000006ffffffe VERNEED              0x2005b8
 0x000000006fffffff VERNEEDNUM           1
$ ./ver 
GMP  library version : 6.1.2
MPFR library: 4.0.1-p13   
MPFR header: 4.0.1-p13 (based on 4.0.1)
          : compiled as thread safe using TLS
MPFR thresholds file used at compile time : src/amd/k8/mparam.h
$
Comment 6 Dennis Clarke 2018-11-17 22:24:19 UTC
Problem seems to have returned in 12.0RC1 : 

titan# uname -a 
FreeBSD titan 12.0-RC1 FreeBSD 12.0-RC1 r340470 GENERIC  amd64
titan# 

titan# diff /usr/local/include/mpfr.h /home/dclarke/local/include/mpfr.h 
30c30
< #define MPFR_VERSION_STRING "4.0.1"
---
> #define MPFR_VERSION_STRING "4.0.1-p13"
titan# 

Code check : 

$ cat mpfr_ver.c

#define _XOPEN_SOURCE 600

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <gmp.h>
#include <mpfr.h>

void mpfr_version_report()
{

    printf("GMP  library version : %d.%d.%d\n",
            __GNU_MP_VERSION,
            __GNU_MP_VERSION_MINOR,
            __GNU_MP_VERSION_PATCHLEVEL );

    printf("MPFR library: %-12s\n", mpfr_get_version ());
    printf("MPFR header: %s (based on %d.%d.%d)\n",
            MPFR_VERSION_STRING,
            MPFR_VERSION_MAJOR,
            MPFR_VERSION_MINOR,
            MPFR_VERSION_PATCHLEVEL);

    if (mpfr_buildopt_tls_p()!=0)
        printf("          : compiled as thread safe using TLS\n");

    if (mpfr_buildopt_float128_p()!=0) 
        printf("          : __float128 support enabled\n");

    if (mpfr_buildopt_decimal_p()!=0)
        printf("          : decimal float support enabled\n");

    if (mpfr_buildopt_gmpinternals_p()!=0)
        printf("          : compiled with GMP internals\n");

    if (mpfr_buildopt_sharedcache_p()!=0)
        printf("          : threads share cache per MPFR const\n");

    printf("MPFR thresholds file used at compile time : %s\n",
                                      mpfr_buildopt_tune_case ());

}


#define _XOPEN_SOURCE 600

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <gmp.h>
#include <mpfr.h>

void mpfr_version_report();

int main (int argc, char *argv[])
{
    mpfr_version_report();
    return EXIT_SUCCESS;
}

$ CC=/usr/bin/cc
$ export CC
$ 
$ CFLAGS=\-m64\ \-std=c99\ \-O0\ \-g\ \-Werror\ \
> \-no-integrated-as\ \-fno-fast-math\ \-fno-builtin\ \
> \-fdiagnostics-format=vi\ \-fno-color-diagnostics
$ export CFLAGS 
$ 
$ CPPFLAGS=\-D_TS_ERRNO\ \-D_POSIX_PTHREAD_SEMANTICS\ \
> \-D_LARGEFILE64_SOURCE
$ export CPPFLAGS
$ 
$ LD_FLAGS=\-Wl,-rpath=/usr/local/lib\ \-L/usr/local/lib
$ export LD_FLAGS
$ 

$ $CC $CFLAGS $CPPFLAGS -I/usr/local/include -c -o mpfr_ver.o mpfr_ver.c
$ $CC $CFLAGS $CPPFLAGS -I/usr/local/include -c -o ver.o ver.c 
$ $CC $CFLAGS $CPPFLAGS $LD_FLAGS -o ver ver.o mpfr_ver.o -lgmp -lmpfr 
$ ./ver 
GMP  library version : 6.1.2
MPFR library: 4.0.1       
MPFR header: 4.0.1 (based on 4.0.1)
          : compiled as thread safe using TLS
MPFR thresholds file used at compile time : src/amd/k8/mparam.h
$ 

Meanwhile my own local builds have the patches : 

$ 
$ LD_FLAGS=\-Wl,-rpath=/home/dclarke/local/lib\ \-L/home/dclarke/local/lib
$ export LD_FLAGS
$ 
$ $CC $CFLAGS $CPPFLAGS -I/home/dclarke/local/include -c -o mpfr_ver.o mpfr_ver.c
$ $CC $CFLAGS $CPPFLAGS -I/home/dclarke/local/include -c -o ver.o ver.c 
$ $CC $CFLAGS $CPPFLAGS $LD_FLAGS -o ver ver.o mpfr_ver.o -lgmp -lmpfr
$ ldd ver
ver:
        libgmp.so.10 => /home/dclarke/local/lib/libgmp.so.10 (0x800247000)
        libmpfr.so.6 => /home/dclarke/local/lib/libmpfr.so.6 (0x8002eb000)
        libc.so.7 => /lib/libc.so.7 (0x8003a5000)
$ 
$ ./ver
GMP  library version : 6.1.2
MPFR library: 4.0.1-p13   
MPFR header: 4.0.1-p13 (based on 4.0.1)
          : compiled as thread safe using TLS
MPFR thresholds file used at compile time : src/amd/k8/mparam.h
$ 

We went backwards somehow. So .. that's not good.

Dennis
Comment 7 Alex Dupre freebsd_committer freebsd_triage 2018-11-19 16:44:38 UTC
What's the output pf `pkg info -E mpfr` ?
Comment 8 Dennis Clarke 2018-11-19 17:29:27 UTC
(In reply to Alex Dupre from comment #7)
I see two different reports from two systems : 

titan# uname -a 
FreeBSD titan 12.0-RC1 FreeBSD 12.0-RC1 r340470 GENERIC  amd64
titan# pkg info -E mpfr
mpfr-4.0.1
titan# 

eris# uname -a 
FreeBSD eris 12.0-RC1 FreeBSD 12.0-RC1 r340470 GENERIC  powerpc
eris# pkg info -E mpfr
mpfr-4.0.1_2
eris# 

The powerpc version looks correct : 

eris$ ./ver
GMP  library version : 6.1.2
MPFR library: 4.0.1-p13   
MPFR header : 4.0.1-p13 (based on 4.0.1)
            : compiled as thread safe using TLS
MPFR thresholds file used at compile time : src/powerpc32/mparam.h
eris$ 

The x86_64 rev seems off.
Comment 9 Dennis Clarke 2018-11-19 18:03:08 UTC
Well gee ... I did a "portsnap fetch update" and extract cycle and then
re-built/deinstall/install mpfr and now the version is correct : 

titan$ 
titan$ pkg query %t\ %n\ %v\ %o | sort -n 
1542490808 pkg 1.10.5_5 ports-mgmt/pkg
1542490844 dialog4ports 0.1.6 ports-mgmt/dialog4ports
1542490872 indexinfo 0.3.1 print/indexinfo
1542490938 gettext-runtime 0.19.8.1_1 devel/gettext-runtime
1542491053 gettext-tools 0.19.8.1 devel/gettext-tools
1542491907 perl5 5.28.0 lang/perl5.28
1542492184 p5-Locale-gettext 1.07 devel/p5-Locale-gettext
1542492207 gmake 4.2.1_2 devel/gmake
1542492230 help2man 1.47.7 misc/help2man
1542492292 texinfo 6.5,1 print/texinfo
1542492535 gmp 6.1.2 math/gmp
1542493509 pkgconf 1.4.2,1 devel/pkgconf
1542493957 xorg-macros 1.19.2 devel/xorg-macros
1542494036 xtrans 1.3.5 x11/xtrans
1542494194 xorgproto 2018.4 x11/xorgproto
1542494217 libXau 1.0.8_5 x11/libXau
1542494257 libXdmcp 1.1.2_2 x11/libXdmcp
1542495706 libsigsegv 2.12 devel/libsigsegv
1542495733 m4 1.4.18,1 devel/m4
1542495768 autoconf-wrapper 20131203 devel/autoconf-wrapper
1542495769 autoconf 2.69_1 devel/autoconf
1542495778 automake 1.16.1 devel/automake
1542495794 libtool 2.4.6 devel/libtool
1542495828 check 0.12.0 devel/check
1542495863 libffi 3.2.1_2 devel/libffi
1542495922 readline 7.0.3_1 devel/readline
1542495995 python27 2.7.15 lang/python27
1542496050 libxml2 2.9.7 textproc/libxml2
1542496053 xcb-proto 1.13 x11/xcb-proto
1542496056 libpthread-stubs 0.4 devel/libpthread-stubs
1542496135 libgpg-error 1.32 security/libgpg-error
1542496167 libgcrypt 1.8.3 security/libgcrypt
1542496178 libxslt 1.1.32 textproc/libxslt
1542496201 libxcb 1.13.1 x11/libxcb
1542496244 libX11 1.6.6_1,1 x11/libX11
1542496252 libXext 1.3.3_3,1 x11/libXext
1542496264 libICE 1.0.9_3,1 x11/libICE
1542496269 libSM 1.2.2_5,1 x11/libSM
1542496280 libXt 1.1.5_2,1 x11-toolkits/libXt
1542496286 libXmu 1.1.2_5,1 x11-toolkits/libXmu
1542496290 xauth 1.0.10 x11/xauth
1542496574 ksh93 20120801_2 shells/ksh93
1542496685 expat 2.2.6_1 textproc/expat2
1542496782 libiconv 1.14_11 converters/libiconv
1542497025 gdb 8.2 devel/gdb
1542650302 mpfr 4.0.1_2 math/mpfr
titan$ uname -a 
FreeBSD titan 12.0-RC1 FreeBSD 12.0-RC1 r340470 GENERIC  amd64
titan$ 
titan$ pkg info -E mpfr 
mpfr-4.0.1_2
titan$ 

Lovely.
Comment 10 Dennis Clarke 2019-02-17 23:01:08 UTC
This is a sort of an ongoing chase the dragon type process where
the libgmp and libmpfr projects are always evolving and going
forwards and therefore there is a new release out that needs
to be brought into FreeBSD.  See https://www.mpfr.org/mpfr-current/
where GNU MPFR version 4.0.2 was released on 31 January 2019.


-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional