Ticket #12754 (closed defect: duplicate)

Opened 14 months ago

Last modified 14 months ago

Fix scoping / name look-up issue in PolyBoRi 0.8.1 and support flags from the environment

Reported by: AlexanderDreyer Owned by: AlexanderDreyer
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: algebra Keywords:
Cc: leif, PolyBoRi, malb, burcin Work issues:
Report Upstream: Reported upstream. Little or no feedback. Reviewers: Alexander Dreyer, Leif Leonhardy, Martin Albrecht, Burcin Erocal
Authors: Merged in:
Dependencies: #12750 Stopgaps:

Description (last modified by AlexanderDreyer) (diff)

The following was found out here:  http://groups.google.com/group/sage-release/browse_thread/thread/e2a87c73dc1625f2

* PolyBoRi fails to build due to stricter (C++11) scoping / name look-up rules.
    Unfortunately PolyBoRi doesn't honor CXXFLAGS, so I had to use CXX="g++-4.7.0 -fpermissive" to make the spkg build. 

The scoping issue should be fixed here:  https://bitbucket.org/brickenstein/polybori/changeset/43b3931ceed7/raw/

Also, we should support CXXFLAGS and CFLAGS (ANd CPPFLAGS?) in the spkg.

We just have to merge the latest changes from polybori-0.8.0.p2 in #12750 :

This fixes building with GCC-4.7.0, see #12751 for the GCC-4.7.0 metaticket as well as building on Solaris and OpenSolaris, see #12655.

Current spkg

Change History

comment:1 Changed 14 months ago by AlexanderDreyer

  • Owner changed from AlexGhitza to AlexanderDreyer

comment:2 Changed 14 months ago by AlexanderDreyer

  • Description modified (diff)

comment:3 Changed 14 months ago by AlexanderDreyer

  • Status changed from new to needs_review

comment:4 Changed 14 months ago by AlexanderDreyer

  • Description modified (diff)

comment:5 Changed 14 months ago by jdemeyer

  • Reviewers changed from leif, PolyBoRi, malb, burcin to Leif Leonhardy, Martin Albrecht, Burcin Erocal
  • Dependencies set to #12750
  • Authors changed from AlexanderDreyer to Alexander Dreyer

comment:6 follow-ups: ↓ 7 ↓ 8 Changed 14 months ago by leif

  • Cc leif, PolyBoRi, malb, burcin added

So we now have the same spkgs at #12655 and here?

I've added #12655 as a dependency, as someoneTM should (independently) review the upgrade there, such that we here just have to review that the changes coming from #12750 are properly merged.

(Alternatively, we could just make #12655 depend on #12750, which already has positive review, and probably close this ticket as a duplicate of #12750.)


[Argh, concurrent editing, with a slow connection on my side btw. -- you now already changed the reviewers and added #12750 as a dependency...]

comment:7 in reply to: ↑ 6 Changed 14 months ago by AlexanderDreyer

Replying to leif:

(Alternatively, we could just make #12655 depend on #12750, which already has positive review, and probably close this ticket as a duplicate of #12750.)

I'd prefer this solution. What can do it? (Obviously I can't.)

comment:8 in reply to: ↑ 6 Changed 14 months ago by AlexanderDreyer

For convenience I put the diffs of patchsets here (they arise from merging #12750 into #12655):

  • diff-0.8.1.

    old new  
    1 diff -r f05b48d16bc7 -r 0ff1dee2843e SPKG.txt                                            
     1diff -r 82bcfd079628 -r 666438ae9200 SPKG.txt                                            
    22--- a/SPKG.txt Mon Mar 12 16:08:02 2012 +0100                                            
    3 +++ b/SPKG.txt Thu Mar 22 17:21:37 2012 +0100                                            
    4 @@ -36,6 +36,10 @@                                                                       
     3+++ b/SPKG.txt Mon Mar 26 23:47:06 2012 +0200                                            
     4@@ -36,8 +36,15 @@                                                                       
    55  * png/libpng12 (accomplished because Python and gd depend on it, too)                  
    66  * libz         (accomplished because e.g. libpng depends on it)                        
    77                                                                                         
     
    1111+                                                                                        
    1212 == Releases ==                                                                          
    1313                                                                                         
     14+=== polybori-0.8.1.p1 (Alexander Dreyer, March 26th, 2012) ===                          
     15+ * Rebased spkg on polybori-0.8.0.p2                                                    
     16+                                                                                        
    1417 === polybori-0.8.1.p0 (Alexander Dreyer, March 7th, 2012) ===                           
    15 diff -r f05b48d16bc7 -r 0ff1dee2843e custom.py                                           
     18  * Updating sources to PolyBoRi's release 0.8.1                                         
     19                                                                                         
     20diff -r 82bcfd079628 -r 666438ae9200 custom.py                                           
    1621--- /dev/null  Thu Jan 01 00:00:00 1970 +0000                                            
    17 +++ b/custom.py        Thu Mar 22 17:21:37 2012 +0100                                    
    18 @@ -0,0 +1,64 @@                                                                         
     22+++ b/custom.py        Mon Mar 26 23:47:06 2012 +0200                                    
     23@@ -0,0 +1,73 @@                                                                         
    1924+import os                                                                               
    2025+import sys                                                                              
    2126+                                                                                        
    2227+# FIXME: Do we really want to *overwrite* the flags (e.g. if set by the user)?          
    23 +CCFLAGS=["-O3 -Wno-long-long -Wreturn-type -g -fPIC"]                                   
    24 +#CXXFLAGS=CCFLAGS+["-ftemplate-depth-100 -g -fPIC"]                                     
    25 +CXXFLAGS=CCFLAGS+["-ftemplate-depth-100"]                                               
     28+# Answer: Should be fixed now.                                                          
     29+CCFLAGS += ["-Wno-long-long", "-Wreturn-type"]                                          
     30+                                                                                        
     31+# Note: PolyBoRi still appends DEFAULT_*FLAGS (overwrite those, if necessary)           
     32+if 'CFLAGS' in os.environ:                                                              
     33+  CFLAGS = os.environ['CFLAGS'].split(' ')                                              
     34+                                                                                        
     35+if 'CXXFLAGS' in os.environ:                                                            
     36+  CXXFLAGS = os.environ['CXXFLAGS'].split(' ')                                          
     37+                                                                                        
     38+if 'CPPFLAGS' in os.environ:                                                            
     39+  CCFLAGS = os.environ['CPPFLAGS'].split(' ')                                           
    2640+                                                                                        
    2741+GD_LIBS+=["png12","z"]                                                                  
    2842+                                                                                        
     
    8094+  CXX = os.environ['CXX']                                                               
    8195+except:                                                                                 
    8296+  pass                                                                                  
    83 diff -r f05b48d16bc7 -r 0ff1dee2843e patches/PyPolyBoRi.patch                            
     97diff -r 82bcfd079628 -r 666438ae9200 patches/PyPolyBoRi.patch                            
    8498--- a/patches/PyPolyBoRi.patch Mon Mar 12 16:08:02 2012 +0100                            
    8599+++ /dev/null  Thu Jan 01 00:00:00 1970 +0000                                            
    86100@@ -1,253 +0,0 @@                                                                        
     
    337351-+Polynomial = PolynomialFactory()                                                       
    338352-+Variable = VariableFactory()                                                           
    339353-                                                                                        
    340 diff -r f05b48d16bc7 -r 0ff1dee2843e patches/PyPolyBoRi.py                               
     354diff -r 82bcfd079628 -r 666438ae9200 patches/PyPolyBoRi.py                               
    341355--- a/patches/PyPolyBoRi.py    Mon Mar 12 16:08:02 2012 +0100                            
    342356+++ /dev/null  Thu Jan 01 00:00:00 1970 +0000                                            
    343357@@ -1,47 +0,0 @@                                                                         
     
    388402-Polynomial = PolynomialFactory()                                                        
    389403-Variable = VariableFactory()                                                            
    390404-                                                                                        
    391 diff -r f05b48d16bc7 -r 0ff1dee2843e patches/custom.py                                   
     405diff -r 82bcfd079628 -r 666438ae9200 patches/base_lookup.patch                           
     406--- a/patches/base_lookup.patch        Mon Mar 12 16:08:02 2012 +0100                    
     407+++ b/patches/base_lookup.patch        Mon Mar 26 23:47:06 2012 +0200                    
     408@@ -8,7 +8,7 @@                                                                          
     409 diff -r 617ce1a715329d16e5ebde0bfdde9c4d09072451 -r 43b3931ceed7b57c4c5385442de6ff45bd0f477c libpolybori/include/polybori/iterators/CTermStack.h                                                                                                               
     410 --- a/libpolybori/include/polybori/iterators/CTermStack.h     Mon Mar 19 22:53:46 2012 +0100                                   
     411 +++ b/libpolybori/include/polybori/iterators/CTermStack.h     Wed Mar 21 22:18:37 2012 +0100                                   
     412-@@ -853,7 +853,7 @@                                                                                                            
     413+@@ -854,7 +854,7 @@                                                                                                            
     414      PBORI_ASSERT(m_zero.isValid());                                                                                           
     415      PBORI_ASSERT(m_zero.isEmpty());                                                                                           
     416                                                                                                                                
     417diff -r 82bcfd079628 -r 666438ae9200 patches/custom.py                                                                          
    392418--- a/patches/custom.py        Mon Mar 12 16:08:02 2012 +0100                                                                   
    393419+++ /dev/null  Thu Jan 01 00:00:00 1970 +0000                                                                                   
    394 @@ -1,64 +0,0 @@                                                                                                                
     420@@ -1,75 +0,0 @@                                                                                                                
    395421-import os                                                                                                                      
    396422-import sys                                                                                                                     
    397423-                                                                                                                               
    398424-# FIXME: Do we really want to *overwrite* the flags (e.g. if set by the user)?                                                 
     425-# Note: there will be better ways in PolyBoRi 0.8.1                                                                            
    399426-CCFLAGS=["-O3 -Wno-long-long -Wreturn-type -g -fPIC"]                                                                          
    400427-#CXXFLAGS=CCFLAGS+["-ftemplate-depth-100 -g -fPIC"]                                                                            
    401428-CXXFLAGS=CCFLAGS+["-ftemplate-depth-100"]                                                                                      
     429-CFLAGS=["-std=c99"]                                                                                                            
     430-                                                                                                                               
     431-if 'CFLAGS' in os.environ:                                                                                                     
     432-  CFLAGS += os.environ['CFLAGS'].split(' ')                                                                                    
     433-                                                                                                                               
     434-if 'CXXFLAGS' in os.environ:                                                                                                   
     435-  CXXFLAGS += os.environ['CXXFLAGS'].split(' ')                                                                                
     436-                                                                                                                               
     437-if 'CPPFLAGS' in os.environ:                                                                                                   
     438-  CCFLAGS += os.environ['CPPFLAGS'].split(' ')                                                                                 
    402439-                                                                                                                               
    403440-GD_LIBS+=["png12","z"]                                                                                                         
    404441-                                                                                                                               
     
    456493-  CXX = os.environ['CXX']                                                                                                      
    457494-except:                                                                                                                        
    458495-  pass                                                                                                                         
    459 diff -r f05b48d16bc7 -r 0ff1dee2843e patches/gbcore.py.patch                                                                    
     496diff -r 82bcfd079628 -r 666438ae9200 patches/gbcore.py.patch                                                                    
    460497--- /dev/null  Thu Jan 01 00:00:00 1970 +0000                                                                                   
    461 +++ b/patches/gbcore.py.patch  Thu Mar 22 17:21:37 2012 +0100                                                                   
     498+++ b/patches/gbcore.py.patch  Mon Mar 26 23:47:06 2012 +0200                                                                   
    462499@@ -0,0 +1,33 @@                                                                                                                
    463500+# HG changeset patch                                                                                                           
    464501+# User Alexander Dreyer <adreyer@gmx.de>                                                                                       
     
    493530+     ocode=old_ring.get_order_code()                                                                                           
    494531+     try:                                                                                                                      
    495532+         new_ring = old_ring.clone(ordering=options["switch_to"])                                                              
    496 diff -r f05b48d16bc7 -r 0ff1dee2843e patches/ipbori.patch                                                                       
     533diff -r 82bcfd079628 -r 666438ae9200 patches/ipbori.patch                                                                       
    497534--- /dev/null  Thu Jan 01 00:00:00 1970 +0000                                                                                   
    498 +++ b/patches/ipbori.patch     Thu Mar 22 17:21:37 2012 +0100                                                                   
     535+++ b/patches/ipbori.patch     Mon Mar 26 23:47:06 2012 +0200                                                                   
    499536@@ -0,0 +1,24 @@                                                                                                                
    500537+# HG changeset patch                                                                                                           
    501538+# User Alexander Dreyer <adreyer@gmx.de>                                                                                       
     
    521558+     except:                                                                                                                   
    522559+         return False                                                                                                          
    523560+                                                                                                                               
    524 diff -r f05b48d16bc7 -r 0ff1dee2843e patches/nf.h.patch                                                                         
     561diff -r 82bcfd079628 -r 666438ae9200 patches/nf.h.patch                                                                         
    525562--- /dev/null  Thu Jan 01 00:00:00 1970 +0000                                                                                   
    526 +++ b/patches/nf.h.patch       Thu Mar 22 17:21:37 2012 +0100                                                                   
     563+++ b/patches/nf.h.patch       Mon Mar 26 23:47:06 2012 +0200                                                                   
    527564@@ -0,0 +1,19 @@                                                                                                                
    528565+# HG changeset patch                                                                                                           
    529566+# User Alexander Dreyer <adreyer@gmx.de>                                                                                       
     
    544581+ extern "C"{                                                                                                                   
    545582+ #include <m4ri/m4ri.h>                                                                                                        
    546583+                                                                                                                               
    547 diff -r f05b48d16bc7 -r 0ff1dee2843e spkg-install                                                                               
     584diff -r 82bcfd079628 -r 666438ae9200 spkg-install                                                                               
    548585--- a/spkg-install     Mon Mar 12 16:08:02 2012 +0100                                                                           
    549 +++ b/spkg-install     Thu Mar 22 17:21:37 2012 +0100                                                                           
    550 @@ -10,17 +10,30 @@                                                                                                             
     586+++ b/spkg-install     Mon Mar 26 23:47:06 2012 +0200                                                                           
     587@@ -10,21 +10,30 @@                                                                                                             
    551588 WORKDIR=${PWD}/src                                                                                                             
    552589 SCONS=scons                                                                                                                    
    553590                                                                                                                                
    554 -patch()                                                                                                                        
     591-prepare()                                                                                                                      
    555592+prepare_polybori()                                                                                                             
    556593 {                                                                                                                              
    557594     if [ $UNAME = "CYGWIN" ]; then                                                                                             
     
    561598-    cp patches/custom.py             src/${PBDIR}                                                                              
    562599-    cp patches/PyPolyBoRi.py         src/${PBDIR}/pyroot/polybori                                                              
    563600+    cd ${PBDIR}                                                                                                                
    564 +                                                                                                                               
     601                                                                                                                                
     602-    cd ${WORKDIR}/${PBDIR}                                                                                                     
     603-    patch -p1 < ../../patches/base_lookup.patch                                                                                
    565604+    # place configuration file                                                                                                 
    566605+    cp ../../custom.py .                                                                                                       
    567606+                                                                                                                               
     
    575614+        fi                                                                                                                     
    576615+    done 
    577616+ 
    578 +    cd ${WORKDIR} 
     617     cd ${WORKDIR} 
    579618 } 
    580619 
    581620- 
    582621 build_polybori() 
    583622 { 
    584623     cd ${PBDIR} 
    585 @@ -57,9 +70,9 @@ 
     624@@ -61,8 +70,9 @@ 
    586625     rm -rf ${SAGE_LOCAL}/include/cudd 
    587626 } 
    588627 
    589 -patch 
     628-prepare 
    590629+cd ${WORKDIR} 
    591630 
    592 -cd src 
    593631+prepare_polybori 
    594  
    595632 echo "Starting build..." 
    596633 
     634 echo "Removing old PolyBoRi install..." 

comment:9 Changed 14 months ago by jdemeyer

  • Status changed from needs_review to positive_review
  • Reviewers changed from Leif Leonhardy, Martin Albrecht, Burcin Erocal to Alexander Dreyer, Leif Leonhardy, Martin Albrecht, Burcin Erocal
  • Milestone changed from sage-5.0 to sage-duplicate/invalid/wontfix
  • Authors Alexander Dreyer deleted

Duplicate of #12750 and #12655.

comment:10 Changed 14 months ago by jdemeyer

  • Status changed from positive_review to closed
  • Resolution set to duplicate
  • Summary changed from Fix scoping / name look-up issue und PolyBoRi 0.8.1 and support flags from the envrionment to Fix scoping / name look-up issue in PolyBoRi 0.8.1 and support flags from the environment
Note: See TracTickets for help on using tickets.