Opened 9 years ago

Closed 7 years ago

Last modified 7 years ago

#8783 closed defect (duplicate)

frobby optional spkg doesn't build with newer GCC's

Reported by: was Owned by: tbd
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: packages: optional Keywords: sd32
Cc: Merged in:
Authors: Reviewers: Benjamin Jones, Bjarke Hammersholt Roune
Report Upstream: Fixed upstream, in a later stable release. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by leif)

frobby-0.7.6/src/test/transform/t3.gen.m2
frobby-0.7.6/src/test/transform/t3.gen.nm
Finished extraction
****************************************************
Host system
uname -a:
Linux eno 2.6.32.10-90.fc12.x86_64 #1 SMP Tue Mar 23 09:47:08 UTC 2010
x86_64 x86_64 x86_64 GNU/Linux
****************************************************
****************************************************
CC Version
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc-4.5.0/x86_64-Linux-
core2-fc/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /usr/local/gcc-4.5.0/src/gcc-4.5.0/configure --enable-
languages=c,c++,fortran --with-gnu-as --with-gnu-
as=/usr/local/binutils-2.20.1/x86_64-Linux-core2-fc-gcc-4.4.3-rh/bin/as
--with-gnu-ld --with-ld=/usr/local/binutils-2.20.1/x86_64-Linux-core2-fc-
gcc-4.4.3-rh/bin/ld --with-gmp=/usr/local/mpir-1.2.2/x86_64-Linux-core2
-fc-gcc-4.4.2 --with-mpfr=/usr/local/mpfr-2.4.2/x86_64-Linux-core2-fc-
mpir-1.2.2-gcc-4.4.2 --with-mpc=/usr/local/mpc-0.8.1/x86_64-Linux-core2
-fc-mpfr-2.4.2-mpir-1.2.2-gcc-4.4.3-rh
--prefix=/usr/local/gcc-4.5.0/x86_64-Linux-core2-fc
Thread model: posix
gcc version 4.5.0 (GCC)
****************************************************
mkdir -p bin/release/
g++ -Wall -ansi -pedantic -Wextra -Wno-uninitialized -Wno-unused-
parameter -Werror -isystem /home/wstein/screen/eno/sage-4.3/local/include
-O3 -c src/main.cpp -o bin/release/main.o
src/main.cpp: In function ‘int main(int, const char**)’:
src/main.cpp:30:16: error: ‘srand’ was not declared in this scope
make: *** [bin/release/main.o] Error 1
Error building Frobby.

real    0m0.614s
user    0m0.283s
sys     0m0.052s
sage: An error occurred while installing frobby-0.7.6
Please email sage-devel http://groups.google.com/group/sag

New optional spkg: http://sage.math.washington.edu/home/bjarke/frobby-0.7.6.p1.spkg


The spkg has to be brought into place to "merge" it.

Attachments (2)

frobby-0.7.6.p1-redhawk-SAGE_CHECK.log (129.6 KB) - added by leif 8 years ago.
Build with SAGE_CHECK=yes on Ubuntu 10.04, GCC 4.3.3
frobby_build_4.7.2.alpha1.eno.log (32.2 KB) - added by benjaminfjones 8 years ago.
frobby build log with SAGE_CHECK=yes on skynet/eno

Download all attachments as: .zip

Change History (28)

comment:1 Changed 9 years ago by was

  • Report Upstream changed from N/A to Reported upstream. Little or no feedback.

comment:2 Changed 9 years ago by was

Note that this still builds on sage.math with GCC-4.2.4... But it doesn't build on Skynet with newer GCC's.

comment:3 Changed 9 years ago by was

  • Report Upstream changed from Reported upstream. Little or no feedback. to Fixed upstream, in a later stable release.
Hi William,

Yes, it is just a question of a few extra includes. I haven't fixed it
since I was making a new release of Frobby anyway. That new release
has become rather large since that has been convenient for my
research, and so it is taking longer than expected. I'll submit a fix
once I get back from this conference next week.

Cheers
Bjarke

comment:4 Changed 9 years ago by was

The error in the ticket mentions srand. What I do is google srand and I get e.g.

 http://www.cplusplus.com/reference/clibrary/cstdlib/srand/

it says it is in cstdlib, so add

 #include <cstdlib>

to the cpp file that is having a problem. Then likely another file
will have the same problem due to the same or another missing header,
and after a few iterations of this the problem should be solved. Most
likely all the missing includes are in cpp files, though it is
possible that a header might miss something too. The problem is caused
by older versions of GCC having header A also pull in header B without
the standard saying that it should do so (which is allowed but
unfortunate). The newer version of header A in a newer GCC then stops
pulling in header B, and suddenly it becomes apparent that header B
should have been included where A was also included, but before it was
invisible that this should have happened.

Cheers
Bjarke

comment:5 Changed 9 years ago by drkirkby

Note, gcc 4.5 is not the latest gcc, but gcc 4.4.4 is: See

http://gcc.gnu.org/

News

April 29, 2010
    GCC 4.4.4 has been released.
April 14, 2010
    GCC 4.5.0 has been released.

Dave

comment:6 follow-up: Changed 9 years ago by was

Even with gcc-4.4.3, Frobby doesn't build.

If somebody doesn't post a new frobby spkg on this ticket for review this week, I'm moving the frobby spkg to "experimental".

-- William

comment:7 in reply to: ↑ 6 Changed 9 years ago by drkirkby

Replying to was:

Even with gcc-4.4.3, Frobby doesn't build.

If somebody doesn't post a new frobby spkg on this ticket for review this week, I'm moving the frobby spkg to "experimental".

-- William

I wish you would clarify in the developers handbook, or even just on sage-devel, what is the difference between "optional" and "experimental".

Dave

comment:8 Changed 9 years ago by was

I have moved Frobby from optional to experimental. I'll move it back when this problem is addressed.

http://sagemath.org/packages/optional/

http://sagemath.org/packages/experimental/

comment:9 Changed 9 years ago by broune

  • Status changed from new to needs_review

I've had some problems on this because I don't have access to a computer that both has Sage on it and that at the same time has a recent enough version of GCC that this issue comes up. What I've done is patch the spkg so that the Frobby code in it compiles on a Cygwin machine I've got, and then I've tested that it still installs on sage.math, which I've recently gotten access to. So if we are lucky this will work, though someone with both Sage and a recent version of gcc should check it. I put the spkg here:

http://sage.math.washington.edu/home/bjarke/frobby-0.7.6.p1.spkg

comment:10 Changed 9 years ago by was

  • Status changed from needs_review to needs_work

I looked at this for 1 minute:

(1) There are some tmp ~ files laying around

wstein@sage:~/tmp/frobby-0.7.6.p1$ ls
patches  spkg-check  spkg-install  spkg-install~  SPKG.txt  SPKG.txt~  src
wstein@sage:~/tmp/frobby-0.7.6.p1$ rm *~

(2) The hg repo has lots of files that have been added but not checked in:

wstein@sage:~/tmp/frobby-0.7.6.p1$ ls
patches  spkg-check  spkg-install  SPKG.txt  src
wstein@sage:~/tmp/frobby-0.7.6.p1$ hg status
M SPKG.txt
M spkg-install
A patches/Makefile
A patches/Makefile.patch
A patches/src/Action.cpp
A patches/src/Action.cpp.patch
A patches/src/BoolParameter.cpp
A patches/src/BoolParameter.cpp.patch
A patches/src/Ideal.h
A patches/src/Ideal.h.patch
A patches/src/IntegerParameter.cpp
A patches/src/IntegerParameter.cpp.patch
A patches/src/Minimizer.cpp
A patches/src/Minimizer.cpp.patch
A patches/src/Parameter.cpp
A patches/src/Parameter.cpp.patch
A patches/src/ParameterGroup.cpp
A patches/src/ParameterGroup.cpp.patch
A patches/src/Scanner.cpp
A patches/src/Scanner.cpp.patch
A patches/src/VarNames.cpp
A patches/src/VarNames.cpp.patch
A patches/src/dynamicFrobeniusAlgorithm.cpp
A patches/src/dynamicFrobeniusAlgorithm.cpp.patch
A patches/src/frobbyTest.cpp
A patches/src/frobbyTest.cpp.patch
A patches/src/main.cpp
A patches/src/main.cpp.patch
A patches/src/randomDataGenerators.cpp
A patches/src/randomDataGenerators.cpp.patch
wstein@sage:~/tmp/frobby-0.7.6.p1$ 

(3) I don't understand why *upstream* -- i.e., the *author* of frobby-- is adding a ton of patches to his own code. Why not just fix the src/ directly?

comment:11 Changed 9 years ago by was

That said, Frobby *does* build with GCC-4.5.0, which is great news!!

if [ -f bin/release/frobby.exe ]; then \
          mv -f bin/release/frobby.exe bin/release/frobby; \
        fi
strip bin/release/frobby
cd bin; rm -f frobby; link ../bin/release/frobby frobby; cd ..

real    0m47.042s
user    0m40.332s
sys     0m4.577s
Successfully installed frobby-0.7.6.p1
Now cleaning up tmp files.
Making Sage/Python scripts relocatable...
Making script relocatable
Finished installing frobby-0.7.6.p1.spkg
[wstein@eno sage-4.4.4]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc-4.5.0/x86_64-Linux-core2-fc/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /usr/local/gcc-4.5.0/src/gcc-4.5.0/configure --enable-languages=c,c++,fortran --with-gnu-as --with-gnu-as=/usr/local/binutils-2.20.1/x86_64-Linux-core2-fc-gcc-4.4.3-rh/bin/as --with-gnu-ld --with-ld=/usr/local/binutils-2.20.1/x86_64-Linux-core2-fc-gcc-4.4.3-rh/bin/ld --with-gmp=/usr/local/mpir-1.2.2/x86_64-Linux-core2-fc-gcc-4.4.2 --with-mpfr=/usr/local/mpfr-2.4.2/x86_64-Linux-core2-fc-mpir-1.2.2-gcc-4.4.2 --with-mpc=/usr/local/mpc-0.8.1/x86_64-Linux-core2-fc-mpfr-2.4.2-mpir-1.2.2-gcc-4.4.3-rh --prefix=/usr/local/gcc-4.5.0/x86_64-Linux-core2-fc
Thread model: posix
gcc version 4.5.0 (GCC) 
[wstein@eno sage-4.4.4]$ 

comment:12 Changed 9 years ago by broune

  • Description modified (diff)
  • Status changed from needs_work to needs_review

comment:13 Changed 9 years ago by broune

  • Description modified (diff)

(Oops, I put my response as the description. Now fixed.)

Thanks for the prompt review. I committed the outstanding files in the repository and removed the two ~ files. The result is up in the same place:

http://sage.math.washington.edu/home/bjarke/frobby-0.7.6.p1.spkg

I'm adding patches rather than edit src/ because as I understand it the code in src/ must be an official release of the upstream code. No version 0.7.6 of Frobby exists that compiles under gcc 4.3.0, and I'd rather add some patches here than make an official release of an old version.

comment:14 Changed 8 years ago by benjaminfjones

  • Reviewers set to Benjamin Jones

I can verify that the ~ files were removed and the repository is clean. The SPKG successfully builds using GCC 4.4.5. I'm trying GCC 4.5.? now.

comment:15 Changed 8 years ago by benjaminfjones

The SPKG builds using GCC 4.6.1 as well. Here is the build log: https://gist.github.com/1164148

Unless anyone has further comments / concerns, I will give the new SPKG a positive review.

comment:16 Changed 8 years ago by benjaminfjones

  • Status changed from needs_review to positive_review

comment:17 Changed 8 years ago by jdemeyer

  • Authors set to Bjarke Hammersholt Roune
  • Description modified (diff)

comment:18 Changed 8 years ago by was

  • Keywords sd32 added

comment:19 Changed 8 years ago by leif

  • Description modified (diff)

comment:20 Changed 8 years ago by leif

  • Status changed from positive_review to needs_info

Did anybody try to build this with SAGE_CHECK=yes?

I get hundreds of errors on Ubuntu 10.04.3 (GCC 4.4.3). The build itself succeeds, but the test suite ends with:

src/randomDataGenerators.cpp:44: error: ‘mpz_class’ was not declared in this scope
src/randomDataGenerators.cpp:47: error: ‘stderr’ was not declared in this scope
src/randomDataGenerators.cpp:47: error: ‘fputs’ was not declared in this scope
src/IOHandler.cpp: At global scope:
src/IOHandler.cpp:215: error: ‘mpz_class’ was not declared in this scope
src/IOHandler.cpp:215: error: template argument 1 is invalid
src/IOHandler.cpp:215: error: template argument 2 is invalid
src/IOHandler.cpp: In function ‘void readFrobeniusInstance(Scanner&, int&)’:
src/IOHandler.cpp:216: error: request for member ‘clear’ in ‘numbers’, which is of non-class type ‘int’
src/IOHandler.cpp:219: error: ‘mpz_class’ was not declared in this scope
src/IOHandler.cpp:219: error: expected ‘;’ before ‘n’
src/IOHandler.cpp:221: error: ‘n’ was not declared in this scope
src/IOHandler.cpp:225: error: ‘stderr’ was not declared in this scope
src/IOHandler.cpp:228: error: ‘gmp_fprintf’ was not declared in this scope
src/IOHandler.cpp:232: error: request for member ‘push_back’ in ‘numbers’, which is of non-class type ‘int’
src/IOHandler.cpp:235: error: request for member ‘empty’ in ‘numbers’, which is of non-class type ‘int’
src/IOHandler.cpp:237: error: ‘stderr’ was not declared in this scope
src/IOHandler.cpp:237: error: ‘fputs’ was not declared in this scope
src/IOHandler.cpp:241: error: expected ‘;’ before ‘gcd’
src/IOHandler.cpp:242: error: request for member ‘size’ in ‘numbers’, which is of non-class type ‘int’
src/IOHandler.cpp:243: error: request for member ‘get_mpz_t’ in ‘gcd’, which is of non-class type ‘void(Exponent*, const Exponent*, const Exponent*, size_t)’
src/IOHandler.cpp:243: error: request for member ‘get_mpz_t’ in ‘gcd’, which is of non-class type ‘void(Exponent*, const Exponent*, const Exponent*, size_t)’
src/IOHandler.cpp:243: error: invalid types ‘int[size_t]’ for array subscript
src/IOHandler.cpp:243: error: ‘mpz_gcd’ was not declared in this scope
src/IOHandler.cpp:245: error: ISO C++ forbids comparison between pointer and integer
src/IOHandler.cpp:246: error: ‘stderr’ was not declared in this scope
src/IOHandler.cpp:249: error: request for member ‘get_mpz_t’ in ‘gcd’, which is of non-class type ‘void(Exponent*, const Exponent*, const Exponent*, size_t)’
src/IOHandler.cpp:249: error: ‘gmp_fprintf’ was not declared in this scope
src/randomDataGenerators.cpp: At global scope:
src/randomDataGenerators.cpp:157: error: ‘Degree’ was not declared in this scope
src/randomDataGenerators.cpp:157: error: template argument 1 is invalid
src/randomDataGenerators.cpp:157: error: template argument 2 is invalid
src/randomDataGenerators.cpp: In function ‘void generateRandomFrobeniusInstance(int&)’:
src/randomDataGenerators.cpp:161: error: request for member ‘resize’ in ‘degrees’, which is of non-class type ‘int’
src/randomDataGenerators.cpp:163: error: ‘Degree’ was not declared in this scope
src/randomDataGenerators.cpp:163: error: expected ‘;’ before ‘totalGcd’
src/randomDataGenerators.cpp:165: error: expected ‘;’ before ‘number’
src/randomDataGenerators.cpp:166: error: ‘totalGcd’ was not declared in this scope
src/randomDataGenerators.cpp:167: error: ‘number’ was not declared in this scope
src/randomDataGenerators.cpp:171: error: ‘number’ was not declared in this scope
src/randomDataGenerators.cpp:171: error: ‘mpz_gcd’ was not declared in this scope
src/randomDataGenerators.cpp:173: error: invalid types ‘int[int]’ for array subscript
src/randomDataGenerators.cpp:173: error: ‘number’ was not declared in this scope
src/randomDataGenerators.cpp:177: error: invalid types ‘int[int]’ for array subscript
src/randomDataGenerators.cpp:178: error: ‘totalGcd’ was not declared in this scope
src/randomDataGenerators.cpp:180: error: request for member ‘begin’ in ‘degrees’, which is of non-class type ‘int’
src/randomDataGenerators.cpp:180: error: request for member ‘end’ in ‘degrees’, which is of non-class type ‘int’
make: *** [bin/debug/IOHandler.o] Error 1
make: *** [bin/debug/BigIdeal.o] Error 1
make: *** [bin/debug/randomDataGenerators.o] Error 1
mkdir -p bin/release/ 
cd bin; rm -f frobby; link ../bin/release/frobby frobby; cd ..
export frobby=bin/frobby; ./test/runtests
decom      ..........................
frob       ..............................
intersect  ..........
assoprimes ............
minimize   ..........
transform  .....
latformat  .....
alexdual   ...............
radical    .........
Now cleaning up tmp files.
Making Sage/Python scripts relocatable...
Making script relocatable
Finished installing frobby-0.7.6.p1.spkg

The main problem seems a wrong or missing include path, which of course causes further errors.

Changed 8 years ago by leif

Build with SAGE_CHECK=yes on Ubuntu 10.04, GCC 4.3.3

comment:21 Changed 8 years ago by leif

Ooops, should read 4.4.3, but the version shouldn't matter much anyway... ;-)

(Attached the build log.)

comment:22 Changed 8 years ago by benjaminfjones

I didn't run the build with SAGE_CHECK=yes when I reviewed the package, but I did run the test suite manually. This was on skynet/eno which has GCC 4.6.1 installed.

I just ran the build under Sage 4.7.2.alpha1 on skynet/eno using export SAGE_CHECK=yes; ./sage -f frobby-0.7.6.p1.spkg and both the build and the test suite finish without errors. I'll attach the build log.

Changed 8 years ago by benjaminfjones

frobby build log with SAGE_CHECK=yes on skynet/eno

comment:23 Changed 7 years ago by swenson

Ping.

comment:24 Changed 7 years ago by benjaminfjones

  • Milestone changed from sage-5.1 to sage-duplicate/invalid/wontfix

Closing as a duplicate in light of #13007.

comment:25 Changed 7 years ago by jdemeyer

  • Resolution set to duplicate
  • Status changed from needs_info to closed

comment:26 Changed 7 years ago by jdemeyer

  • Authors Bjarke Hammersholt Roune deleted
  • Reviewers changed from Benjamin Jones to Benjamin Jones, Bjarke Hammersholt Roune
Note: See TracTickets for help on using tickets.