Opened 10 years ago

Closed 10 years ago

#11083 closed defect (fixed)

PolyBoRi fails to build on OpenSolaris with gcc-4.6.0

Reported by: drkirkby Owned by: drkirkby
Priority: blocker Milestone: sage-4.7
Component: porting: Solaris Keywords:
Cc: AlexanderDreyer, PolyBoRi Merged in: sage-4.7.alpha4
Authors: Alexander Dreyer Reviewers: David Kirkby
Report Upstream: Completely fixed; Fix reported upstream Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by jdemeyer)

When compiling with gcc, PolyBoRi generates position independent code because of the compiler flag -fPIC. It does this on Solaris, and I expect Linux and OS X too.

However, on Solaris PolyBoRi also generates the compiler flag "-KPIC" which is the flag used by Sun (now Oracle) compilers to generate position independent code. GCC has always ignored this flag. However, the latest gcc does not, and considers this an error.

g++ -o Cudd/obj/cuddObj.pic.o -c -O3 -Wno-long-long -Wreturn-type -g -fPIC -ftemplate-depth-100 -O3 -Wno-long-long -Wreturn-type -g -fPIC -KPIC -DNDEBUG -DHAVE_GD -DHAVE_TR1_UNORDERED_MAP -DPACKED -DHAVE_M4RI -DHAVE_GD -DHAVE_IEEE_754 -DBSD -I/export/home/drkirkby/sage-new-gcc/sage-4.7.alpha2/local/include -I/export/home/drkirkby/sage-new-gcc/sage-4.7.alpha2/local/include/python2.6 -Ipolybori/include -ICudd/obj -ICudd/util -ICudd/cudd -ICudd/mtr -ICudd/st -ICudd/epd Cudd/obj/cuddObj.cc
g++: error: unrecognized option '-KPIC'
scons: *** [Cudd/obj/cuddObj.pic.o] Error 1
scons: building terminated because of errors.
Error building PolyBoRi.

I found this on OpenSolaris, but I'm 99% sure the same would happen on Solaris, since I know the option "-KPIC" has always been there on both systems.

I'm cc'ing the PolyBoRi developers.

Summary

Change History (21)

comment:1 Changed 10 years ago by drkirkby

  • Summary changed from PolyBoRi fails to build on Solaris with gcc-4.6.0 to PolyBoRi fails to build on OpenSolaris with gcc-4.6.0

I've sent a note to polybori-discuss@lists.sourceforge.net outlining the problem a few minutes ago.

comment:2 follow-up: Changed 10 years ago by AlexanderDreyer

Thanks for pointing this out. Since the gcc-installation of t2 seems to be broken. Is there any machine around, where I can get access to?

comment:3 Changed 10 years ago by AlexanderDreyer

Meanwhile. please try out this hack:

diff -r 7bb357180e7b SConstruct
--- a/SConstruct        Sun Mar 13 22:34:17 2011 +0100
+++ b/SConstruct        Wed Mar 30 10:05:01 2011 +0200
@@ -276,6 +276,9 @@


 env = Environment(ENV = getenv, options = opts, tools = tools, toolpath = '.')
+if (env['PLATFORM'] == "sunos") and ('gcc' in env['TOOLS']):
+    if '-KPIC' in  env['SHCCFLAGS']:
+      env['SHCCFLAGS'].remove('-KPIC')

 if 'dump' in COMMAND_LINE_TARGETS:
   print env.Dump()

If the problem persists, please add replace scons by scons dump and post the output.

My best,

Alexander

comment:4 in reply to: ↑ 2 ; follow-up: Changed 10 years ago by drkirkby

Replying to AlexanderDreyer:

Thanks for pointing this out. Since the gcc-installation of t2 seems to be broken. Is there any machine around, where I can get access to?

gcc on t2.math works fine. William did break it, but I fixed ages ago. t2.math is regularly used to build Sage with the buildbot. It was last built successufully on 20th March - only 10 days ago.

http://build.sagemath.org/sage/buildslaves/t2-1

I just put a note in /etc/motd to add this to ones $HOME/.profile

. /usr/local/bin/t2-setup

However, there is currently no gcc-4.6.0 on there, but it should be possible to see if the patch removes the -KPIC option.

Do you want an account on my Sun Ultra 27? That runs OpenSolaris, not Solaris and is x86 not SPARC.

Although there are some differences, most things are the same. The advantage of that machine is that it is much faster than t2.math. You can build Sage and run all the long doctests in little over an hour if the machine is idle.

comment:5 in reply to: ↑ 4 Changed 10 years ago by AlexanderDreyer

I just put a note in /etc/motd to add this to ones $HOME/.profile

. /usr/local/bin/t2-setup

Thanks, I didn't know that. Is there a 4.7alpha2 build somewhere?

However, there is currently no gcc-4.6.0 on there, but it should be possible to see if the patch removes the -KPIC option.

Do you want an account on my Sun Ultra 27? That runs OpenSolaris, not Solaris and is x86 not SPARC.

This would be nice, I'll contact you off-Trac

My best

Alexander

comment:6 Changed 10 years ago by AlexanderDreyer

  • Report Upstream changed from Reported upstream. Little or no feedback. to Completely fixed; Fix reported upstream
  • Status changed from new to needs_review

It seems, I finally found out where this -KPIC comes in and managed to fix it. See the updated spkg here: http://sage.math.washington.edu/home/dreyer/spkg/polybori-0.7.0.p2.spkg

My best,

Alexander

comment:7 Changed 10 years ago by AlexanderDreyer

  • Description modified (diff)

comment:8 Changed 10 years ago by drkirkby

  • Authors set to Alexander Dreyer
  • Reviewers set to David Kirkby
  • Status changed from needs_review to positive_review

Thank you. That has solved it.

comment:9 Changed 10 years ago by jdemeyer

  • Merged in set to sage-4.7.alpha4
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:10 Changed 10 years ago by jdemeyer

  • Resolution fixed deleted
  • Status changed from closed to new

comment:11 Changed 10 years ago by jdemeyer

  • Priority changed from major to blocker

comment:12 Changed 10 years ago by AlexanderDreyer

Does this mean that it fails again?

comment:13 Changed 10 years ago by AlexanderDreyer

Or should does one needs to rebundle the spkg?

comment:14 Changed 10 years ago by jdemeyer

  • Status changed from new to needs_info

Only the file SPKG.txt in the spkg should be changed. This ticket should be documented in the spkg, that's it.

comment:15 Changed 10 years ago by jdemeyer

  • Status changed from needs_info to needs_review

comment:16 Changed 10 years ago by jdemeyer

  • Status changed from needs_review to needs_work

comment:17 Changed 10 years ago by AlexanderDreyer

  • Status changed from needs_work to needs_review

comment:18 Changed 10 years ago by jdemeyer

  • Description modified (diff)

comment:19 Changed 10 years ago by drkirkby

That looks fine

real	3m44.578s
user	3m21.196s
sys	0m16.574s
Successfully installed polybori-0.7.0.p2

Positive review.

comment:20 Changed 10 years ago by drkirkby

  • Status changed from needs_review to positive_review

comment:21 Changed 10 years ago by jdemeyer

  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.