From maechler at stat.math.ethz.ch  Tue Feb  2 12:05:21 2016
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Tue, 2 Feb 2016 12:05:21 +0100
Subject: [Rd] More problems with building R on a musl platform
In-Reply-To: <CAJDAfTAmq9oO4ZKrUZO3J6bXQbY0He5BV=O7QrSgPPrn7Xe5_w@mail.gmail.com>
References: <CAJDAfTBZ5FNAsPuoRyk6CLEOPKG-JpY4OoQ3On-brcHS6UnafA@mail.gmail.com>
	<CAJDAfTAC1U92DXWvxkx7U9ORtJXtY+_e8i3MT85B3o6MsaEkKA@mail.gmail.com>
	<22191.8837.813670.863210@stat.math.ethz.ch>
	<AB464163-D2A0-41EA-A4B1-74412D55AD47@r-project.org>
	<CAJDAfTBqWuG53=a8ei63ZFmCjXzTFJ6kQmKG7c20f5zqiHoRyw@mail.gmail.com>
	<5A694E77-F32F-41C4-8D6D-1E1119ABFCB1@r-project.org>
	<CAJDAfTAS4EtNqNaaFGUm2f+0mGzsZuVAWyjd1j5P0LPP2f92pQ@mail.gmail.com>
	<22191.39588.184490.95069@stat.math.ethz.ch>
	<CAJDAfTAmq9oO4ZKrUZO3J6bXQbY0He5BV=O7QrSgPPrn7Xe5_w@mail.gmail.com>
Message-ID: <22192.36209.688943.979554@stat.math.ethz.ch>

>>>>> "AP" == Alba Pompeo <albapompeo at gmail.com>
>>>>>     on Mon, 1 Feb 2016 15:54:21 -0200 writes:

    AP> Here is tests/reg-tests-1c.Rout.fail -
    AP> http://pastebin.com/raw/3QVDUBwT


Thank you .... so it fails only at the very very end,
where I had added regression checks for a very recent bug
fix... but when I see your result ... embarassingly ... I guess
that that *check* may have been wrong..

Otherwise inspecting that file:

- shows some possible printf
  differences between musl and glibc  but they don't look problematic.

- considerably more problematic seems to me that the random
  numbers differ in some places *AFTER* a set.seed() call.  That
  should not happen {unless we call a randomized algorithm
  somewhere before that, and the algorithm does not converge in
  the same number of steps ... that's possible... e.g., kmeans()
  is "famous" for that}
  

    AP> About the libm, I don't know which one R uses.  musl has
    AP> its on
    AP> libm. http://git.musl-libc.org/cgit/musl/tree/src/math
    AP> I think I also have openlibm installed, but I don't think
    AP> that's used.

    AP> Any more information I can give to help debug this?

Maybe just privately, to confirm my suspicion above:
Send me privately the result of 'f1' from that R script.

Martin





    AP> On Mon, Feb 1, 2016 at 3:49 PM, Martin Maechler
    AP> <maechler at stat.math.ethz.ch> wrote:
    >>>>>>> Alba Pompeo <albapompeo at gmail.com> on Mon, 1 Feb
    >>>>>>> 2016 15:33:11 -0200 writes:
    >> 
    >> > Here's what I did.  > svn checkout
    >> https://svn.r-project.org/R/trunk/ > cd ./trunk > aclocal
    >> -I m4 && autoconf > tools/rsync-recommended > cd ..  >
    >> mkdir build > cd build > ../trunk/configure > make > make
    >> check
    >> 
    >> > On make check it gives an error.  > Here's the log.  >
    >> http://pastebin.com/raw/1qfjqQY2
    >> 
    >> Thank you.  It shows some output differences for complex
    >> arithmetic, which *may* be a bad sign for the musl
    >> routines, or the (also alternative ??)  math lib you have
    >> on your platform.  But these differences where not
    >> leading to the failure, rather is the reason close to the
    >> end of the log:
    >> ------------------------------------------------
    >> make[3]: *** [reg-tests-1c.Rout] Error 1
    >> ------------------------------------------------
    >> 
    >> and these are the very latest regression checks, so they
    >> should not fail.  If you want, you can also make the
    >> tests/reg-tests-1c.Rout.fail
    >> 
    >> file available via a link above, but to me, it currently
    >> looks there needs to be a bit more work on your system
    >> libraries (or possibly on our configuration) side before
    >> you should bundle R with your Alpine Linux.
    >> 
    >> I'd call it "unsafe" for now.  Martin
    >> 
    >> --
    >> Martin Maechler, ETH Zurich and R Core Team.
    >> 
    >> >>>> On Feb 1, 2016, at 4:16 AM, Martin Maechler
    >> <maechler at stat.math.ethz.ch> wrote:
    >> >>>>
    >> >>>>>>>>>> Alba Pompeo <albapompeo at gmail.com> >>>>>>>>>>
    >> on Fri, 29 Jan 2016 08:23:26 -0200 writes:
    >> 
    >> [.........]
    >> 
    >> >>>>>>> However, there are a couple little issues with
    >> non-ASCII >>>>>>> text and a *lot* of math differences,
    >> many of which say >>>>>>> "*no* convergence: NOTIFY
    >> R-core!".
    >> >>>>>
    >> >>>>> Hmm, I may be off, but these would look like
    >> entirely unrelated >>>>> with the libc_stack_end
    >> availibility, wouldn't they ?
    >> >>>>>
    >> >>>>> Maybe you / the musl developers should try to make
    >> those C >>>>> libraries more "standard", notably because
    >> I would see math >>>>> differences as something pretty
    >> grave for R, and indeed, I would >>>>> not want to use a
    >> platform where R's math functions work >>>>> incompatibly
    >> with all other platforms ... but maybe I >>>>>
    >> misunderstand completely.
    >> >>>>>
    >> >>>>> Hmm... I've found this,
    >> >>>>>
    >> >>>>>
    >> http://wiki.musl-libc.org/wiki/Functional_differences_from_glibc#Floating-point_and_mathematical_library
    >> >>>>>
    >> >>>>> which make what you say above more
    >> relevant/interesting.
    >> >>>>>
    >> >>>>> Still, from this thread I get that the C source
    >> code of R needs >>>>> considerable configuration patches
    >> before R can work with musl.  >>>>> But that needs
    >> another thread, something like 'Building R with musl'.
    >> >>>>>
    >> >>>>>>> Until these are resolved, R can't be packaged for
    >> >>>>>>> distributions that use musl, such as Alpine
    >> Linux.
    >> >>>>>
    >> >>>>> which I agree would not be ideal.  >>>>> Martin
    >> >>>>>
    >> >>>>> --
    >> >>>>> Martin <Maechler at stat.math.ethz.ch>
    >> http://stat.ethz.ch/people/maechler >>>>> Seminar f?r
    >> Statistik, ETH Z?rich



[Rd] More problems with building R on a musl platform
Martin Maechler