Ticket #9768: polybori-0.6.4.p5.spkg.patch

File polybori-0.6.4.p5.spkg.patch, 12.2 KB (added by AlexanderDreyer, 11 years ago)

Diffs of the new package

  • SPKG.txt

    # HG changeset patch
    # User Alexander Dreyer <adreyer@gmx.de>
    # Date 1282249348 25200
    # Node ID b8f84ae9e11a4f3e0c701434085060179a077fd7
    # Parent  ecf05151555da6716a5236e0a7e619ba71d94799
    Dynamic libraries fixed (Trac #9768)
    
    diff -r ecf05151555d -r b8f84ae9e11a SPKG.txt
    a b  
    3737
    3838== Releases ==
    3939
     40=== polybori-0.6.4.p5 (Alexander Dreyer, August 20th, 2010) ===
     41 * Backporting a fix from upcoming PolyBoRi 0.7 which allows linking
     42   PolyBoRi as dynmaic library (#9768).
     43
    4044=== polybori-0.6.4.p4 (Alexander Dreyer, August 10th, 2010) ===
    4145 * Importing PolyBoRi patches from upstream mercurial to fix
    4246   interaction with external M4RI library (#9717)
  • new file patches/BooleEnv.cc

    diff -r ecf05151555d -r b8f84ae9e11a patches/BooleEnv.cc
    - +  
     1// -*- c++ -*-
     2//*****************************************************************************
     3/** @file BooleEnv.cc
     4 *
     5 * @author Alexander Dreyer
     6 * @date 2006-03-06
     7 *
     8 * This file implements the class BooleEnv, which hold global structures.
     9 * a polynomial ring over Booleans.
     10 *
     11 * @par Copyright:
     12 *   (c) 2007 by The PolyBoRi Team
     13 *
     14 * @internal
     15 * @version \$Id$
     16 *
     17 * @par History:
     18 * @verbatim
     19 * $Log$
     20 * Revision 1.4  2009/07/23 19:41:06  dreyer
     21 * ADD: BooleRing::hash
     22 *
     23 * Revision 1.3  2008/04/29 09:01:52  bricken
     24 * + active_ring moved to BooleEnv.cc
     25 *
     26 * Revision 1.2  2007/12/13 16:18:07  dreyer
     27 * CHANGE: removed unnecessary friend declaration
     28 *
     29 * Revision 1.1  2007/12/13 15:53:49  dreyer
     30 * CHANGE: Ordering in BoolePolyRing again; BooleEnv manages active ring
     31 *
     32 * @endverbatim
     33**/
     34//*****************************************************************************
     35
     36
     37// load header file
     38# include "BooleEnv.h"
     39# include "BoolePolyRing.h"
     40#include "OrderedManager.h"
     41
     42BEGIN_NAMESPACE_PBORI
     43
     44
     45//BooleEnv::ring_type active_ring;
     46// Note, direct access via friends, to  active_ring.pOrder and pMgt, because
     47// inline doesn't work up to now, because os the undefined type issue.
     48
     49/// @todo needs inlining!!!
     50#ifdef PBORI_ENV_RING_NOTINLINED
     51BooleEnv::ring_type& BooleEnv::ring() {
     52  static BooleEnv::ring_type active_ring(1000, CTypes::lp, false);
     53  return active_ring;
     54}
     55#endif
     56
     57BooleEnv::block_iterator
     58BooleEnv::blockBegin() {
     59
     60  return ordering().blockBegin();
     61}
     62
     63BooleEnv::block_iterator
     64BooleEnv::blockEnd() {
     65
     66  return ordering().blockEnd();
     67}
     68
     69void BooleEnv::appendBlock(idx_type idx) {
     70
     71  ordering().appendBlock(idx);
     72}
     73
     74void BooleEnv::clearBlocks() {
     75
     76  ordering().clearBlocks();
     77}
     78
     79
     80
     81BooleEnv::idx_type
     82BooleEnv::lastBlockStart() {
     83  return ring().lastBlockStart();
     84}
     85
     86
     87
     88
     89BooleEnv::manager_type& BooleEnv::manager() {
     90  return ring().manager(); }
     91BooleEnv::order_type& BooleEnv::ordering() {
     92  return  ring().ordering(); }
     93
     94
     95
     96
     97  /// Get empty decision diagram
     98BooleEnv::dd_type BooleEnv::zero() { return ring().zero(); }
     99
     100  /// Get decision diagram with all variables negated
     101BooleEnv::dd_type BooleEnv::one() { return ring().one(); }
     102
     103  /// Get number of ring variables the of active ring
     104BooleEnv::size_type BooleEnv::nVariables() {
     105  return manager().nVariables();
     106}
     107
     108
     109
     110
     111
     112  /// Set name of variable with index idx
     113void
     114BooleEnv::setVariableName(idx_type idx, vartext_type varname) {
     115  ring().setVariableName(idx, varname);
     116}
     117
     118  /// Get name of variable with index idx
     119BooleEnv::vartext_type
     120BooleEnv::getVariableName(idx_type idx){
     121  return ring().getVariableName(idx);
     122}
     123
     124
     125  /// Change order of current ring
     126void
     127BooleEnv::changeOrdering(ordercode_type code) {
     128    ring().changeOrdering(code);
     129}
     130
     131
     132
     133
     134  /// Get numerical code for current ordering
     135BooleEnv::ordercode_type BooleEnv::getOrderCode() {
     136  return ordering().getOrderCode();
     137}
     138
     139  /// Get numerical code for current base ordering
     140  /// (the same for non-block orderings)
     141BooleEnv::ordercode_type BooleEnv::getBaseOrderCode() {
     142  return ordering().getBaseOrderCode();
     143}
     144
     145
     146void
     147BooleEnv::printInfo() {
     148
     149  return ring().printInfo();
     150}
     151
     152
     153
     154  /// Access idx-th variable of the active ring
     155BooleEnv::dd_type BooleEnv::variable(idx_type idx) {
     156  return manager().variable(idx);
     157}
     158
     159
     160  /// Access idx-th variable
     161BooleEnv::dd_type BooleEnv::persistentVariable(idx_type idx) {
     162    return manager().persistentVariable(idx);
     163  }
     164
     165
     166void BooleEnv::set(ring_type& theRing) { ring() = theRing; }
     167
     168
     169
     170END_NAMESPACE_PBORI
  • new file patches/BooleEnv.cc.patch

    diff -r ecf05151555d -r b8f84ae9e11a patches/BooleEnv.cc.patch
    - +  
     1--- ../src/polybori-0.6.4/polybori/src/BooleEnv.cc      2010-01-29 01:02:02.000000000 -0800
     2+++ BooleEnv.cc 2010-08-19 07:34:30.000000000 -0700
     3@@ -42,14 +42,17 @@
     4 BEGIN_NAMESPACE_PBORI
     5 
     6 
     7-BooleEnv::ring_type active_ring;
     8+//BooleEnv::ring_type active_ring;
     9 // Note, direct access via friends, to  active_ring.pOrder and pMgt, because
     10 // inline doesn't work up to now, because os the undefined type issue.
     11 
     12 /// @todo needs inlining!!!
     13 #ifdef PBORI_ENV_RING_NOTINLINED
     14-BooleEnv::ring_type& BooleEnv::ring() { return active_ring; }
     15-#endif
     16+BooleEnv::ring_type& BooleEnv::ring() {
     17+  static BooleEnv::ring_type active_ring(1000, CTypes::lp, false);
     18+  return active_ring;
     19+}
     20+#endif
     21 
     22 BooleEnv::block_iterator
     23 BooleEnv::blockBegin() {
     24@@ -77,7 +80,7 @@
     25 
     26 BooleEnv::idx_type
     27 BooleEnv::lastBlockStart() {
     28-  return active_ring.lastBlockStart();
     29+  return ring().lastBlockStart();
     30 }
     31 
     32 
     33@@ -160,7 +163,7 @@
     34   }
     35 
     36 
     37-void BooleEnv::set(ring_type& theRing) { active_ring = theRing; }
     38+void BooleEnv::set(ring_type& theRing) { ring() = theRing; }
     39 
     40 
     41 
  • new file patches/BooleEnv.h

    diff -r ecf05151555d -r b8f84ae9e11a patches/BooleEnv.h
    - +  
     1// -*- c++ -*-
     2//*****************************************************************************
     3/** @file BooleEnv.h
     4 *
     5 * @author Alexander Dreyer
     6 * @date 2006-03-06
     7 *
     8 * This file the class BooleEnv, where handles global (static) strucutres of
     9 * PolyBoRi.
     10 *
     11 * @par Copyright:
     12 *   (c) 2007 by The PolyBoRi Team
     13 *
     14 * @internal
     15 * @version \$Id$
     16 *
     17 * @par History:
     18 * @verbatim
     19 * $Log$
     20 * Revision 1.2  2008/04/29 09:02:10  bricken
     21 * + active_ring moved to BooleEnv.cc
     22 *
     23 * Revision 1.1  2007/12/13 15:53:48  dreyer
     24 * CHANGE: Ordering in BoolePolyRing again; BooleEnv manages active ring
     25 *
     26 * @endverbatim
     27**/
     28//*****************************************************************************
     29
     30
     31// load PolyBoRi settings
     32# include "pbori_defs.h"
     33#include <vector>
     34
     35#ifndef BooleEnv_h_
     36#define BooleEnv_h_
     37
     38// Obey stricter dependence of Sun Studio compiler
     39// todo: resolve dependency
     40#if 1 // defined(__SUNPRO_C) || defined(__SUNPRO_CC)
     41# define PBORI_ENV_RING_NOTINLINED
     42#endif
     43
     44BEGIN_NAMESPACE_PBORI
     45
     46
     47class BoolePolyRing;
     48class CDynamicOrderBase;
     49
     50/** @class BooleEnv
     51 * @brief This class is just a wrapper accessing global structures.
     52 *
     53 *
     54 **/
     55
     56
     57class BooleEnv:
     58  public CTypes::orderenums_type, public CTypes::compenums_type,
     59  public CTypes::auxtypes_type {
     60
     61 public:
     62  //-------------------------------------------------------------------------
     63  // types definitions
     64  //-------------------------------------------------------------------------
     65
     66  /// generic access to current type
     67  typedef BooleEnv self;
     68
     69  /// generic access to base type
     70  typedef CTypes::orderenums_type base;
     71
     72  /// @name adopt global type definitions
     73  //@{
     74  typedef CTypes::ordercode_type ordercode_type;
     75  typedef CTypes::manager_type manager_type;
     76  typedef CTypes::manager_reference manager_reference;
     77  typedef CTypes::manager_ptr manager_ptr;
     78  typedef CTypes::dd_type dd_type;
     79  typedef CTypes::vartext_type vartext_type;
     80  //@}
     81
     82  /// Type for block indices
     83  typedef std::vector<idx_type> block_idx_type;
     84
     85  /// Type for block iterators
     86  typedef block_idx_type::const_iterator block_iterator;
     87
     88  //-------------------------------------------------------------------------
     89  // constructors and destructor
     90  //-------------------------------------------------------------------------
     91
     92  /// Explicitely mention ordercodes' enumeration
     93  using base::ordercodes;
     94
     95  /// Access idx-th variable of the active ring
     96  static dd_type variable(idx_type idx);
     97
     98  /// Access idx-th variable
     99  static dd_type persistentVariable(idx_type idx);
     100
     101  /// Get numerical code for current ordering
     102  static ordercode_type getOrderCode();
     103
     104  /// Get numerical code for current base ordering
     105  /// (the same for non-block orderings)
     106  static ordercode_type getBaseOrderCode();
     107
     108  /// Get empty decision diagram
     109  static dd_type zero();
     110
     111  /// Get decision diagram with all variables negated
     112  static dd_type one();
     113
     114  /// Get number of ring variables the of active ring
     115  static size_type nVariables();
     116
     117  typedef BoolePolyRing ring_type;
     118
     119  typedef CDynamicOrderBase order_type;
     120#ifdef PBORI_ENV_RING_NOTINLINED
     121  static ring_type& ring();
     122#else
     123  static ring_type& ring() {
     124    static BooleEnv::ring_type active_ring(1000, CTypes::lp, false);
     125    return active_ring;
     126  }
     127#endif
     128  static manager_type& manager();
     129  static order_type& ordering();
     130  /// Set name of variable with index idx
     131  static void setVariableName(idx_type idx, vartext_type varname);
     132
     133  /// Get name of variable with index idx
     134  static vartext_type getVariableName(idx_type idx);
     135
     136  /// @name interface for block orderings
     137  //@{
     138  static block_iterator blockBegin();
     139  static block_iterator blockEnd();
     140  static void appendBlock(idx_type idx);
     141  static void clearBlocks();
     142 
     143  static idx_type lastBlockStart();
     144  //@}
     145
     146  /// Change order of current ring
     147  static void changeOrdering(ordercode_type code);
     148
     149  static void printInfo();
     150
     151  static void set(ring_type& theRing);
     152
     153
     154protected:
     155
     156 
     157};
     158
     159///please use BooleEnv::ring()
     160
     161END_NAMESPACE_PBORI
     162
     163#endif // of #ifndef BooleEnv_h_
  • new file patches/BooleEnv.h.patch

    diff -r ecf05151555d -r b8f84ae9e11a patches/BooleEnv.h.patch
    - +  
     1--- ../src/polybori-0.6.4/polybori/include/BooleEnv.h   2010-01-29 01:02:02.000000000 -0800
     2+++ BooleEnv.h  2010-08-19 07:56:45.000000000 -0700
     3@@ -37,7 +37,7 @@
     4 
     5 // Obey stricter dependence of Sun Studio compiler
     6 // todo: resolve dependency
     7-#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
     8+#if 1 // defined(__SUNPRO_C) || defined(__SUNPRO_CC)
     9 # define PBORI_ENV_RING_NOTINLINED
     10 #endif
     11 
     12@@ -45,7 +45,6 @@
     13 
     14 
     15 class BoolePolyRing;
     16-extern BoolePolyRing active_ring;
     17 class CDynamicOrderBase;
     18 
     19 /** @class BooleEnv
     20@@ -122,6 +121,7 @@
     21   static ring_type& ring();
     22 #else
     23   static ring_type& ring() {
     24+    static BooleEnv::ring_type active_ring(1000, CTypes::lp, false);
     25     return active_ring;
     26   }
     27 #endif
  • spkg-install

    diff -r ecf05151555d -r b8f84ae9e11a spkg-install
    a b  
    3333    cp patches/pbori_routines_misc.h src/${PBDIR}/polybori/include/
    3434    cp patches/ll.py                 src/${PBDIR}/pyroot/polybori
    3535    cp patches/nf.cc                 src/${PBDIR}/groebner/src/
    36 
     36    cp patches/BooleEnv.h            src/${PBDIR}/polybori/include/
     37    cp patches/BooleEnv.cc           src/${PBDIR}/polybori/src/
    3738}
    3839
    3940
     
    7172    rm -rf ${SAGE_LOCAL}/include/cudd
    7273}
    7374
    74 remove_dylib()
    75 {
    76     # linking dynamic libraries causes segfaults at exit (see #2822)
    77     if [ `uname` = "Darwin" ]; then
    78         rm -f $SAGE_LOCAL/lib/libpolybori.dylib
    79         rm -f $SAGE_LOCAL/lib/libpboriCudd.dylib
    80         rm -f $SAGE_LOCAL/lib/libgroebner.dylib
    81     else
    82         rm -f $SAGE_LOCAL/lib/libpolybori.so
    83         rm -f $SAGE_LOCAL/lib/libpboriCudd.so
    84         rm -f $SAGE_LOCAL/lib/libgroebner.so
    85     fi
    86 }
    87 
    8875patch
    8976
    9077cd src
     
    10289echo "Installing PolyBoRi..."
    10390install_polybori
    10491echo "Done installing PolyBoRi."
    105 
    106 echo "Removing dynamic libraries..."
    107 remove_dylib
    108 echo "Done removing dynamic libraries."