Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
nexttime mannequin opened this issue Mar 27, 2012 · 27 comments
Closed

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

nexttime mannequin opened this issue Mar 27, 2012 · 27 comments

Comments

@nexttime
Copy link
Mannequin

nexttime mannequin commented Mar 27, 2012

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:

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/jdemeyer/spkg/linbox-1.1.6.p10.spkg

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

linbox-1.1.6.p9 (Leif Leonhardy, April 7th 2012)

  • LinBox (1.1.6) fails to build with GCC 4.7.0, and lacks an spkg-check #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.

CC: @ClementPernet @williamstein @sagetrac-mariah

Component: packages: standard

Keywords: C++11 GCC 4.7.0 CXXFLAGS -fpermissive spkg spkg-check sd40.5

Author: Leif Leonhardy

Reviewer: Jeroen Demeyer, Karl-Dieter Crisman

Merged: sage-5.0.1.rc1

Issue created by migration from https://trac.sagemath.org/ticket/12762

@nexttime nexttime mannequin added this to the sage-5.0 milestone Mar 27, 2012
@nexttime nexttime mannequin self-assigned this Mar 27, 2012
@jdemeyer

This comment has been minimized.

@nexttime
Copy link
Mannequin Author

nexttime mannequin commented Mar 28, 2012

Author: Leif Leonhardy

@nexttime

This comment has been minimized.

@nexttime

This comment has been minimized.

@nexttime
Copy link
Mannequin Author

nexttime mannequin commented Mar 28, 2012

comment:4

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.

@nexttime

This comment has been minimized.

@nexttime
Copy link
Mannequin Author

nexttime mannequin commented Apr 7, 2012

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

@nexttime
Copy link
Mannequin Author

nexttime mannequin commented Apr 7, 2012

Changed keywords from C++11 GCC 4.7.0 CXXFLAGS -fpermissive spkg to C++11 GCC 4.7.0 CXXFLAGS -fpermissive spkg spkg-check

@nexttime

This comment has been minimized.

@nexttime
Copy link
Mannequin Author

nexttime mannequin commented Apr 7, 2012

comment:6

Attachment: linbox-1.1.6.p7-p8.diff.gz

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

@nexttime nexttime mannequin changed the title LinBox (1.1.6) fails to build with GCC 4.7.0 LinBox (1.1.6) fails to build with GCC 4.7.0, and lacks an spkg-check Apr 7, 2012
@nexttime nexttime mannequin added the s: needs review label Apr 7, 2012
@nexttime
Copy link
Mannequin Author

nexttime mannequin commented Apr 7, 2012

comment:7

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.

@pcpa
Copy link
Mannequin

pcpa mannequin commented Apr 26, 2012

comment:8

Fedora has this patch for linbox 1.2.2 http://pkgs.fedoraproject.org/gitweb/?p=linbox.git;a=blob;f=linbox-gcc47.patch

@SnarkBoojum
Copy link
Mannequin

SnarkBoojum mannequin commented May 13, 2012

comment:9

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.

@SnarkBoojum
Copy link
Mannequin

SnarkBoojum mannequin commented May 13, 2012

comment:10

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

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

@SnarkBoojum
Copy link
Mannequin

SnarkBoojum mannequin commented May 14, 2012

comment:11

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

@jdemeyer jdemeyer modified the milestones: sage-5.0, sage-5.1 May 16, 2012
@jdemeyer
Copy link

comment:13

In

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

You should check for GCC first.

@SnarkBoojum
Copy link
Mannequin

SnarkBoojum mannequin commented May 25, 2012

comment:14

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

@jdemeyer

This comment has been minimized.

@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link

Reviewer: Jeroen Demeyer

@jdemeyer
Copy link

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

@jdemeyer
Copy link

comment:17

Attachment: linbox-1.1.6.p10.diff.gz

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

New spkg needs review.

@jdemeyer
Copy link

Changed keywords from C++11 GCC 4.7.0 CXXFLAGS -fpermissive spkg spkg-check to C++11 GCC 4.7.0 CXXFLAGS -fpermissive spkg spkg-check sd40.5

@kcrisman
Copy link
Member

Changed reviewer from Jeroen Demeyer to Jeroen Demeyer, Karl-Dieter Crisman

@kcrisman
Copy link
Member

comment:19

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.

@kcrisman
Copy link
Member

comment:20

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

@jdemeyer
Copy link

jdemeyer commented Jun 2, 2012

Merged: sage-5.0.1.rc1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants