Ticket #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 | Work issues: | |
| Report Upstream: | Completely fixed; Fix reported upstream | Reviewers: | David Kirkby |
| Authors: | Alexander Dreyer | Merged in: | sage-4.7.alpha4 |
| Dependencies: | Stopgaps: |
Description (last modified by jdemeyer) (diff)
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
comment:1 Changed 2 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
comment:2 follow-up: ↓ 4 Changed 2 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 2 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: ↓ 5 Changed 2 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 2 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 2 years ago by AlexanderDreyer
- Status changed from new to needs_review
- Report Upstream changed from Reported upstream. Little or no feedback. to Completely fixed; Fix reported upstream
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:8 Changed 2 years ago by drkirkby
- Status changed from needs_review to positive_review
- Reviewers set to David Kirkby
- Authors set to Alexander Dreyer
Thank you. That has solved it.
comment:9 Changed 2 years ago by jdemeyer
- Status changed from positive_review to closed
- Resolution set to fixed
- Merged in set to sage-4.7.alpha4
comment:10 Changed 2 years ago by jdemeyer
- Status changed from closed to new
- Resolution fixed deleted
SPKG.txt needs to updated:
- backport http://trac.sagemath.org/sage_trac/raw-attachment/ticket/10797/polybori-SPKG.txt.diff
- mention this ticket
comment:12 Changed 2 years ago by AlexanderDreyer
Does this mean that it fails again?
comment:13 Changed 2 years ago by AlexanderDreyer
Or should does one needs to rebundle the spkg?
comment:14 Changed 2 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:17 Changed 2 years ago by AlexanderDreyer
- Status changed from needs_work to needs_review
Ok, I put it on the same location here;
http://sage.math.washington.edu/home/dreyer/spkg/polybori-0.7.0.p2.spkg
(the previous one is at http://sage.math.washington.edu/home/dreyer/spkg/polybori-0.7.0.p2.spkg.0)
comment:18 Changed 2 years ago by jdemeyer
- Description modified (diff)
I removed SPKG.txt~, new spkg: http://boxen.math.washington.edu/home/jdemeyer/spkg/polybori-0.7.0.p2.spkg
comment:19 Changed 2 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:21 Changed 2 years ago by jdemeyer
- Status changed from positive_review to closed
- Resolution set to fixed

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