From 4ad1335db2350d209f2ff7598e8f42d2d5fc1c46 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Aug 15 2013 04:43:21 +0000 Subject: Update to latest "perpetual beta" for perl 5.18 compatibility (bz 992813). --- diff --git a/.gitignore b/.gitignore index 1957bce..7caebc6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/polymake-2.12-rc3.tar.bz2 +/polymake-2.12.tar.bz2 diff --git a/polymake-bliss.patch b/polymake-bliss.patch deleted file mode 100644 index db2dd6f..0000000 --- a/polymake-bliss.patch +++ /dev/null @@ -1,649 +0,0 @@ ---- ./apps/topaz/src/isomorphic_complexes.cc.orig 2011-04-13 01:51:10.000000000 -0600 -+++ ./apps/topaz/src/isomorphic_complexes.cc 2013-01-10 11:05:09.551105078 -0700 -@@ -34,7 +34,7 @@ find_facet_vertex_permutations(perl::Obj - return graph::find_row_col_permutation(M1,M2); - } - --UserFunction4perl("CREDIT nauty\n\n" -+UserFunction4perl("CREDIT bliss\n\n" - "# @category Comparing\n" - "# Determine whether two given complexes are combinatorially isomorphic.\n" - "# The problem is reduced to graph isomorphism of the vertex-facet incidence graphs.\n" ---- ./apps/topaz/src/bistellar.cc.orig 2011-05-11 04:34:18.000000000 -0600 -+++ ./apps/topaz/src/bistellar.cc 2013-01-10 11:05:09.551105078 -0700 -@@ -381,7 +381,7 @@ UserFunction4perl("# @category Producing - "# @return SimplicialComplex", - &bistellar_simplification,"bistellar_simplification(SimplicialComplex { rounds => undef, abs => 0, obj => undef, relax => undef, heat => undef, constant => 0, allow_rev_move=> 0, min_n_facets => undef, verbose => undef, seed => undef, quiet => 0, distribution => undef })"); - --UserFunction4perl("CREDIT nauty\n\n" -+UserFunction4perl("CREDIT bliss\n\n" - "# @category Comparing" - "# Tries to determine wheter two complexes are pl-homeomorphic by using" - "# bistellar flips and a simulated annealing strategy." ---- ./apps/graph/src/graph_compare.cc.orig 2010-12-12 16:36:28.000000000 -0700 -+++ ./apps/graph/src/graph_compare.cc 2013-01-10 11:05:09.560103386 -0700 -@@ -15,150 +15,137 @@ - $Project: polymake $$Id: graph_compare.cc 9991 2010-12-12 23:36:28Z gawrilow $ - */ - --#define graph nauty_graph --#define set nauty_set --#define permutation nauty_permutation -- --#include -- --namespace { --inline nauty_set* graph_row(nauty_graph *g, int v, int m) { return GRAPHROW(g,v,m); } --} -- --#undef GRAPHROW --#undef graph --#undef set --#undef permutation -- -+#include -+#include - #include "polymake/graph/graph_compare.h" - - namespace polymake { namespace graph { --namespace { -- --DEFAULTOPTIONS_GRAPH(default_options); --NautyGraph *in_processing=0; - --} -- --struct NautyGraph::impl { -- int n, m; -- nauty_graph *src_graph, *canon_graph; -- int *orbits, *canon_labels, *partitions; -- optionblk options; -+struct BlissGraph::impl { -+ bliss::AbstractGraph *src_graph; -+ unsigned int *canon_labels; -+ bool digraph; - -- explicit impl(int n_arg) -- : n(n_arg), m((n + WORDSIZE - 1) / WORDSIZE), -- src_graph(0), canon_graph(0), -- orbits(0), canon_labels(0), partitions(0) -+ explicit impl(int n_arg, bool dir) : digraph(dir) - { -- src_graph=new nauty_graph[n*m]; -- EMPTYSET(src_graph,n*m); -- canon_graph=new nauty_graph[n*m]; -- orbits=new int[n]; -- canon_labels=new int[n]; -- partitions=new int[n]; -- options=default_options; -+ if (dir) -+ src_graph = new bliss::Digraph(n_arg); -+ else -+ src_graph = new bliss::Graph(n_arg); -+ canon_labels=new unsigned int[n_arg]; - } - - ~impl() - { -- delete[] partitions; - delete[] canon_labels; -- delete[] orbits; -- delete[] canon_graph; -- delete[] src_graph; -+ delete src_graph; - } - -- static void store_autom(int n_autom, nauty_permutation *perm, int*, int, int, int n) -+ static void store_autom(void *graph, unsigned int n, const unsigned int *aut) - { -- in_processing->n_autom=n_autom; -- in_processing->autom.push_back( Array(n, perm) ); -+ BlissGraph *g=reinterpret_cast(graph); -+ g->n_autom++; -+ g->autom.push_back( Array(n, aut) ); - } - }; - --NautyGraph::impl* NautyGraph::alloc_impl(int n, bool dir) -+BlissGraph::impl* BlissGraph::alloc_impl(int n, bool dir) - { -- impl* i=new impl(n); -- i->options.digraph=dir; -- i->options.getcanon=true; -- return i; -+ return new impl(n, dir); - } - --NautyGraph::~NautyGraph() { delete p_impl; } -+BlissGraph::~BlissGraph() { delete p_impl; } - --void NautyGraph::add_edge(int from, int to) -+void BlissGraph::add_edge(unsigned int from, unsigned int to) - { -- nauty_set *gv=graph_row(p_impl->src_graph, from, p_impl->m); -- ADDELEMENT(gv, to); -+ if (p_impl->digraph) { -+ bliss::Digraph *g = reinterpret_cast(p_impl->src_graph); -+ g->add_edge(from, to); -+ } else { -+ bliss::Graph *g = reinterpret_cast(p_impl->src_graph); -+ g->add_edge(from, to); -+ } - } - --void NautyGraph::partition(int at) -+void BlissGraph::color(unsigned int at, unsigned int color) - { -- p_impl->options.defaultptn=false; -- std::fill(p_impl->partitions, p_impl->partitions+p_impl->n-1, 1); -- copy(entire(sequence(0,p_impl->n)), p_impl->canon_labels); -- p_impl->partitions[at-1]=0; -- p_impl->partitions[p_impl->n-1]=0; -+ if (p_impl->digraph) { -+ bliss::Digraph *g = reinterpret_cast(p_impl->src_graph); -+ g->change_color(at, color); -+ } else { -+ bliss::Graph *g = reinterpret_cast(p_impl->src_graph); -+ g->change_color(at, color); -+ } - } - --int* NautyGraph::partitions() -+void BlissGraph::color(unsigned int from, unsigned int to, unsigned int color) - { -- p_impl->options.defaultptn=false; -- return p_impl->partitions; -+ if (p_impl->digraph) { -+ bliss::Digraph *g = reinterpret_cast(p_impl->src_graph); -+ for (unsigned int i = from; i < to; i++) -+ g->change_color(i, color); -+ } else { -+ bliss::Graph *g = reinterpret_cast(p_impl->src_graph); -+ for (unsigned int i = from; i < to; i++) -+ g->change_color(i, color); -+ } - } - --int* NautyGraph::labels() -+void BlissGraph::partition(unsigned int at) - { -- return p_impl->canon_labels; -+ color(0U, at, 0U); -+ color(at, p_impl->src_graph->get_nof_vertices(), 1U); - } - --void NautyGraph::finalize(bool gather_automorphisms) -+void BlissGraph::finalize(bool gather_automorphisms) - { -- statsblk stats; -- const int worksize=100*1024*1024; // 100MB -- nauty_set *workspace=new nauty_set[worksize]; -+ bliss::Stats stats; -+ size_t n=p_impl->src_graph->get_nof_vertices(); -+ const unsigned int *perm; -+ - if (gather_automorphisms) { -- p_impl->options.userautomproc=&impl::store_autom; -- in_processing=this; -+ n_autom=0; -+ perm=p_impl->src_graph->canonical_form(stats, &impl::store_autom, this); -+ } else { -+ perm=p_impl->src_graph->canonical_form(stats, NULL, NULL); - } -- nauty(p_impl->src_graph, p_impl->canon_labels, p_impl->partitions, 0, p_impl->orbits, -- &p_impl->options, &stats, workspace, worksize, p_impl->m, p_impl->n, p_impl->canon_graph); -- delete[] workspace; -+ std::memcpy(p_impl->canon_labels, perm, n * sizeof(unsigned int)); - } - --bool NautyGraph::operator== (const NautyGraph& g2) const -+bool BlissGraph::operator== (const BlissGraph& g2) const - { -- if (p_impl->n != g2.p_impl->n) return false; -- nauty_set *cg1=p_impl->canon_graph, *cg1_end=cg1+p_impl->n*p_impl->m, *cg2=g2.p_impl->canon_graph; -- return std::equal(cg1, cg1_end, cg2); -+ size_t n=p_impl->src_graph->get_nof_vertices(); -+ return n == g2.p_impl->src_graph->get_nof_vertices() && -+ !std::memcmp(p_impl->canon_labels, g2.p_impl->canon_labels, -+ n * sizeof(unsigned int)); - } - --Array NautyGraph::find_permutation(const NautyGraph& g2) const -+Array BlissGraph::find_permutation(const BlissGraph& g2) const - { - if (*this != g2) - throw no_match("not isomorphic"); - -- Array perm(p_impl->n); -- for (int *dst=perm.begin(), *lab1=p_impl->canon_labels, *lab1_end=lab1+p_impl->n, *lab2=g2.p_impl->canon_labels; -+ Array perm(p_impl->src_graph->get_nof_vertices()); -+ for (unsigned int *dst=perm.begin(), *lab1=p_impl->canon_labels, *lab1_end=lab1+p_impl->src_graph->get_nof_vertices(), *lab2=g2.p_impl->canon_labels; - lab1, Array > --NautyGraph::find_permutations(const NautyGraph& g2, int n_cols) const -+std::pair< Array, Array > -+BlissGraph::find_permutations(const BlissGraph& g2, int n_cols) const - { - if (*this != g2) - throw no_match("not isomorphic"); - -- Array row_perm(p_impl->n-n_cols), col_perm(n_cols); -+ Array row_perm(p_impl->src_graph->get_nof_vertices()-n_cols), col_perm(n_cols); - -- int *lab1=p_impl->canon_labels, *lab1_end=lab1+n_cols, *lab2=g2.p_impl->canon_labels; -- for (int *dst=col_perm.begin(); lab1canon_labels, *lab1_end=lab1+n_cols, *lab2=g2.p_impl->canon_labels; -+ for (unsigned int *dst=col_perm.begin(); lab1canon_labels+p_impl->n; -- for (int *dst=row_perm.begin(); lab1canon_labels+p_impl->src_graph->get_nof_vertices(); -+ for (unsigned int *dst=row_perm.begin(); lab1 > autom; -+ std::list< Array > autom; - - static impl *alloc_impl(int n_nodes, bool is_directed); -- void add_edge(int from, int to); -- void partition(int at); -- int* partitions(); -- int* labels(); -+ void add_edge(unsigned int from, unsigned int to); -+ void color(unsigned int at, unsigned int color); -+ void color(unsigned int from, unsigned int to, unsigned int color); -+ void partition(unsigned int at); - void finalize(bool gather_automorphisms); - - template -@@ -70,10 +70,10 @@ class NautyGraph { - } - - public: -- NautyGraph() : p_impl(0) {} -+ BlissGraph() : p_impl(0) {} - - template -- explicit NautyGraph(const GenericGraph& G, bool gather_automorphisms=false) -+ explicit BlissGraph(const GenericGraph& G, bool gather_automorphisms=false) - : p_impl(alloc_impl(G.nodes(), G.is_directed)) - { - fill(G); -@@ -82,11 +82,11 @@ public: - - // non-symmetrical incidence matrix - template -- explicit NautyGraph(const GenericIncidenceMatrix& M, -+ explicit BlissGraph(const GenericIncidenceMatrix& M, - typename pm::disable_if::type gather_automorphisms=false) - : p_impl(alloc_impl(M.rows()+M.cols(), false)) - { -- int rnode=M.cols(); -+ unsigned int rnode=M.cols(); - partition(rnode); - for (typename Entire< Rows< Matrix > >::const_iterator r=entire(rows(M)); !r.at_end(); ++r, ++rnode) - for (typename Entire< typename Matrix::row_type >::const_iterator c=entire(*r); !c.at_end(); ++c) { -@@ -98,20 +98,20 @@ public: - - // symmetrical incidence matrix - template -- explicit NautyGraph(const GenericIncidenceMatrix& M, -+ explicit BlissGraph(const GenericIncidenceMatrix& M, - typename pm::enable_if::type gather_automorphisms=false) - : p_impl(alloc_impl(M.rows(), true)) - { - // there can be ones on the diagonal, which correspond loops in the graph; -- // nauty requires the graph to be declared as directed in this case -+ // bliss requires the graph to be declared as directed in this case - fill(M); - finalize(gather_automorphisms); - } - -- ~NautyGraph(); -+ ~BlissGraph(); - -- bool operator== (const NautyGraph& g2) const; -- bool operator!= (const NautyGraph& g2) const { return !operator==(g2); } -+ bool operator== (const BlissGraph& g2) const; -+ bool operator!= (const BlissGraph& g2) const { return !operator==(g2); } - - private: - static void incr_count(std::pair& p) -@@ -129,16 +129,16 @@ private: - - public: - template -- static bool prepare_colored(NautyGraph& NG1, const GenericGraph& G1, const Colors1& colors1, -- NautyGraph& NG2, const GenericGraph& G2, const Colors2& colors2); -+ static bool prepare_colored(BlissGraph& NG1, const GenericGraph& G1, const Colors1& colors1, -+ BlissGraph& NG2, const GenericGraph& G2, const Colors2& colors2); - template -- static bool prepare_colored(NautyGraph& NG, const GenericGraph& G, const Colors& colors); -+ static bool prepare_colored(BlissGraph& NG, const GenericGraph& G, const Colors& colors); - -- Array find_permutation(const NautyGraph& g2) const; -- std::pair< Array, Array > find_permutations(const NautyGraph& g2, int n_cols) const; -+ Array find_permutation(const BlissGraph& g2) const; -+ std::pair< Array, Array > find_permutations(const BlissGraph& g2, int n_cols) const; - - int n_automorphisms() const { return n_autom; } -- const std::list< Array >& automorphisms() const { return autom; } -+ const std::list< Array >& automorphisms() const { return autom; } - }; - - template inline -@@ -147,7 +147,7 @@ bool isomorphic(const GenericGraph inline --Array find_node_permutation(const GenericGraph& G1, const GenericGraph& G2) -+Array find_node_permutation(const GenericGraph& G1, const GenericGraph& G2) - { - if (G1.is_directed != G2.is_directed) - throw no_match("graphs of different kind"); - if (G1.nodes() != G2.nodes()) - throw no_match("graphs of different size"); -- NautyGraph NG1(G1), NG2(G2); -+ BlissGraph NG1(G1), NG2(G2); - return NG1.find_permutation(NG2); - } - - template inline --Array find_node_permutation(const GenericGraph& G1, const Colors1& colors1, -+Array find_node_permutation(const GenericGraph& G1, const Colors1& colors1, - const GenericGraph& G2, const Colors2& colors2) - { - if (G1.is_directed != G2.is_directed) - throw no_match("graphs of different kind"); - if (G1.nodes() != G2.nodes()) - throw no_match("graphs of different size"); -- NautyGraph NG1, NG2; -- if (NautyGraph::prepare_colored(NG1, G1, colors1, NG2, G2, colors2)) -+ BlissGraph NG1, NG2; -+ if (BlissGraph::prepare_colored(NG1, G1, colors1, NG2, G2, colors2)) - return NG1.find_permutation(NG2); - else - throw no_match("different colors"); - } - - template inline --Array< Array > automorphisms(const GenericGraph& G) -+Array< Array > automorphisms(const GenericGraph& G) - { -- NautyGraph NG(G, true); -- return Array< Array >(NG.n_automorphisms(), NG.automorphisms().begin()); -+ BlissGraph NG(G, true); -+ return Array< Array >(NG.n_automorphisms(), NG.automorphisms().begin()); - } - - template inline --Array< Array > automorphisms(const GenericGraph& G, const Colors& colors) -+Array< Array > automorphisms(const GenericGraph& G, const Colors& colors) - { -- NautyGraph NG; -- NautyGraph::prepare_colored(NG,G,colors); -- return Array< Array >(NG.n_automorphisms(), NG.automorphisms().begin()); -+ BlissGraph NG; -+ BlissGraph::prepare_colored(NG,G,colors); -+ return Array< Array >(NG.n_automorphisms(), NG.automorphisms().begin()); - } - - template inline -@@ -210,49 +210,49 @@ isomorphic(const GenericIncidenceMatrix< - if (M1.rows() != M2.rows() || M1.cols() != M2.cols()) - return false; - if (M1.rows()<=1) return true; -- NautyGraph NG1(M1), NG2(M2); -+ BlissGraph NG1(M1), NG2(M2); - return NG1==NG2; - } - - template inline --typename pm::enable_if< Array, Matrix1::is_symmetric && Matrix2::is_symmetric>::type -+typename pm::enable_if< Array, Matrix1::is_symmetric && Matrix2::is_symmetric>::type - find_row_permutation(const GenericIncidenceMatrix& M1, const GenericIncidenceMatrix& M2) - { - if (M1.rows() != M2.rows()) - throw no_match("matrices of different dimensions"); -- NautyGraph NG1(M1), NG2(M2); -+ BlissGraph NG1(M1), NG2(M2); - return NG1.find_permutation(NG2); - } - - template inline --typename pm::enable_if< std::pair< Array, Array >, !Matrix1::is_symmetric && !Matrix2::is_symmetric>::type -+typename pm::enable_if< std::pair< Array, Array >, !Matrix1::is_symmetric && !Matrix2::is_symmetric>::type - find_row_col_permutation(const GenericIncidenceMatrix& M1, const GenericIncidenceMatrix& M2) - { - if (M1.rows() != M2.rows() || M1.cols() != M2.cols()) - throw no_match("matrices of different dimensions"); -- NautyGraph NG1(M1), NG2(M2); -+ BlissGraph NG1(M1), NG2(M2); - return NG1.find_permutations(NG2, M1.cols()); - } - - template inline --typename pm::enable_if< Array< Array >, Matrix::is_symmetric>::type -+typename pm::enable_if< Array< Array >, Matrix::is_symmetric>::type - automorphisms(const GenericIncidenceMatrix& M) - { -- NautyGraph NG(M, true); -- return Array< Array >(NG.n_automorphisms(), NG.automorphisms().begin()); -+ BlissGraph NG(M, true); -+ return Array< Array >(NG.n_automorphisms(), NG.automorphisms().begin()); - } - - template --typename pm::disable_if< Array< std::pair< Array, Array > >, Matrix::is_symmetric>::type -+typename pm::disable_if< Array< std::pair< Array, Array > >, Matrix::is_symmetric>::type - automorphisms(const GenericIncidenceMatrix& M) - { -- NautyGraph NG(M, true); -- Array< std::pair< Array, Array > > result(NG.n_automorphisms()); -- std::list< Array >::const_iterator p=NG.automorphisms().begin(); -+ BlissGraph NG(M, true); -+ Array< std::pair< Array, Array > > result(NG.n_automorphisms()); -+ std::list< Array >::const_iterator p=NG.automorphisms().begin(); - const int n_rows=M.rows(), n_cols=M.cols(); - sequence rows(n_cols, n_rows), cols(0, n_cols); - -- for (Entire< Array< std::pair< Array, Array > > >::iterator r=entire(result); !r.at_end(); ++r, ++p) { -+ for (Entire< Array< std::pair< Array, Array > > >::iterator r=entire(result); !r.at_end(); ++r, ++p) { - r->first.append(n_rows, translate(select(*p,rows), -n_cols).begin()); - r->second.append(n_cols, select(*p,cols).begin()); - } -@@ -260,45 +260,31 @@ automorphisms(const GenericIncidenceMatr - } - - template --bool NautyGraph::prepare_colored(NautyGraph& NG1, const GenericGraph& G1, const Colors1& colors1, -- NautyGraph& NG2, const GenericGraph& G2, const Colors2& colors2) -+bool BlissGraph::prepare_colored(BlissGraph& NG1, const GenericGraph& G1, const Colors1& colors1, -+ BlissGraph& NG2, const GenericGraph& G2, const Colors2& colors2) - { - const int n=G1.nodes(); - NG1.p_impl=alloc_impl(n, G1.is_directed); - NG2.p_impl=alloc_impl(n, G2.is_directed); - - typedef Map::type, -- std::pair > color_map_type; -+ unsigned int > color_map_type; - color_map_type color_map; -+ unsigned int color_num = 0U; - - for (typename Entire::const_iterator c=entire(colors1); !c.at_end(); ++c) -- incr_count(color_map[*c]); -- -+ if (!color_map.exists(*c)) -+ color_map[*c]=color_num++; - for (typename Entire::const_iterator c=entire(colors2); !c.at_end(); ++c) -- if (--color_map[*c].second < 0) -- return false; -- -- int *p1=NG1.partitions(), *l1=NG1.labels(), *l2=NG2.labels(); -- int start=0; -- -- for (typename color_map_type::iterator cm=color_map.begin(); !cm.at_end(); ++cm) { -- const int n_of_this_color=cm->second.first; -- cm->second.second=start; -- std::fill(p1, p1+n_of_this_color-1, 1); p1+=n_of_this_color; p1[-1]=0; -- start+=n_of_this_color; -- } -- p1=NG1.partitions(); -- -- std::copy(p1, p1+n, NG2.partitions()); -+ if (!color_map.exists(*c)) -+ color_map[*c]=color_num++; - - for (typename pm::ensure_features >::const_iterator -- c=ensure(colors1, (pm::cons*)0).begin(); !c.at_end(); ++c) -- l1[first_index(color_map[*c])]=c.index(); -- -+ c=ensure(colors1, (pm::cons*)0).begin(); !c.at_end(); ++c) -+ NG1.color(c.index(), color_map[*c]); - for (typename pm::ensure_features >::const_iterator - c=ensure(colors2, (pm::cons*)0).begin(); !c.at_end(); ++c) -- l2[second_index(color_map[*c])]=c.index(); -- -+ NG2.color(c.index(), color_map[*c]); - - NG1.fill(G1); NG1.finalize(false); - NG2.fill(G2); NG2.finalize(false); -@@ -306,31 +292,22 @@ bool NautyGraph::prepare_colored(NautyGr - } - - template --bool NautyGraph::prepare_colored(NautyGraph& NG, const GenericGraph& G, const Colors& colors) -+bool BlissGraph::prepare_colored(BlissGraph& NG, const GenericGraph& G, const Colors& colors) - { - const int n=G.nodes(); - NG.p_impl=alloc_impl(n, G.is_directed); - -- typedef Map color_map_type; -+ typedef Map color_map_type; - color_map_type color_map; -+ unsigned int color_num = 0U; - - for (typename Entire::const_iterator c=entire(colors); !c.at_end(); ++c) -- ++color_map[*c]; -- -- -- int *p=NG.partitions(), *l=NG.labels(); -- int start=0; -- -- for (typename color_map_type::iterator cm=color_map.begin(); !cm.at_end(); ++cm) { -- const int n_of_this_color=cm->second; -- cm->second += start-n_of_this_color; -- start += n_of_this_color; -- std::fill(p, p+n_of_this_color-1, 1); p+=n_of_this_color; p[-1]=0; -- } -+ if (!color_map.exists(*c)) -+ color_map[*c]=color_num++; - - for (typename pm::ensure_features >::const_iterator - c=ensure(colors, (pm::cons*)0).begin(); !c.at_end(); ++c) -- l[color_map[*c]++]=c.index(); -+ NG.color(c.index(), color_map[*c]); - - NG.fill(G); NG.finalize(true); - return true; ---- ./apps/polytope/src/isomorphic_polytopes.cc.orig 2011-04-13 01:51:10.000000000 -0600 -+++ ./apps/polytope/src/isomorphic_polytopes.cc 2013-01-10 11:05:09.550105266 -0700 -@@ -40,7 +40,7 @@ find_facet_vertex_permutations(perl::Obj - return graph::find_row_col_permutation(M1,M2); - } - --UserFunction4perl("CREDIT nauty\n\n" -+UserFunction4perl("CREDIT bliss\n\n" - "# @category Comparing" - "# Check whether the face lattices of two polytopes are isomorphic." - "# The problem is reduced to graph isomorphism of the vertex-facet incidence graphs." ---- ./apps/polytope/src/lattice_isomorphic_polytopes.cc.orig 2011-09-12 15:56:14.000000000 -0600 -+++ ./apps/polytope/src/lattice_isomorphic_polytopes.cc 2013-01-10 11:05:09.543106580 -0700 -@@ -88,7 +88,7 @@ Array< Array > lattice_automorphism - } - - --UserFunction4perl("CREDIT nauty\n\n" -+UserFunction4perl("CREDIT bliss\n\n" - "# @category Comparing" - "# Tests whether two smooth lattice polytopes are lattice equivalent" - "# by comparing lattice distances between vertices and facets. " ---- ./apps/polytope/src/congruent_polytopes.cc.orig 2011-04-13 01:51:10.000000000 -0600 -+++ ./apps/polytope/src/congruent_polytopes.cc 2013-01-10 11:05:09.543106580 -0700 -@@ -59,7 +59,7 @@ Scalar congruent(perl::Object p1, perl:: - return graph::isomorphic(G1, dist1, G2, dist2) ? min1 : Scalar(0); - } - --UserFunctionTemplate4perl("CREDIT nauty\n\n" -+UserFunctionTemplate4perl("CREDIT bliss\n\n" - "# @category Comparing" - "# Check whether two given polytopes //P1// and //P2// are congruent, i.e. whether" - "# there is an affine isomorphism between them that is induced by a (possibly scaled) orthogonal matrix." diff --git a/polymake-fedora.patch b/polymake-fedora.patch index 8bf9eaa..3b151eb 100644 --- a/polymake-fedora.patch +++ b/polymake-fedora.patch @@ -1,38 +1,24 @@ ---- ./apps/group/src/Makefile.inc.orig 2011-04-11 10:17:49.000000000 -0600 -+++ ./apps/group/src/Makefile.inc 2013-02-27 15:10:34.341168779 -0700 -@@ -1,4 +1,4 @@ -- ExtraCXXFLAGS = -I$(ProjectTop)/external/permlib/include -+ ExtraCXXFLAGS = -I/usr/include/permlib +--- ./apps/polytope/src/Makefile.inc.orig 2013-08-14 13:17:09.000000000 -0600 ++++ ./apps/polytope/src/Makefile.inc 2013-08-14 14:26:36.000000000 -0600 +@@ -1,12 +1,12 @@ + ifeq (${ExtensionTop},) + StaticLibs := cdd lrs - # Local Variables: - # mode: Makefile ---- ./apps/polytope/src/Makefile.inc.orig 2012-01-13 15:32:36.000000000 -0700 -+++ ./apps/polytope/src/Makefile.inc 2013-02-27 15:10:34.340168780 -0700 -@@ -1,17 +1,12 @@ - ifndef ExtensionTop -- ExternalLibs := cdd lrs sympol -- - lrs_interface$O : ExtraCXXFLAGS = -I$(ProjectTop)/external/lrs -- cdd_interface$O : ExtraCXXFLAGS = -I$(ProjectTop)/external/cdd/lib-src-gmp $(call addinclude, $(ProjectTop)/ext_lib/cdd/globals_gmp.h) +- cdd_interface$O : ExtraCXXFLAGS = -I$(ProjectTop)/external/cdd/lib-src-gmp $(call addinclude, $(ProjectTop)/staticlib/cdd/globals_gmp.h) - cdd_float_interface$O : ExtraCXXFLAGS = -I$(ProjectTop)/external/cdd/lib-src -- -- ExtraCXXFLAGS += -I$(ProjectTop)/external/permlib/include -- sympol_interface$O : ExtraCXXFLAGS += -I$(ProjectTop)/external/sympol + lrs_interface$O : ExtraCXXFLAGS = -I/usr/include/lrslib -+ cdd_interface$O : ExtraCXXFLAGS = -I/usr/include/cddlib $(call addinclude, $(ProjectTop)/ext_lib/cdd/globals_gmp.h) ++ cdd_interface$O : ExtraCXXFLAGS = -I/usr/include/cddlib $(call addinclude, $(ProjectTop)/staticlib/cdd/globals_gmp.h) + cdd_float_interface$O : ExtraCXXFLAGS = -I/usr/include/cddlib + to_interface$O : ExtraCXXFLAGS = -I$(ProjectTop)/external/TOSimplex -- LIBS += $(BuildDir)/external/lrs/liblrsgmp$A $(BuildDir)/external/cdd/libcddgmp$A $(BuildDir)/external/cdd/libcdd$A $(BuildDir)/external/sympol/libsympol$A -+ LIBS += -llrsgmp -lcddgmp -lcdd -lsympol +- LIBS += $(BuildDir)/staticlib/lrs/liblrsgmp$A $(BuildDir)/staticlib/cdd/libcddgmp$A $(BuildDir)/staticlib/cdd/libcdd$A ++ LIBS += -llrsgmp -lcddgmp -lcdd endif --ifneq ($(filter 4.4% 4.5%,${GCCversion}),) -+ifneq ($(filter 4.4% 4.5% 4.6% 4.7% 4.8%,${GCCversion}),) - core_point_algo$O rel_int_point$O pointed_part$O : ExtraCXXFLAGS += -fno-strict-aliasing - endif - ---- ./perl/polymake-config.orig 2011-05-30 16:51:45.000000000 -0600 -+++ ./perl/polymake-config 2013-02-27 15:14:32.177979991 -0700 + ifneq ($(filter 4.4% 4.5%,${GCCversion}),) +--- ./perl/polymake-config.orig 2013-08-14 13:17:08.000000000 -0600 ++++ ./perl/polymake-config 2013-08-14 14:26:36.000000000 -0600 @@ -126,9 +126,6 @@ while (defined ($_=shift)) { } elsif ($_ eq "--ldflags") { @@ -46,46 +32,106 @@ @@ -146,8 +143,6 @@ while (defined ($_=shift)) { close CC; if ($^O eq "darwin") { - $ldflags="$conf{ARCHFLAGS} $ldflags"; + $ldflags="$conf{ARCHFLAGS} $ldflags -flat_namespace"; - } elsif ($add_rpath) { - $ldflags.=" -Wl,-rpath,$conf{InstallLib}"; } $ldflags=~s/^\s+//; $ldflags=~s/\s+$//; $ldflags=~s/\s{2,}/ /g; if ($debug_asked=defined($debug)) { ---- ./support/corelib.make.orig 2012-03-02 15:37:49.000000000 -0700 -+++ ./support/corelib.make 2013-02-27 15:10:34.340168780 -0700 -@@ -90,7 +90,9 @@ ${CoreLib} : ${SharedObjects} ${Standalo - ifneq (${LDcallableFlags},none) - # no explicit dependence on XSObjects here because they are built in compile-xs using the Makefile generated by xsubpp - ${CallableLib} : ${SharedObjects} ${CallableSharedObjects} ${GlueObjects} ${CallableGlueObjects} ${XXSObjects} $(patsubst %,${SourceDir}/perl/%.xs,${XSModules}) -- ${CXX} ${LDcallableFlags} -o $@ ${SharedObjects} ${CallableSharedObjects} ${GlueObjects} ${CallableGlueObjects} ${XXSObjects} ${XSObjects} ${LDFLAGS} ${PERLccdlflags} -lmpfr -lgmp ${LIBXML2_LIBS} ${LIBS} -L${PERLarchlib}/CORE -lperl -+ ${CXX} ${LDcallableFlags} -o ${PerlExtDir}/libpolymake.so.@VERSION@ ${SharedObjects} ${CallableSharedObjects} ${GlueObjects} ${CallableGlueObjects} ${XXSObjects} ${XSObjects} ${LDFLAGS} ${PERLccdlflags} -Wl,-h,libpolymake.so.@MAJVER@ -lmpfr -lgmp ${LIBXML2_LIBS} ${LIBS} -L${PERLarchlib}/CORE -lperl -+ ln -s libpolymake.so.@VERSION@ ${PerlExtDir}/libpolymake.so.@MAJVER@ -+ ln -s libpolymake.so.@MAJVER@ $@ - else - ${CallableLib} : ${GlueObjects} ${XXSObjects} $(patsubst %,${SourceDir}/perl/%.xs,${XSModules}) +--- ./bundled/group/apps/polytope/src/Makefile.inc.orig 2013-08-14 13:17:11.000000000 -0600 ++++ ./bundled/group/apps/polytope/src/Makefile.inc 2013-08-14 14:26:36.000000000 -0600 +@@ -1,10 +1,10 @@ + ifeq (${ImportedIntoExtension},) + StaticLibs := sympol + +- sympol_interface$O : ExtraCXXFLAGS += -I${ExtensionTop}/external/sympol +- sympol_raycomputation_beneathbeyond$O : ExtraCXXFLAGS += -I${ExtensionTop}/external/sympol ++ sympol_interface$O : ExtraCXXFLAGS += -I/usr/include/sympol ++ sympol_raycomputation_beneathbeyond$O : ExtraCXXFLAGS += -I/usr/include/sympol + +- LIBS += ${BuildDir}/staticlib/sympol/libsympol$A ${BuildDir}/../../staticlib/cdd/libcddgmp$A ++ LIBS += -lsympol -lcddgmp endif ---- ./support/configure.pl.orig 2012-03-02 02:26:14.000000000 -0700 -+++ ./support/configure.pl 2013-02-27 15:10:34.340168780 -0700 -@@ -488,10 +488,6 @@ if (defined $GMP) { + + # Local Variables: +--- ./bundled/group/configure.pl.orig 2013-08-14 13:17:11.000000000 -0600 ++++ ./bundled/group/configure.pl 2013-08-14 14:26:36.000000000 -0600 +@@ -29,7 +29,7 @@ sub proceed { + my ($options)=@_; + my $boost_path; + # everything can include permlib headers +- $CXXflags='-I${ExtensionTop}/external/permlib/include'; ++ $CXXflags='-I/usr/include/permlib'; + + if (defined ($boost_path=$options->{boost})) { + $boost_path .= '/include' if (-d "$boost_path/include/boost"); +--- ./bundled/group/staticlib/sympol/Makefile.inc.orig 2013-08-14 13:17:11.000000000 -0600 ++++ ./bundled/group/staticlib/sympol/Makefile.inc 2013-08-14 14:26:36.000000000 -0600 +@@ -4,7 +4,7 @@ src := $(ExtensionTop)/external/sympol/s + + vpath %.cpp $(src) + +-libsympol : ExtraCXXFLAGS := -I$(ExtensionTop)/external/permlib/include -I$(ExtensionTop)/external/sympol/sympol -I$(ProjectTop)/external/lrs -DGMP -DLRS_QUIET -DGMPRATIONAL -I$(ProjectTop)/external/cdd/lib-src-gmp $(call addinclude, $(ProjectTop)/staticlib/cdd/globals_gmp.h) ++libsympol : ExtraCXXFLAGS := -I/usr/include/permlib -I/usr/include/sympol -I/usr/include/lrslib -DGMP -DLRS_QUIET -DGMPRATIONAL -I/usr/include/cddlib $(call addinclude, $(ProjectTop)/staticlib/cdd/globals_gmp.h) + + # Local Variables: + # mode: Makefile +--- ./support/configure.pl.orig 2013-08-14 13:17:10.000000000 -0600 ++++ ./support/configure.pl 2013-08-14 14:26:59.000000000 -0600 +@@ -372,7 +372,7 @@ if (defined $CC) { + print "ok ($CXX is ", defined($GCCversion) ? "GCC $GCCversion" : defined($CLANGversion) ? "CLANG $CLANGversion" : "ICC $ICCversion", ")\n"; + + $PERL =$vars{PERL} || $^X; +-$CXXOPT =$vars{CXXOPT} || "-O3"; ++$CXXOPT =$vars{CXXOPT} || "-O2"; + $CXXDEBUG =$vars{CXXDEBUG} || ""; + $Cflags =$vars{CFLAGS} || ""; + $CXXflags =$vars{CXXFLAGS} || $Cflags; +@@ -557,10 +557,6 @@ if (defined $GMP) { $CXXflags .= " -I$GMP/include"; my $libdir=get_libdir($GMP, "gmp"); $LDflags .= " -L$libdir"; -- if ( !$WithFink && exists $options{gmp}) { # this does not work for Mac OS 10.4 +- if (($^O ne "darwin" || $options{fink} eq ".none.") && exists $options{gmp}) { - # non-standard location - $LDflags .= " -Wl,-rpath,$libdir"; - } } my $MPFR=$options{mpfr}; -@@ -500,10 +496,6 @@ if (defined($MPFR) && $MPFR ne $GMP) { +@@ -569,10 +565,6 @@ if (defined($MPFR) && $MPFR ne $GMP) { $CXXflags .= " -I$MPFR/include"; my $libdir=get_libdir($MPFR, "mpfr"); $LDflags .= " -L$libdir"; -- if ( !$WithFink ) { # this does not work for Mac OS 10.4 +- if ($^O ne "darwin" || $options{fink} eq ".none.") { - # non-standard location - $LDflags .= " -Wl,-rpath,$libdir"; - } } - my $BOOST=$options{boost}; + if ($check_prereq) { +--- ./staticlib/cdd/Makefile.inc.orig 2013-08-14 13:17:11.000000000 -0600 ++++ ./staticlib/cdd/Makefile.inc 2013-08-14 16:09:08.000000000 -0600 +@@ -1,6 +1,3 @@ +-OwnLibraries := libcdd libcddgmp +-LibModules := cddio cddmp cddlib cddcore cddlp cddproj setoper +- + ExtraCFLAGS := -fvisibility=hidden + + ifeq "$(MAKECMDGOALS)" "libcdd" +@@ -8,8 +5,6 @@ ifeq "$(MAKECMDGOALS)" "libcdd" + else + src := $(ProjectTop)/external/cdd/lib-src-gmp + +- LibModules := $(LibModules) $(patsubst cdd%,cdd%_f,$(LibModules)) +- + $(addsuffix $(LO), $(LibModules)) : $(SourceDir)/globals_gmp.h + + libcddgmp : ExtraCFLAGS += -DGMPRATIONAL $(call addinclude, $(SourceDir)/globals_gmp.h) +--- ./staticlib/lrs/Makefile.inc.orig 2013-08-14 13:17:11.000000000 -0600 ++++ ./staticlib/lrs/Makefile.inc 2013-08-14 16:09:21.000000000 -0600 +@@ -1,5 +1,3 @@ +-OwnLibraries := liblrsgmp +-LibModules := lrslib lrsgmp + src := $(ProjectTop)/external/lrs + vpath %.c $(src) + diff --git a/polymake-perl.patch b/polymake-perl.patch deleted file mode 100644 index 954eb3d..0000000 --- a/polymake-perl.patch +++ /dev/null @@ -1,343 +0,0 @@ ---- ./lib/core/src/perl/Struct.xs.orig 2011-12-20 17:47:59.000000000 -0700 -+++ ./lib/core/src/perl/Struct.xs 2013-01-10 09:48:02.893665535 -0700 -@@ -223,13 +223,6 @@ OP* pp_method_call(pTHX) - return Perl_pp_method_named(aTHX); - } - --static inline --OP* method_named_op(OP *o) --{ -- return ((o->op_flags & OPf_KIDS) && -- (o=cUNOPo->op_first->op_sibling) && (o=o->op_sibling) && o->op_type == OP_METHOD_NAMED) ? o : 0; --} -- - static - OP* intercept_ck_aassign(pTHX_ OP* o) - { -@@ -238,7 +231,10 @@ OP* intercept_ck_aassign(pTHX_ OP* o) - lhs=cUNOPo->op_first->op_sibling; - if (lhs->op_type == OP_NULL) lhs=cUNOPx(lhs)->op_first; - while (lhs) { -- if (lhs->op_type == OP_ENTERSUB) lhs->op_private |= OPpENTERSUB_AASSIGN_LHS; -+ if (lhs->op_type == OP_ENTERSUB) { -+ OP* meth_op=method_named_op(lhs); -+ if (meth_op) meth_op->op_private |= MethodIsCalledOnLeftSideOfArrayAssignment; -+ } - lhs=lhs->op_sibling; - } - return o; -@@ -410,7 +406,7 @@ PPCODE: - o->op_ppaddr=&pp_method_call; - break; - default: -- o->op_ppaddr= PL_op->op_private & OPpENTERSUB_AASSIGN_LHS ? &pp_access : &pp_method_access; -+ o->op_ppaddr= (o->op_private & MethodIsCalledOnLeftSideOfArrayAssignment) ? &pp_access : &pp_method_access; - break; - } - } else { -@@ -425,7 +421,7 @@ PPCODE: - } - switch (next_op->op_type) { - default: -- if (!(o ? o->op_ppaddr == &pp_access : PL_op->op_private & OPpENTERSUB_AASSIGN_LHS)) { -+ if (!(o && o->op_ppaddr == &pp_access)) { - PUSHs(find_method(aTHX_ index, 0)); - break; - } ---- ./lib/core/src/perl/Object.xs.orig 2011-12-20 17:47:59.000000000 -0700 -+++ ./lib/core/src/perl/Object.xs 2013-01-10 09:41:58.985884887 -0700 -@@ -58,8 +58,12 @@ PPCODE: - PUSHs(AvARRAY(descr)[2]); - } - o->op_ppaddr=&Perl_pp_null; -+#if PerlVersion >= 5160 -+ /* remove the LVALUE flag */ -+ PL_op->op_private &= ~OPpLVAL_INTRO; -+#endif - -- } else if (PL_op->op_private & OPpENTERSUB_AASSIGN_LHS) { -+ } else if ((o=method_named_op(PL_op), o && (o->op_private & MethodIsCalledOnLeftSideOfArrayAssignment))) { - if (hide_args) Perl_croak(aTHX_ "unexpected scalar context within list assignment"); - EXTEND(SP,items+3); - /* AASSIGN expects two marks: the topmost delimits the lvalues, the next below it - the rvalues */ -@@ -69,6 +73,10 @@ PPCODE: - PUSHs(prop); - PUSHs(rhs); - PUSHs(AvARRAY(descr)[2]); -+#if PerlVersion >= 5160 -+ /* remove the LVALUE flag */ -+ PL_op->op_private &= ~OPpLVAL_INTRO; -+#endif - - } else { - EXTEND(SP,items+2+hide_args); ---- ./lib/core/src/perl/RefHash.xs.orig 2011-12-20 17:47:59.000000000 -0700 -+++ ./lib/core/src/perl/RefHash.xs 2013-01-10 09:46:13.844168283 -0700 -@@ -666,7 +666,11 @@ OP* check_pushhv(pTHX_ OP *o) - kid = kid->op_sibling; - if (kid->op_type == OP_RV2HV || kid->op_type == OP_PADHV) { - int arg_cnt=2; -+#if PerlVersion >= 5160 -+ op_lvalue(kid, o->op_type); -+#else - Perl_mod(aTHX_ kid, o->op_type); -+#endif - while ((kid=kid->op_sibling)) { - if (kid->op_type == OP_RV2HV || kid->op_type == OP_PADHV) { - Perl_list(aTHX_ kid); ---- ./lib/core/src/perl/Poly.xs.orig 2011-12-20 17:47:59.000000000 -0700 -+++ ./lib/core/src/perl/Poly.xs 2013-01-10 09:45:36.412035674 -0700 -@@ -91,6 +91,26 @@ OP* pp_first(pTHX) - RETURN; - } - -+#if PerlVersion >= 5160 -+static -+OP* safe_magic_lvalue_return_op(pTHX) -+{ -+ if (cxstack[cxstack_ix].blk_gimme==G_SCALAR) { -+ dSP; -+ OP* next_op; -+ SV* retval=TOPs; -+ U32 retval_flags= SvTEMP(retval) && SvREFCNT(retval)==1 ? SvMAGICAL(retval) : 0; -+ if (retval_flags) { -+ SvMAGICAL_off(retval); -+ next_op=Perl_pp_leavesub(aTHX); -+ SvFLAGS(retval) |= retval_flags; -+ return next_op; -+ } -+ } -+ return Perl_pp_leavesub(aTHX); -+} -+#endif -+ - MGVTBL pm_perl_array_flags_vtbl={ 0, 0, 0, 0, 0 }; - - static inline -@@ -255,7 +275,7 @@ PPCODE: - else - PUSHs(&PL_sv_no); - } else if (CvFLAGS(sub) & CVf_LVALUE) { -- if (!CvXSUB(sub) && CvROOT(sub)->op_type==OP_LEAVESUBLV) -+ if (!CvISXSUB(sub) && CvROOT(sub)->op_type==OP_LEAVESUBLV) - PUSHs(&PL_sv_no); /* not faked */ - else - PUSHs(&PL_sv_yes); -@@ -271,12 +291,21 @@ CODE: - { - CV *sub; - if (!SvROK(subref) || (sub=(CV*)SvRV(subref), SvTYPE(sub) != SVt_PVCV)) -- croak_xs_usage(cv, "\\&sub"); -+ croak_xs_usage(cv, "\\&sub [, TRUE_if_faked ]"); - CvFLAGS(sub) |= CVf_LVALUE | CVf_NODEBUG; -- if (!CvXSUB(sub) && (items==1 || !SvTRUE(ST(1)))) { -+ if (!CvISXSUB(sub)) { - OP *leave_op=CvROOT(sub); -- leave_op->op_type=OP_LEAVESUBLV; -- leave_op->op_ppaddr=PL_ppaddr[OP_LEAVESUBLV]; -+ if (items==1 || !SvTRUE(ST(1))) { -+ /* not faked */ -+ leave_op->op_type=OP_LEAVESUBLV; -+ leave_op->op_ppaddr=PL_ppaddr[OP_LEAVESUBLV]; -+ } -+#if PerlVersion >= 5160 -+ else { -+ /* nowadays perl is fond of copying return values if they show any magic */ -+ leave_op->op_ppaddr=&safe_magic_lvalue_return_op; -+ } -+#endif - } - } - -@@ -682,8 +711,7 @@ is_real_code(x) - PROTOTYPE: $ - PPCODE: - { -- if (SvROK(x) && (x=SvRV(x), SvTYPE(x) == SVt_PVCV) -- && (CvROOT((CV*)x) || CvXSUB((CV*)x))) -+ if (SvROK(x) && (x=SvRV(x), SvTYPE(x) == SVt_PVCV) && IsWellDefinedSub((CV*)x)) - return; /* keep the CV reference on the stack */ - XSRETURN_NO; - } -@@ -874,9 +902,7 @@ if (!SvROK(sub) || - if (SvTYPE(glob) != SVt_PVGV) - gv_init(glob, pkg_stash, name, namelen, GV_ADDMULTI); - -- if ((flags & 2) && -- (was_here=GvCV(glob)) && -- (CvROOT(was_here) || (CvXSUB(was_here)))) { -+ if ((flags & 2) && (was_here=GvCV(glob)) && IsWellDefinedSub(was_here)) { - if (GIMME_V != G_VOID) - PUSHs(sv_2mortal(newRV((SV*)was_here))); - -@@ -885,7 +911,7 @@ if (!SvROK(sub) || - if (CvANON(sub)) { - CvANON_off(sub); - CvGV_set((CV*)sub, glob); -- if (!CvXSUB(sub)) { -+ if (!CvISXSUB(sub)) { - SV *file=CopFILESV((COP*)CvSTART(sub)); - if (file && (!SvOK(file) || !SvPVX(file) || !strncmp(SvPVX(file), "(eval ", 6))) - sv_setpvf(file, "(%s::%.*s)", HvNAME(pkg_stash), (int)namelen, name); ---- ./lib/core/src/perl/createBootstrap.pl.orig 2011-10-30 16:36:53.000000000 -0600 -+++ ./lib/core/src/perl/createBootstrap.pl 2013-01-10 09:48:34.960079680 -0700 -@@ -1,6 +1,6 @@ --# Copyright (c) 1997-2011 -+# Copyright (c) 1997-2012 - # Ewgenij Gawrilow, Michael Joswig (Technische Universitaet Darmstadt, Germany) --# http://www.polymake.de -+# http://www.polymake.org - # - # This program is free software; you can redistribute it and/or modify it - # under the terms of the GNU General Public License as published by the -@@ -27,7 +27,7 @@ foreach my $file (@ARGV) { - open my $C, $file or die "can't read $file: $!\n"; - my $ugly_cast= $] <= 5.008 && "(char*)"; - while (<$C>) { -- if (/^XS\((boot_(\w+))\);/) { -+ if (/^XS(?:_EXTERNAL)?\((boot_(\w+))\);/) { - $proto .= "$&\n"; - my $func=$1; - (my $pkg=$2) =~ s/_/:/g; ---- ./lib/core/src/perl/Ext.xs.orig 2011-12-20 17:47:59.000000000 -0700 -+++ ./lib/core/src/perl/Ext.xs 2013-01-10 09:40:42.551339010 -0700 -@@ -33,7 +33,11 @@ SV** pm_perl_get_cx_curpad(pTHX_ PERL_CO - goto FOUND; - case CXt_EVAL: - if (!CxTRYBLOCK(cx)) { -+#if PerlVersion >= 5120 -+ cv=cx->blk_eval.cv; -+#else - cv=PL_compcv; -+#endif - d=0; - goto FOUND; - } ---- ./lib/core/src/perl/CPlusPlus.xxs.orig 2011-12-20 17:47:59.000000000 -0700 -+++ ./lib/core/src/perl/CPlusPlus.xxs 2013-01-10 09:39:42.369023533 -0700 -@@ -479,7 +479,7 @@ SV* clone_assoc_container_magic_sv(pTHX_ - - int canned_container_access(pTHX_ SV *sv, MAGIC* mg, SV *nsv, const char *dummy, PM_svt_copy_klen_arg index) - { -- OPCODE opc=PL_op->op_type; -+ const OPCODE opc=PL_op ? PL_op->op_type : OP_AELEM; // assume a plain array access when called directly from the callable library - const container_vtbl* const t=(const container_vtbl*)mg->mg_virtual; - char *obj=mg->mg_ptr, *it; - const container_access_vtbl *acct=t->acc+(mg->mg_flags & value_read_only); ---- ./lib/core/src/perl/namespaces.xs.orig 2011-12-20 17:47:59.000000000 -0700 -+++ ./lib/core/src/perl/namespaces.xs 2013-01-10 09:50:40.332136877 -0700 -@@ -697,7 +697,7 @@ GV* try_stored_lexical_gv(pTHX_ GV *var_ - break; - case SVt_PVCV: { - CV *cv=GvCV(imp_gv); -- if (cv && (CvROOT(cv) || CvXSUB(cv))) return imp_gv; -+ if (cv && IsWellDefinedSub(cv)) return imp_gv; - }} - } - } -@@ -779,7 +779,7 @@ GV* test_imported_gv(GV *gv, I32 type, i - if (ignore_methods && CvMETHOD(cv)) - /* may not discover methods in object-less call */ - return (GV*)-1UL; -- if (CvROOT(cv) || CvXSUB(cv) || GvASSUMECV(gv)) -+ if (IsWellDefinedSub(cv) || GvASSUMECV(gv)) - /* If only promised - let's try later, or die if the next op is ENTERSUB. - For inherited static methods return the gv from the basis class! */ - return GvCVGEN(gv) ? CvGV(cv) : gv; -@@ -823,7 +823,7 @@ GV* lookup_name_in_list(pTHX_ HV *stash, - if (dotLOOKUP && (lookp=AvARRAY(dotLOOKUP))) { - for (endp=lookp+AvFILLp(dotLOOKUP); lookp<=endp; ++lookp) - if ((imp_gv=lookup_name_in_stash(aTHX_ (HV*)SvRV(*lookp), name, namelen, type, ignore_methods))) { -- if (type != SVt_PVCV || CvROOT(GvCV(imp_gv)) || CvXSUB(GvCV(imp_gv))) { -+ if (type != SVt_PVCV || IsWellDefinedSub(GvCV(imp_gv))) { - if (!var_gv) { - var_gv=*(GV**)hv_fetch(stash, name, namelen, TRUE); - if (SvTYPE(var_gv) != SVt_PVGV) -@@ -1227,7 +1227,7 @@ OP* intercept_pp_gv(pTHX) - lookup(aTHX_ var_gv, SVt_PVHV, &next_op, next_op); - break; - case OP_RV2CV: -- if ((cv=GvCV(var_gv)) && (next_op->op_next->op_type != OP_REFGEN || CvROOT(cv) || CvXSUB(cv))) -+ if ((cv=GvCV(var_gv)) && (next_op->op_next->op_type != OP_REFGEN || IsWellDefinedSub(cv))) - break; - lookup(aTHX_ var_gv, SVt_PVCV, &next_op, 0); - break; -@@ -1354,7 +1354,13 @@ OP* intercept_pp_aelemfast(pTHX) - { - OP *next_op=PL_op; - next_op->op_ppaddr=def_pp_AELEMFAST; -- if (!(next_op->op_flags & OPf_SPECIAL)) { -+#if PerlVersion < 5150 -+ if (!(next_op->op_flags & OPf_SPECIAL)) -+#else -+ /* since perl 5.16 AELEMFAST_LEX is a separate op */ -+ if (next_op->op_type != OP_AELEMFAST_LEX) -+#endif -+ { - GV *var_gv=cGVOP_gv; - const char *name; - if (!GvIMPORTED_AV(var_gv)) { ---- ./lib/core/include/perl/Ext.h.orig 2011-12-20 17:47:59.000000000 -0700 -+++ ./lib/core/include/perl/Ext.h 2013-01-10 09:37:30.278808742 -0700 -@@ -1,6 +1,6 @@ --/* Copyright (c) 1997-2011 -+/* Copyright (c) 1997-2012 - Ewgenij Gawrilow, Michael Joswig (Technische Universitaet Darmstadt, Germany) -- http://www.polymake.de -+ http://www.polymake.org - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the -@@ -67,6 +67,8 @@ EXTERN_C AV* Perl_av_fake(pTHX_ I32 size - - #if PerlVersion >= 5100 - # define ReturnsToOp(cx) (cx)->blk_sub.retop -+/* CvROOT and CvXSUB are in the same union */ -+# define IsWellDefinedSub(x) (CvROOT(x)) - # define PL_lex_brackets (PL_parser->lex_brackets) - # define PL_lex_state (PL_parser->lex_state) - # define PL_lex_inwhat (PL_parser->lex_inwhat) -@@ -81,6 +83,7 @@ EXTERN_C AV* Perl_av_fake(pTHX_ I32 size - # define PL_nextval (PL_parser->nextval) - #else - # define ReturnsToOp(cx) PL_retstack[(cx)->blk_oldretsp-1] -+# define IsWellDefinedSub(x) (CvROOT(x) || CvXSUB(x)) - # ifndef SvRV_set - # define SvRV_set(ref,what) SvRV(ref)=(what) - # endif -@@ -134,8 +137,8 @@ EXTERN_C AV* Perl_av_fake(pTHX_ I32 size - #define LEX_KNOWNEXT 0 - #define LEX_NORMAL 10 - --/* check whether this private flag is free for each new perl release */ --#define OPpENTERSUB_AASSIGN_LHS 1 -+/* check whether this private flag is not used in OP_METHOD_NAMED for each new perl release */ -+#define MethodIsCalledOnLeftSideOfArrayAssignment 1 - - START_EXTERN_C - -@@ -191,6 +194,13 @@ void write_protect_off(pTHX_ SV *x) - { - if (x != &PL_sv_undef) SvREADONLY_off(x); - } -+ -+/* for given OP_ENTERSUB, find the corresponding OP_METHOD_NAMED, or return NULL */ -+static inline -+OP* method_named_op(OP *o) -+{ -+ return ((o->op_flags & OPf_KIDS) && (o=cLISTOPo->op_last) && o->op_type == OP_METHOD_NAMED) ? o : 0; -+} - #endif - - static inline ---- ./lib/callable/src/perl/Main.cc.orig 2012-01-11 07:07:49.000000000 -0700 -+++ ./lib/callable/src/perl/Main.cc 2013-01-10 09:38:15.750704364 -0700 -@@ -70,7 +70,7 @@ void emergency_cleanup() - # define addlibs "" - #endif - #if POLYMAKE_DEBUG --# define scr_debug1 "$DebugLevel=1;" -+# define scr_debug1 "$DebugLevel=1; $DB::single=1;" - # define scr_debug2 "sub stop_here { print STDERR \"@_\\n\" if @_ } my $loaded=1;\n" - #else - # define scr_debug1 "" diff --git a/polymake.spec b/polymake.spec index 0d5b199..9e5d9cc 100644 --- a/polymake.spec +++ b/polymake.spec @@ -1,20 +1,30 @@ +# FIXME: polymake supposedly has Singular support, but it needs an older +# version of Singular than we have in Fedora. See if it can be ported to the +# newer version with moderate effort. + # TESTING NOTE: "make test" does not work, because the test drivers are not # distributed with the released sources. A Subversion repository containing # all of the sources, including the test drivers, was made available recently. # Once the next release of polymake occurs, we will extract the necessary test # drivers from subversion and produce a check script. -# Release candidates are sometimes promoted to release without removing the tag -%global rctag -rc3 +# Date of the "perpetual beta" subversion snapshot +%global svndate 20130813 Name: polymake Version: 2.12 -Release: 9%{?dist} +Release: 10.svn%{svndate}%{?dist} Summary: Algorithms on convex polytopes and polyhedra License: GPLv2+ URL: http://polymake.org/ -Source0: http://polymake.org/lib/exe/fetch.php/download/%{name}-%{version}%{rctag}.tar.bz2 +#Source0: http://polymake.org/lib/exe/fetch.php/download/%%{name}-%%{version}%%{rctag}.tar.bz2 +# Sources taken from the polymake "perpetual beta". Create the tarball thusly: +# svn checkout --username "guest" --password "" http://polymake.mathematik.tu-darmstadt.de/svn/polymake/snapshots/%{svndate} polymake-%{version} +# rm -fr polymake-%{version}/.svn polymake-%{version}/external/{cdd,lrs} +# rm -fr polymake-%{version}/bundled/jreality/external/jreality/.svn +# tar cjf polymake-%{version}.tar.bz2 polymake-%{version} +Source0: %{name}-%{version}.tar.bz2 # Man page written by Jerry James from text found in the sources. Therefore, # the copyright and license are the same as for the sources. Source1: %{name}.1 @@ -22,17 +32,14 @@ Source1: %{name}.1 # against existing system libraries instead of building them from source, # and do not use -rpath. Patch0: %{name}-fedora.patch -# This patch was sent upstream 1 Mar 2012. Polymake uses nauty, which has a -# non-free license. This patch converts polymake to bliss, which is free. -Patch1: %{name}-bliss.patch -# Patch from upstream: adapt the sources to perl >= 5.15. -Patch2: %{name}-perl.patch # This patch was sent upstream 20 Mar 2013. Fix a call to an lrslib function # that segfaults when given a NULL argument. -Patch3: %{name}-lrslib.patch +Patch1: %{name}-lrslib.patch BuildRequires: bliss-devel +BuildRequires: boost-devel BuildRequires: cddlib-devel +BuildRequires: cmake BuildRequires: libxml2-devel BuildRequires: lrslib-devel BuildRequires: mpfr-devel @@ -105,37 +112,28 @@ This package contains documentation for %{name}. %setup -q %patch0 %patch1 -%patch2 -%patch3 # Make sure we don't build against the bundled libraries. -# Don't delete the jreality directory, though, or the installer crashes. -rm -fr external/{cdd,lrs,nauty,permlib,sympol} - -# Don't force -O3 -sed -i "s/-O3//" support/configure.pl - -# Give the main library an soname (markers added by the -libs patch) -sed -i "s/@VERSION@/%{sover}/;s/@MAJVER@/%{major}/" support/corelib.make +rm -fr external/{cdd,lrs} # Adapt to a newer version of sympol sed -i "s|yal/||;s|symmetrygroupconstruction/||" \ - apps/polytope/src/sympol_interface.cc + bundled/group/apps/polytope/src/sympol_interface.cc %build -export CFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/eigen3" -export CXXFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/eigen3" +export CFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/eigen3 -Wno-unused-local-typedefs" +export CXXFLAGS="$CFLAGS" export LDFLAGS="$RPM_LD_FLAGS -Wl,--as-needed" export Arch=%{_arch} # NOT an autoconf-generated configure script; do not use %%configure. ./configure --build=%{_arch} --prefix=%{_prefix} --libdir=%{_libdir} \ - --libexecdir=%{polydir} --without-java + --libexecdir=%{polydir} --without-java --without-javaview make %{?_smp_mflags} all # Help the debuginfo generator find generated files cd build.%{_arch} -cp -p perlx-*linux-*/CPlusPlus.xxs lib/CPlusPlus.xxs -cp -p perlx-*linux-*/CPlusPlus.cc lib/CPlusPlus.xxs.c +cp -p perlx-*linux-*/CPlusPlus.xxs lib/core/CPlusPlus.xxs +cp -p perlx-*linux-*/CPlusPlus.cc lib/core/CPlusPlus.cc %install # Don't recompile the main library with DESTDIR compiled in @@ -158,12 +156,6 @@ make %{?_smp_mflags} all chmod 0755 %{buildroot}%{polydir}/lib/*.so cp -p build.%{_arch}/lib/*.so %{buildroot}%{polydir}/lib -# Fix up the shared library links -mv %{buildroot}%{_libdir}/lib%{name}.so \ - %{buildroot}%{_libdir}/lib%{name}.so.%{version} -ln -s lib%{name}.so.%{version} %{buildroot}%{_libdir}/lib%{name}.so.%{major} -ln -s lib%{name}.so.%{major} %{buildroot}%{_libdir}/lib%{name}.so - # Install the man page mkdir -p %{buildroot}%{_mandir}/man1 sed "s/@VERSION@/%{version}/" %{SOURCE1} > %{buildroot}%{_mandir}/man1/%{name}.1 @@ -183,15 +175,18 @@ chmod 0755 %{buildroot}%{_bindir}/* chmod 0755 %{buildroot}%{_libdir}/lib* find %{buildroot}%{polydir} -name \*.so | xargs chmod 0755 +# Remove the buildroot from configuration files +sed -i 's,%{buildroot},,' %{buildroot}%{polydir}/bundled/bliss/conf.make +sed -i 's,%{buildroot},,' %{buildroot}%{polydir}/bundled/group/conf.make + %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files -%doc COPYING %{_bindir}/%{name} %{_mandir}/man1/%{name}.1* -%{_libdir}/lib%{name}.so.* +%{_libdir}/lib%{name}*.so.* %{polydir}/ %{_datadir}/%{name}/ %exclude %{_datadir}/%{name}/lib/ @@ -200,12 +195,15 @@ find %{buildroot}%{polydir} -name \*.so | xargs chmod 0755 %{_bindir}/%{name}-config %{_includedir}/%{name}/ %{_datadir}/%{name}/lib/ -%{_libdir}/lib%{name}.so +%{_libdir}/lib%{name}*.so %files doc %doc doc/* %changelog +* Wed Aug 14 2013 Jerry James - 2.12-10.svn20130813 +- Update to latest "perpetual beta" for perl 5.18 compatibility (bz 992813) + * Sun Aug 04 2013 Fedora Release Engineering - 2.12-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild diff --git a/sources b/sources index d6b3ca6..96e63bc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -f07ecafc7a946001c38cdd20e6434b09 polymake-2.12-rc3.tar.bz2 +d7bd05a247d2991aef7a2d4e0ed0cdd0 polymake-2.12.tar.bz2