[polybori] Ability to use the system CUDD restored thanks to upstream's help. More post-release bug fixes from

Jerry James jjames at fedoraproject.org
Fri Mar 23 16:40:16 UTC 2012


commit 2a0452b14bd70b4c897149f0a6a3557cd312f18f
Author: Jerry James <loganjerry at gmail.com>
Date:   Fri Mar 23 10:39:40 2012 -0600

    Ability to use the system CUDD restored thanks to upstream's help.
    More post-release bug fixes from upstream.

 polybori-gcc47.patch          |    8 +-
 polybori-system-cudd.patch    |  132 +++++++++++++++++++++++++++++++++++++++++
 polybori-upstream-fixes.patch |   52 ++++++++++++++++
 polybori-warning.patch        |   21 ++++++-
 polybori.spec                 |   33 +++++++----
 5 files changed, 229 insertions(+), 17 deletions(-)
---
diff --git a/polybori-gcc47.patch b/polybori-gcc47.patch
index 2fdec54..17798b7 100644
--- a/polybori-gcc47.patch
+++ b/polybori-gcc47.patch
@@ -1,22 +1,22 @@
 --- ./libpolybori/include/polybori/orderings/CBlockOrderingFacade.h.orig	2012-03-16 15:41:09.000000000 -0600
-+++ ./libpolybori/include/polybori/orderings/CBlockOrderingFacade.h	2012-03-19 14:45:20.712316696 -0600
++++ ./libpolybori/include/polybori/orderings/CBlockOrderingFacade.h	2012-03-22 13:22:48.604899984 -0600
 @@ -91,7 +91,7 @@ public:
      CacheManager<order_lead_tag> cache_mgr(poly.ring());
      typename base_type::descending_property descending;
  
 -    return monom(  dd_block_degree_lead(cache_mgr, blockDegCache, 
-+    return this->monom( dd_block_degree_lead(cache_mgr, blockDegCache, 
++    return base_type::monom(  dd_block_degree_lead(cache_mgr, blockDegCache, 
                                          poly.navigation(), m_indices.begin(),
                                          set_type(poly.ring()), descending) );
    }
 --- ./libpolybori/include/polybori/iterators/CTermStack.h.orig	2012-03-16 15:41:09.000000000 -0600
-+++ ./libpolybori/include/polybori/iterators/CTermStack.h	2012-03-19 14:45:20.712316696 -0600
++++ ./libpolybori/include/polybori/iterators/CTermStack.h	2012-03-22 13:22:18.420942750 -0600
 @@ -854,7 +854,7 @@ public:
      PBORI_ASSERT(m_zero.isValid());
      PBORI_ASSERT(m_zero.isEmpty());
  
 -    push(m_zero);
-+    this->push(m_zero);
++    base::push(m_zero);
    }
  
  private:
diff --git a/polybori-system-cudd.patch b/polybori-system-cudd.patch
new file mode 100644
index 0000000..e32cef0
--- /dev/null
+++ b/polybori-system-cudd.patch
@@ -0,0 +1,132 @@
+--- ./libpolybori/include/polybori/cudd/prefix.h.orig	2012-03-16 15:41:09.000000000 -0600
++++ ./libpolybori/include/polybori/cudd/prefix.h	2012-03-23 10:25:46.476000324 -0600
+@@ -21,6 +21,10 @@
+ #ifndef polybori_cudd_prefix_h_
+ #define polybori_cudd_prefix_h_
+ 
++#ifdef PBORI_USE_ORIGINAL_CUDD
++#define PBORI_PREFIX(name) name
++#else
+ #define PBORI_PREFIX(name) pbori_ ## name
++#endif
+ 
+ #endif
+--- ./libpolybori/include/polybori/cudd/prefix_internal.h.orig	2012-03-16 15:41:09.000000000 -0600
++++ ./libpolybori/include/polybori/cudd/prefix_internal.h	2012-03-23 10:25:46.477000303 -0600
+@@ -21,6 +21,7 @@
+ #ifndef polybori_cudd_prefix_internal_h_
+ #define polybori_cudd_prefix_internal_h_
+ 
++#ifndef PBORI_USE_ORIGINAL_CUDD
+ #define Cudd_IsNonConstant pbori_Cudd_IsNonConstant
+ #define Cudd_ReadStartTime pbori_Cudd_ReadStartTime
+ #define Cudd_SetStartTime pbori_Cudd_SetStartTime
+@@ -259,5 +260,6 @@
+ #define MMout_of_memory pbori_MMout_of_memory
+ 
+ #define DdManager pbori_DdManager
++#endif /* PBORI_USE_ORIGINAL_CUDD */
+ 
+ #endif /* polybori_cudd_prefix_internal_h_ */
+--- ./libpolybori/include/polybori/cudd/cuddInt.h.orig	2012-03-16 15:41:09.000000000 -0600
++++ ./libpolybori/include/polybori/cudd/cuddInt.h	2012-03-23 10:25:46.477000303 -0600
+@@ -17,6 +17,7 @@
+ #ifndef polybori_cudd_cuddInt_h_
+ #define polybori_cudd_cuddInt_h_
+ 
+-#include "../../../../Cudd/cudd/cuddInt.h"
++#include "polybori/cudd/prefix.h"
++#include <cudd/cuddInt.h>
+ 
+ #endif
+--- ./libpolybori/include/polybori/cudd/cudd.h.orig	2012-03-16 15:41:09.000000000 -0600
++++ ./libpolybori/include/polybori/cudd/cudd.h	2012-03-23 10:25:46.478000284 -0600
+@@ -17,6 +17,7 @@
+ #ifndef polybori_cudd_cudd_h_
+ #define polybori_cudd_cudd_h_
+ 
+-#include "../../../../Cudd/cudd/cudd.h"
++#include "polybori/cudd/prefix.h"
++#include <cudd/cudd.h>
+ 
+ #endif
+--- ./SConstruct.orig	2012-03-16 15:41:09.000000000 -0600
++++ ./SConstruct	2012-03-23 10:27:37.392998946 -0600
+@@ -829,18 +829,18 @@ BuildPyPBPath = PathJoiner(BuildPath(Ins
+ #env.Append(CPPDEFINES=["PBORI_HAVE_IEEE_754"])
+ 
+ 
+-cudd_headers = [ CuddPath('cudd/' + fname + '.h') for fname in Split("""
+-cuddInt cudd util""") ] + [PBInclPath('cudd/prefix' + fname + '.h')
++cudd_headers = [PBInclPath('cudd/cudd' + fname + '.h')
++for fname in ['', 'Int'] ] + [PBInclPath('cudd/prefix' + fname + '.h')
+                       for fname in ['', '_internal'] ]
+     
+-cudd_resources = [CuddPath('cudd/cudd' + elt) for elt in Split("""
+-API.c Cache.c Init.c LCache.c Ref.c Table.c ZddFuncs.c ZddSetop.c""") ]
++#cudd_resources = [CuddPath('cudd/cudd' + elt) for elt in Split("""
++#API.c Cache.c Init.c LCache.c Ref.c Table.c ZddFuncs.c ZddSetop.c""") ]
+ 
+-cudd_shared = shared_object(cudd_resources, CPPPATH = env['CPPPATH'] + [CuddPath()])
++#cudd_shared = shared_object(cudd_resources, CPPPATH = env['CPPPATH'] + [CuddPath()])
+ 
+ #libCudd = env.StaticLibrary(CuddPath(cudd_name), cudd_resources)
+ 
+-shared_resources += cudd_shared
++#shared_resources += cudd_shared
+ 
+ ###################
+ # End of Cudd stuff
+@@ -896,7 +896,7 @@ pb_src=[PBPath('src', source) for source
+ libpb_name = 'polybori'
+ libpb_name_static = libpb_name
+ 
+-libpb=env.StaticLibrary(PBPath(libpb_name_static), pb_src + cudd_resources)
++libpb=env.StaticLibrary(PBPath(libpb_name_static), pb_src) #+ cudd_resources)
+ 
+ if isinstance(libpb,list):
+     libpb=libpb[0]
+@@ -1158,9 +1158,9 @@ disttar.py doxygen.py""")
+         allsrcs.append(env.Dir(dirname))
+ 
+     # Cudd is not distributed completely (unused and unfree things removed)
+-    allsrcs += [CuddPath(src) for src in Split("""LICENSE README
+-    RELEASE.NOTES""") ]
+-    allsrcs += [env.Dir(CuddPath(src)) for src in Split("""cudd""") ]
++    #allsrcs += [CuddPath(src) for src in Split("""LICENSE README
++    #RELEASE.NOTES""") ]
++    #allsrcs += [env.Dir(CuddPath(src)) for src in Split("""cudd""") ]
+ 
+     # doc is not distributed completely
+     allsrcs += [ DocPath(dsrc) for dsrc in Split("""doxygen.conf index.html.in
+@@ -1452,8 +1452,8 @@ if HAVE_DOXYGEN:
+     documastersubdirs += " c++"
+ 
+ env.DocuMaster(DocPath('index.html'), [DocPath('index.html.in')] + [
+-    env.Dir(DocPath(srcs)) for srcs in Split(documastersubdirs) ] + [
+-    env.Dir('Cudd/cudd/doc')])  
++    env.Dir(DocPath(srcs)) for srcs in Split(documastersubdirs) ]) #+ [
++    #env.Dir('Cudd/cudd/doc')])  
+ 
+ pbrpmname = pboriname + '-' + pboriversion + "." + pborirelease 
+ 
+@@ -1609,8 +1609,8 @@ if 'install' in COMMAND_LINE_TARGETS:
+     env.Clean(pydocuinst, pydocuinst)
+ 
+     # Copy Cudd documentation
+-    CopyAll(InstDocPath('cudd'), 'Cudd/cudd/doc', env) 
+-    CopyAll(InstDocPath('cudd/icons'), 'Cudd/cudd/doc/icons', env)
++    #CopyAll(InstDocPath('cudd'), 'Cudd/cudd/doc', env) 
++    #CopyAll(InstDocPath('cudd/icons'), 'Cudd/cudd/doc/icons', env)
+ 
+     # Copy Tutorial
+     if have_l2h or have_t4h :
+@@ -1622,7 +1622,7 @@ if 'install' in COMMAND_LINE_TARGETS:
+     FinalizeNonExecs(env.DocuMaster(InstDocPath('index.html'),
+                                     [DocPath('index.html.in')] + [ 
+         env.Dir(InstDocPath(srcs)) for srcs in Split("""tutorial python
+-        c++ cudd""") ] ))
++        c++""") ] ))
+ 
+     # Non-executables to be installed
+     pyfile_srcs = glob(PyRootPath('polybori/*.py'))
diff --git a/polybori-upstream-fixes.patch b/polybori-upstream-fixes.patch
new file mode 100644
index 0000000..808df37
--- /dev/null
+++ b/polybori-upstream-fixes.patch
@@ -0,0 +1,52 @@
+--- ./groebner/include/polybori/groebner/nf.h.orig	2012-03-16 15:41:09.000000000 -0600
++++ ./groebner/include/polybori/groebner/nf.h	2012-03-22 16:24:08.781999576 -0600
+@@ -16,7 +16,7 @@
+ #include "groebner_alg.h"
+ 
+ 
+-#if PBORI_HAVE_M4RI
++#ifdef PBORI_HAVE_M4RI
+ extern "C"{
+ #include <m4ri/m4ri.h>
+ 
+--- ./pyroot/polybori/gbcore.py.orig	2012-03-16 15:41:09.000000000 -0600
++++ ./pyroot/polybori/gbcore.py	2012-03-22 16:26:52.347002401 -0600
+@@ -345,13 +345,21 @@ def variety_size_from_gb(I):
+     return sm.size_double()
+ 
+ def other_ordering_pre(I,option_set,kwds):
++    """
++    >>> from polybori.blocks import declare_ring
++    >>> r = declare_ring(['x0', 'x1', 'x2', 'x3', 'x4'], globals())
++    >>> id = [x1*x3 + x1 + x2*x3 + x3 + x4, x0*x3 + x0 + x1*x2 + x2 + 1, x1*x3 + x1*x4 + x3*x4 + x4 + 1, x0*x2 + x0*x4 + x1 + x3 + x4]
++    >>> groebner_basis(id)
++    [1]
++    
++    """
+     if not I:
+         return (I, None)
+ 
+     main_kwds=kwds
+     options=option_set
+ 
+-    old_ring=I[0].ring()
++    old_ring=iter(I).next().ring()
+     ocode=old_ring.get_order_code()
+     try:
+         new_ring = old_ring.clone(ordering=options["switch_to"])
+--- ./pyroot/polybori/plot.py.orig	2012-03-16 15:41:09.000000000 -0600
++++ ./pyroot/polybori/plot.py	2012-03-22 16:24:08.780999547 -0600
+@@ -24,8 +24,11 @@ def _exists():
+             return False
+ 
+     try:
+-        process = Popen(["dot", "-V"])
+-        process.close()               
++        from subprocess import Popen, PIPE
++        from os import devnull
++        out = open(devnull)
++        process = Popen(["dot", "-V"], stderr=out, stdout=out)
++        out.close()
+     except:                           
+         return False   
+ 
diff --git a/polybori-warning.patch b/polybori-warning.patch
index 0aa1b8e..bbb6ee1 100644
--- a/polybori-warning.patch
+++ b/polybori-warning.patch
@@ -1,5 +1,24 @@
+--- ./libpolybori/include/polybori/ring/CCuddInterface.h.orig	2012-03-16 15:41:09.000000000 -0600
++++ ./libpolybori/include/polybori/ring/CCuddInterface.h	2012-03-23 09:33:00.719998286 -0600
+@@ -286,13 +286,12 @@ public:
+   PB_CUDDMGR_SET(BOOST_PP_NIL, PBORI_PREFIX(Cudd_ReorderingType), AutodynEnableZdd)
+   PB_CUDDMGR_SET(BOOST_PP_NIL, unsigned long, SetMaxMemory)
+   PB_CUDDMGR_SET(BOOST_PP_NIL, double, SetMaxGrowth)
++  /** @endcode */
++  ///
++  //@}
+ #else
+   BOOST_PP_SEQ_FOR_EACH(PB_CUDDMGR_READ, int,(ReadZddSize))
+ #endif
+-  /** @endcode */
+-  /// 
+-  //@}
+-
+ 
+   node_ptr getVar(idx_type idx) const {
+     if PBORI_UNLIKELY(size_type(idx) >= m_vars.size())
 --- ./groebner/include/polybori/groebner/ExpLexLess.h.orig	2012-03-16 15:41:09.000000000 -0600
-+++ ./groebner/include/polybori/groebner/ExpLexLess.h	2012-03-19 14:44:32.532374477 -0600
++++ ./groebner/include/polybori/groebner/ExpLexLess.h	2012-03-23 09:31:38.050000004 -0600
 @@ -1,6 +1,6 @@
  // -*- c++ -*-
  //*****************************************************************************
diff --git a/polybori.spec b/polybori.spec
index e809ad9..4fbc13f 100644
--- a/polybori.spec
+++ b/polybori.spec
@@ -12,10 +12,15 @@ Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.
 Source1:        %{name}.desktop
 # These logos were created with gimp from the official polybori logo
 Source2:        %{name}-logos.tar.xz
-# Sent upstream 20 Mar 2012.  Fix a doxygen warning.
-Patch0:         %{name}-warning.patch
-# Sent upstream 20 Mar 2012.  Adapt to GCC 4.7 C++ scope rules.
-Patch1:         %{name}-gcc47.patch
+# This patch is specific to Fedora, although upstream helped create it.  Use
+# system CUDD libraries instead of building the included CUDD sources.
+Patch0:         %{name}-system-cudd.patch
+# Sent upstream 23 Mar 2012.  Fix a doxygen warning.
+Patch1:         %{name}-warning.patch
+# Patch from upstream.  Adapt to GCC 4.7 C++ scope rules.
+Patch2:         %{name}-gcc47.patch
+# Patch from upstream.  Fix some minor code issues.
+Patch3:         %{name}-upstream-fixes.patch
 
 BuildRequires:  boost-devel
 BuildRequires:  desktop-file-utils
@@ -48,6 +53,7 @@ Summary:        Development files for %{name}
 Group:          Development/Libraries
 Requires:       %{name}%{?_isa} = %{version}-%{release}
 Requires:       boost-devel%{?_isa}
+Requires:       cudd-devel%{?_isa}
 Provides:       python-%{name}-devel = %{version}-%{release}
 Obsoletes:      python-%{name}-devel < 0.8.0-1
 
@@ -109,9 +115,11 @@ Qt GUI for %{name}.
 %setup -q
 %patch0
 %patch1
+%patch2
+%patch3
 
-# Remove private copy of system libs (m4ri and pyparsing)
-rm -rf M4RI PyPolyBoRi/pyparsing.py
+# Remove private copy of system libs (Cudd, m4ri, and pyparsing)
+rm -rf Cudd M4RI PyPolyBoRi/pyparsing.py
 
 # Fix library path for 64 bit systems
 if [ %{__isa_bits} = "64" ]; then
@@ -131,9 +139,10 @@ sed -i "s/'\${_relative_rpath.*/''])/" SConstruct
 %build
 scons %{?_smp_mflags} prepare-install \
   PREFIX=%{buildroot}%{_prefix} \
-  DEVEL_PREFIX=%{buildroot}%{_prefix} \
+  CCFLAGS="%{optflags} -DPBORI_USE_ORIGINAL_CUDD" \
   CPPPATH="-I%{_includedir}/m4ri" \
-  M4RI_RPM="True"
+  M4RI_RPM="True" \
+  LIBS="-lcudd"
 
 %install
 scons %{?_smp_mflags} install devel-install \
@@ -143,9 +152,11 @@ scons %{?_smp_mflags} install devel-install \
   MANDIR=%{buildroot}%{_mandir} \
   PYINSTALLPREFIX=%{buildroot}%{python_sitearch} \
   DEVEL_PREFIX=%{buildroot}%{_prefix} \
+  CCFLAGS="%{optflags} -DPBORI_USE_ORIGINAL_CUDD" \
   CPPPATH="-I%{_includedir}/m4ri" \
   SHLINKFLAGS="$RPM_LD_FLAGS -Wl,--as-needed" \
-  M4RI_RPM="True"
+  M4RI_RPM="True" \
+  LIBS="-lcudd"
 
 # The install step doesn't set shared object permissions correctly
 chmod 0755 %{buildroot}%{_libdir}/*.so.0.0.0
@@ -216,11 +227,9 @@ gtk-update-icon-cache %{icondir} >&/dev/null ||:
 %{_mandir}/man1/PolyGUI.1*
 
 %changelog
-* Mon Mar 20 2012 Jerry James <loganjerry at gmail.com> - 0.8.1-1
+* Thu Mar 22 2012 Jerry James <loganjerry at gmail.com> - 0.8.1-1
 - New upstream release
 - Fix desktop file
-- Build no longer succeeds with external CUDD; the polybori developers have
-  stripped down and altered the CUDD sources, forcing us to use their version
 
 * Tue Feb 28 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.8.0-7
 - Rebuilt for c++ ABI breakage


More information about the scm-commits mailing list