Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#9657 closed defect (fixed)

cvxopt 0.9 does not compile on Solaris with gcc 4.5 or later.

Reported by: drkirkby Owned by: drkirkby
Priority: blocker Milestone: sage-4.5.2
Component: porting: Solaris Keywords:
Cc: jhpalmieri, dimpase, jsp, mpatel Merged in: sage-4.5.2.rc1
Authors: David Kirkby Reviewers: John Palmieri
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by drkirkby)

There's a problem with cvxopt not building on gcc versions 4.5.0 or later. This has become especially critical lately, as only gcc 4.5.0 is available on Skynet, so this effectively means Sage can not be built on any Skynet computer running Solaris (mark, mark2 or fulvia)

Here's an example with OpenSolaris with gcc 4.5.0, though the same problem occurs on Solaris 10 SPARC and Solaris 10 x86.

drkirkby@hawk:~/sage-4.5.1$ ./sage -f cvxopt-0.9.p8

<snip>

gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -O3 -m64 -Wall -Wstrict-prototypes -fPIC -I/export/home/drkirkby/sage-4.5.1/local/include/python2.6 -c C/base.c -o build/temp.solaris-2.11-i86pc-2.6/C/base.o
In file included from C/cvxopt.h:30:0,
                 from C/base.c:23:
C/sun_complex.h:9:0: warning: ignoring #pragma ident 
C/sun_complex.h:30:32: error: expected identifier or '(' before '_Imaginary'
error: command 'gcc' failed with exit status 1

real	0m0.131s
user	0m0.080s
sys	0m0.042s
sage: An error occurred while installing cvxopt-0.9.p8

This is ultimately due to _Complex_I and I being undefined.

The correct definitions were taken from the complex.h header file which was fixed by gcc's fixincludes program.

With this change, cvxopt builds properly

running install_egg_info
Removing /export/home/drkirkby/sage-4.5.1/local/lib/python2.6/site-packages/cvxopt-0.9-py2.6.egg-info
Writing /export/home/drkirkby/sage-4.5.1/local/lib/python2.6/site-packages/cvxopt-0.9-py2.6.egg-info

real	0m45.306s
user	0m40.395s
sys	0m3.786s
Successfully installed cvxopt-0.9.p9
Now cleaning up tmp files.
rm: Cannot remove any directory in the path of the current working directory
/export/home/drkirkby/sage-4.5.1/spkg/build/cvxopt-0.9.p9
Making Sage/Python scripts relocatable...
Making script relocatable

The patch has been tested with:

  • gcc 4.2.4 on a Linux server (sage.math). The patch will not be applied there, but it was worth just verifying that.
  • gcc 4.4.4 on a Sun Ultra 27 running OpenSolaris 06/2009 (64-bit build)
  • gcc 4.5.0 on a Sun Ultra 27 running OpenSolaris 06/2009 (64-bit build)
  • gcc 3.4.3 on a Sun Blade 1000 running Solaris 10 03/2005 (32-bit build). Sage will not build with a gcc this old, but cvxopt built ok.
  • gcc 4.5.0 on a Sun Blade 1000 running Solaris 10 03/2005 (32-bit build)
  • gcc 4.4.1 on a Sun T5240 (t2.math) running Solaris 10 05/2009

On all systems, cvxopt built properly. The patch is only applied on Solaris, so is very safe.

Attachments (1)

9657.patch (2.9 KB) - added by drkirkby 9 years ago.
Mercurial patch to allow cvxopt to build with gcc 4.5.0 and later

Download all attachments as: .zip

Change History (17)

comment:1 Changed 9 years ago by drkirkby

  • Cc jhpalmieri dimpase jsp added

comment:2 Changed 9 years ago by drkirkby

  • Description modified (diff)

Changed 9 years ago by drkirkby

Mercurial patch to allow cvxopt to build with gcc 4.5.0 and later

comment:3 Changed 9 years ago by drkirkby

A copy of the package may be found here

http://boxen.math.washington.edu/home/kirkby/patches/cvxopt-0.9.p9.spkg

An update of cvxopt be made (#6456), that is waiting on a new upstream release, so it will not be practical, as this is critical but very small fix.

Dave

comment:4 Changed 9 years ago by drkirkby

  • Status changed from new to needs_review

comment:5 Changed 9 years ago by drkirkby

  • Authors set to David Kirkby

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

So the bug has been fixed in gcc 4.5.0, but not the "more recent" gcc versions 4.4.4 and 4.3.5? (I see you've tested the patch successfully with gcc 4.4.4 on OpenSolaris, and

        #if __GNUC__ < 4  || ( __GNUC__ == 4 && __GNUC_MINOR__ < 5   )

obviously holds for that version.)

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

Replying to leif:

So the bug has been fixed in gcc 4.5.0, but not the "more recent" gcc versions 4.4.4 and 4.3.5?

Yes, it has not been backported to the 4.3 or 4.4 series. Whether it ever will or not is another matter, but so far it has not.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42753

(I see you've tested the patch successfully with gcc 4.4.4 on OpenSolaris, and

        #if __GNUC__ < 4  || ( __GNUC__ == 4 && __GNUC_MINOR__ < 5   )

obviously holds for that version.)

I also tested on gcc 4.4.1 on 't2.math' - i.e. Solaris 10.

At http://trac.sagemath.org/sage_trac/ticket/6456#comment:85

I show the results from compiling a test program on a wide range (11 different bits of hardware) under about 25 different conditions (compiler versions). In each case, the bug is see in the 4.3 and 4.4 series, but not in 4.5.

Dave

comment:8 follow-up: Changed 9 years ago by leif

Ok, I was just wondering...

I think somebody more involved with SunOS should give this positive review though. ;-)

comment:9 in reply to: ↑ 8 ; follow-up: Changed 9 years ago by drkirkby

Replying to leif:

Ok, I was just wondering...

I think somebody more involved with SunOS should give this positive review though. ;-)

Perhaps John can try

http://boxen.math.washington.edu/home/kirkby/patches/cvxopt-0.9.p9.spkg

I could attach build logs if it would convince you more!

Dave

comment:10 Changed 9 years ago by jhpalmieri

I'm currently trying to build on mark, mark2, fulvia, and t2 (and also on a few non-solaris machines just to be safe, although I can't see how this patch would have any effect on those machines). I'm building sage-4.5.2.rc0 from scratch using this spkg, so it will take a while.

comment:11 in reply to: ↑ 9 Changed 9 years ago by leif

Replying to drkirkby:

I could attach build logs if it would convince you more!

It's not that I wasn't convinced this will work, but others are more competent here.

I see "workhorse John" is already at reviewing it... :)

comment:12 Changed 9 years ago by mpatel

  • Cc mpatel added

comment:13 Changed 9 years ago by jhpalmieri

  • Reviewers set to John Palmieri
  • Status changed from needs_review to positive_review

This builds successfully on t2, mark, mark2, and fulvia (both 32-bit and 64-bit, as far as I can tell). The patch clearly only makes a difference on Solaris machines.

comment:14 Changed 9 years ago by mpatel

  • Priority changed from critical to blocker

comment:15 Changed 9 years ago by mpatel

  • Merged in set to sage-4.5.2.rc0
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:16 Changed 9 years ago by mpatel

  • Merged in changed from sage-4.5.2.rc0 to sage-4.5.2.rc1
Note: See TracTickets for help on using tickets.