Opened 10 years ago

Closed 10 years ago

#12762 closed defect (fixed)

LinBox (1.1.6) fails to build with GCC 4.7.0, and lacks an `spkg-check`

Reported by: leif Owned by: leif
Priority: major Milestone: sage-5.0.1
Component: packages: standard Keywords: C++11 GCC 4.7.0 CXXFLAGS -fpermissive spkg spkg-check sd40.5
Cc: cpernet, was, mariah Merged in: sage-5.0.1.rc1
Authors: Leif Leonhardy Reviewers: Jeroen Demeyer, Karl-Dieter Crisman
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by jdemeyer)

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:

  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    2020export CFLAGS="$CFLAGS -g -fPIC"
    2121export CXXFLAGS="$CXXFLAGS -g -fPIC"
    2222
     23case "`$CXX -dumpversion 2>/dev/null`" in
     24    4.7.*)
     25        echo "Adding '-fpermissive' to CXXFLAGS to make LinBox build with GCC 4.7.x."
     26        echo "This is a temporary fix; LinBox currently doesn't conform to the C++11 standard."
     27        CXXFLAGS="-fpermissive $CXXFLAGS" # The user might still override that.
     28esac
     29
    2330# Some systems have problems when parts of Linbox are compiled with
    2431# the commentator enabled and other parts with the commentator
    2532# disabled.  Therefore, disable it always.

New spkg: http://boxen.math.washington.edu/home/jdemeyer/spkg/linbox-1.1.6.p10.spkg

linbox-1.1.6.p10 (Jeroen Demeyer, 25 May 2012)

  • #12762 review: Remove the touching of linbox.pyx, since Cython knows the dependency of linbox.pyx on linbox-sage.h
  • Only add the -fpermissive workaround on GCC-4.7.x, not other compilers.

linbox-1.1.6.p9 (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.

Attachments (2)

linbox-1.1.6.p7-p8.diff (15.2 KB) - added by leif 10 years ago.
Diff between the previous spkg in Sage and my new p8 spkg. For reference / review only.
linbox-1.1.6.p10.diff (2.1 KB) - added by jdemeyer 10 years ago.
Diff between leif's p9 (a rebased p8) and my p10 spkgs. For reference / review only.

Download all attachments as: .zip

Change History (24)

comment:1 Changed 10 years ago by jdemeyer

  • Description modified (diff)

comment:2 Changed 10 years ago by leif

  • Authors set to Leif Leonhardy
  • Description modified (diff)

comment:3 Changed 10 years ago by leif

  • Description modified (diff)

comment:4 Changed 10 years ago by leif

  • Cc cpernet was mariah added

P.S.: Probably upstream has already fixed this; haven't checked.

Also this package has last been upgraded in June 2008; Clément Pernet is listed as an spkg maintainer as well as the upstream contact.

comment:5 Changed 10 years ago by leif

  • Description modified (diff)

Changed 10 years ago by leif

Diff between the previous spkg in Sage and my new p8 spkg. For reference / review only.

comment:6 Changed 10 years ago by leif

  • Description modified (diff)
  • Keywords spkg-check added
  • Status changed from new to needs_review
  • Summary changed from LinBox (1.1.6) fails to build with GCC 4.7.0 to LinBox (1.1.6) fails to build with GCC 4.7.0, and lacks an `spkg-check`

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

comment:7 Changed 10 years ago by leif

P.S.:

There's a not that recent "stable" LinBox version 1.1.7, as well as IIRC more recent "instable" 1.2.x development versions. (Unfortunately there's no changelog entry for the 1.1.7 version, at least not online.)

Haven't yet tried any of these, but upgrading -- if worthwhile -- should IMHO be done on another ticket; making the spkg build with GCC 4.7.x, adding an spkg-check file and making the test suite build seems more important (or urgent) to me.

comment:9 Changed 10 years ago by Snark

I tried this spkg this morning and it failed ; the compile lines lack the -fpermissive, even though I see the code in spkg-install which is supposed to add it...

Notice that it was with a fairly extensively modified sage-5.0.rc1, so maybe the failure isn't that conclusive, but I still thought it was worth reporting.

comment:10 Changed 10 years ago by Snark

I retried with a bare sage-5.0.rc1, and linbox failed.

I retried with the spkg with md5sum b7a35a9927d5fc5c51f88ad3ada3df6c, and it failed.

comment:11 Changed 10 years ago by Snark

I noticed two things :

  1. the only directory where the current patch doesn't work is interfaces/sage/ : the rest builds ok!
  2. if there is nothing in patches/, then spkg-install errors out.

I settled to fix the matter, but must admit my failure : even if I manage to get the -fpermissive through (adding directly to interfaces/sage/Makefile.am... not clean at all), the build still fails with this error : linbox-sage.C:463:13: error: ‘NTL_ZZ’ was not declared in this scope

comment:12 Changed 10 years ago by jdemeyer

  • Milestone changed from sage-5.0 to sage-5.1

comment:13 Changed 10 years ago by jdemeyer

  • Status changed from needs_review to needs_work

In

case "`$CXX -dumpversion 2>/dev/null`" in
    4.7.*)

You should check for GCC first.

comment:14 Changed 10 years ago by Snark

I have another idea : get in touch with upstream so the code is fixed, and update the version in sage... no more ugly workaround!

comment:15 Changed 10 years ago by jdemeyer

  • Description modified (diff)

comment:16 Changed 10 years ago by jdemeyer

  • Description modified (diff)
  • Reviewers set to Jeroen Demeyer
  • Status changed from needs_work to needs_review

Changed 10 years ago by jdemeyer

Diff between leif's p9 (a rebased p8) and my p10 spkgs. For reference / review only.

comment:17 Changed 10 years ago by jdemeyer

Rebased leif's patch to #10281, then made some further changes.

New spkg needs review.

comment:18 Changed 10 years ago by jdemeyer

  • Keywords sd40.5 added

comment:19 Changed 10 years ago by kcrisman

  • Reviewers changed from Jeroen Demeyer to Jeroen Demeyer, Karl-Dieter Crisman

This installs correctly with 4.7.0 on sage.math, and then after using SAGE_UPGRADING and everything building, then again force installing this package and doing sage -b does build the correct extension modules. Spkg is properly constructed etc., patches are applying without exiting with non-zero, etc. Running long doctests, but I don't expect anything unusual.

comment:20 Changed 10 years ago by kcrisman

  • Status changed from needs_review to positive_review

Good to go. Also passes tests on Mac OS X built with GCC 4.6.3, so should be ok.

comment:21 Changed 10 years ago by jdemeyer

  • Milestone changed from sage-5.1 to sage-5.0.1

comment:22 Changed 10 years ago by jdemeyer

  • Merged in set to sage-5.0.1.rc1
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.