#12762: LinBox (1.1.6) fails to build with GCC 4.7.0, and lacks an `spkg-check`
-------------------------------------------------------------------------+--
       Reporter:  leif                                                   |      
   Owner:  leif        
           Type:  defect                                                 |      
  Status:  needs_review
       Priority:  major                                                  |     
Milestone:  sage-5.0    
      Component:  packages                                               |    
Resolution:              
       Keywords:  C++11 GCC 4.7.0 CXXFLAGS -fpermissive spkg spkg-check  |   
Work issues:              
Report Upstream:  N/A                                                    |     
Reviewers:              
        Authors:  Leif Leonhardy                                         |     
Merged in:              
   Dependencies:                                                         |      
Stopgaps:              
-------------------------------------------------------------------------+--
Changes (by leif):

  * keywords:  C++11 GCC 4.7.0 CXXFLAGS -fpermissive spkg => C++11 GCC
               4.7.0 CXXFLAGS -fpermissive spkg spkg-check
  * status:  new => needs_review


Old description:

> This is due to stricter (C++11) name look-up rules in GCC 4.7.x.
>
> I've created an spkg with a trivial fix, just adding `-fpermissive` to
> `CXXFLAGS` if we're using `g++` 4.7.x:
> {{{
> #!patch
> diff --git a/spkg-install b/spkg-install
> --- a/spkg-install
> +++ b/spkg-install
> @@ -20,6 +20,13 @@
>  export CFLAGS="$CFLAGS -g -fPIC"
>  export CXXFLAGS="$CXXFLAGS -g -fPIC"
>
> +case "`$CXX -dumpversion 2>/dev/null`" in
> +    4.7.*)
> +        echo "Adding '-fpermissive' to CXXFLAGS to make LinBox build
> with GCC 4.7.x."
> +        echo "This is a temporary fix; LinBox currently doesn't conform
> to the C++11 standard."
> +        CXXFLAGS="-fpermissive $CXXFLAGS" # The user might still
> override that.
> +esac
> +
>  # Some systems have problems when parts of Linbox are compiled with
>  # the commentator enabled and other parts with the commentator
>  # disabled.  Therefore, disable it always.
> }}}
>
> ----
>
> '''Preliminary spkg:'''
> [http://boxen.math.washington.edu/home/leif/Sage/spkgs/linbox-1.1.6.p8.spkg]
>
> (Changes not yet committed.)
>
> ----
>
> See #12751 for the GCC-4.7.0 metaticket.

New description:

 This is due to stricter (C++11) name look-up rules in GCC 4.7.x.

 I've created an spkg with a trivial fix, just adding `-fpermissive` to
 `CXXFLAGS` if we're using `g++` 4.7.x:
 {{{
 #!patch
 diff --git a/spkg-install b/spkg-install
 --- a/spkg-install
 +++ b/spkg-install
 @@ -20,6 +20,13 @@
  export CFLAGS="$CFLAGS -g -fPIC"
  export CXXFLAGS="$CXXFLAGS -g -fPIC"

 +case "`$CXX -dumpversion 2>/dev/null`" in
 +    4.7.*)
 +        echo "Adding '-fpermissive' to CXXFLAGS to make LinBox build with
 GCC 4.7.x."
 +        echo "This is a temporary fix; LinBox currently doesn't conform
 to the C++11 standard."
 +        CXXFLAGS="-fpermissive $CXXFLAGS" # The user might still override
 that.
 +esac
 +
  # Some systems have problems when parts of Linbox are compiled with
  # the commentator enabled and other parts with the commentator
  # disabled.  Therefore, disable it always.
 }}}

 ----

 '''New spkg:'''
 [http://boxen.math.washington.edu/home/leif/Sage/spkgs/linbox-1.1.6.p8.spkg]

 '''md5sum:''' `b7a35a9927d5fc5c51f88ad3ada3df6c  linbox-1.1.6.p8.spkg`


 === linbox-1.1.6.p8 (Leif Leonhardy, April 7th 2012) ===
  * #12762: Temporarily add `-fpermissive` to `CXXFLAGS` if we're compiling
    with `g++` 4.7.x, since the LinBox sources currently don't conform to
    C++11, so GCC 4.7.x would otherwise reject them.
  * Exit if the build failed.
  * Use `CFLAG64` if it is set (and `SAGE64=yes`).
  * Clean up `spkg-install`, add some messages.
  * Add an `spkg-check` file, which currently runs `make check`. (There's
 also
    a `fullcheck` target.)
  * Change patch to disable the commentator, as default parameters were
 missing
    with `-DDISABLE_COMMENTATOR`, such that the test suite wouldn't build.
    Also, one must not unconditionally use `extern` for the global (dummy)
    commentator since this is C++, and doing so also breaks the test suite.
  * Fix (i.e. patch) the sources such that the test suite (`make check`)
 builds,
    also with GCC 4.7.0.
  * Add the "Special Update/Build Instructions" section.


 ----

 See #12751 for the GCC-4.7.0 metaticket.

--

Comment:

 Ok, changed and added a couple of things in addition, among these an
 `spkg-check` file, and changes to upstream code and the "disable
 commentator" patch to make the test suite build (see changelog entry in
 the ticket's description and the attached diff for details).

 New spkg, same place, changes now committed, ready to test & review... :P

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12762#comment:6>
Sage <http://www.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