#6453: [with patch, needs work] MPFR test failures on Solaris 10 update 4 on 
host
't2'
----------------------+-----------------------------------------------------
 Reporter:  drkirkby  |       Owner:  drkirkby                     
     Type:  defect    |      Status:  assigned                     
 Priority:  major     |   Milestone:  sage-4.1.1                   
Component:  solaris   |    Keywords:  compiler bug                 
 Reviewer:            |      Author:  Paul Zimmermann, David Kirkby
   Merged:            |  
----------------------+-----------------------------------------------------
Changes (by newvalueoldvalue):

 * cc: david.kir...@…, paul.zimmerm...@… (added)
  * keywords:  => compiler bug
  * author:  => Paul Zimmermann, David Kirkby


Comment:

 I've implemented Paul's patch, but in a way which should cause minimal
 impact on performance.

 1) The patch is only ever applied on Solaris.

 2) By default, the patch is applied only on sun4v systems (those based on
 the Sun T1, T2 and T2+ processors) as the library with memset() is
 different on that architecture to most others.

 The machine 't2' is sun4v, as it has two Sun T2+ processors. Hence the
 patch will not be applied on more common machines like my Sun Blade 2000
 with its UltraSPARC II processors, which is a sun4u system.

 3) It is possible to force the patch to be installed, or force it to not
 be installed, by setting the environment variable INCLUDE_MPFR_PATCH

 {{{
 $ export INCLUDE_MPFR_PATCH=1   (force patch to install)
 $ export INCLUDE_MPFR_PATCH=0   (will not install the patch)
 $ export INCLUDE_MPFR_PATCH=foobar (User mistake. Apply the patch).
 $ unset  INCLUDE_MPFR_PATCH  (Defaults to installing on sun4v only.)
 }}}


 When we distribute binaries for Sage, I suggest they should be built on a
 Sun with the very first release of Solaris 10 (i.e. NOT 't2', which runs
 Solaris 10 update 7). I can set up an old machine for that purpose. When
 building binaries we should set INCLUDE_MPFR_PATCH to 1, so the patch is
 applied. Then the code should work, on any Solaris 10 SPARC system. (Since
 my Sun Blade 2000 is not sun4v, the patch would not normally be installed,
 but I would force it to be installed in this case).

 How to test.

 1) Change your setup to use gcc 4.4.0, as that causes the 20 test failures
 to occur.

 {{{
 $ source /usr/local/gcc-4.4.0-sun-linker/gcc440sun
 }}}


 2) Verify mpfr passes all tests on 't2' with gcc 4.4.0. Previously 20
 failures occurred with gcc 4.4.0

 3) Check the effects on the messages sent to the screen depend on the
 settings of the variable INCLUDE_MPFR_PATCH. You do not need to build mpfr
 with every combination, but after the files are extracted, there will be
 some messages. Just break the build, and read that they make sense.
 Compare to what looks logical from spkg-install.

 There is a reasonably comprehensive set of messages, which are output on
 any Solaris system. The last few messages are specific to the machine's
 architecture and setting of the variable INCLUDE_MPFR_PATCH.

 Here's the specific last part of the message on my personal machine, which
 is sun4u, and so not the troublesome sun4v, so there is no need for me to
 patch this. (I say troublesome, but I expect this is a compiler bug).

 1) The default, with the variable unset:

 {{{
 $ unset INCLUDE_MPFR_PATCH
 $ make
 <SNIP>
 Since this is not a sun4v system, the MPFR binary will not
 be patched
 WARNING: Problems may occur if you try to run this SPARC
 binary on a sun4v system (T1, T2 or T2+ processors). Binaries created like
 this should not distributed unless you know the end users system will not
 be sun4v. Set INCLUDE_MPFR_PATCH to 1, to include the patch, if you are
 unsure.

 }}}

 2) Force the patch to be installed.

 {{{
 $ export INCLUDE_MPFR_PATCH=1
 $ make
 <SNIP>
 Since INCLUDE_MPFR_PATCH was set to 1, the MPFR library will be patched.
 The binaries should be safe on any Solaris system
 }}}


 3) Force the patch not to be applied (it would not be applied on my
 machine anyway, but it would be on t2)


 {{{
 $ export INCLUDE_MPFR_PATCH=0
 $ make
 <SNIP>
 Since INCLUDE_MPFR_PATCH was set to 0, the MPFR library will not
 be patched. You would be unwise to distribute SPARC binaries
 unless you are sure they will not be used on sun4v systems
 }}}


 4) Set the environment variable INCLUDE_MPFR_PATCH to some nonsense value

 $ export INCLUDE_MPFR_PATCH=foobar

 {{{
 $ make
 <SNIP>
 The environment variable INCLUDE_MPFR_PATCH was set incorrectly The MPFR
 library will be patched as a precaution.
 }}}



 5) Set the environment variable to nothing. This is considered an error

 {{{
 $ export INCLUDE_MPFR_PATCH=
 $ make
 <SNIP>
 The environment variable INCLUDE_MPFR_PATCH was set incorrectly The MPFR
 library will be patched as a precaution.
 }}}

 A few others things are done in this patch.

  * Removed a comment at the bottom of spkg-install to bypass the checks
    on release systems. Given failures have occurred, it would be unwise to
    bypass any checks.

  * Add a comment to remind people not to bypass the tests.

  * Update the source to use the latest patches, as strongly recommenced in
 the
    INSTALL file. This brings the code to MPFR 2.4.1 patch level 5, though
 I'm
    considering it mpfr-2.4.1p0 for Sage purposes.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6453#comment:7>
Sage <http://sagemath.org/>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to