...
 
Commits (9)
Changelog
=== Polymake 3.2r4 ===
-- distribution --
* several small bug fixes
* support for lrslib 070
* fix order in config.ninja for reproducibility
-- graph --
* fix edge number of permuted graphs
-- polytope --
* vertex_figure: correct intermediate LP
* BOUNDED_COMPLEX: correct ADJACENCY
* normaliz interface: two minor fixes
* Cone-VISUAL: fix incidences
* tensor: dont compare example output
(order depends on cdd version)
=== Polymake 3.2r3 ===
-- distribution --
* small bug fixes
* threejs is the default viewer if jreality is not configured
* support for java 10
* adapt to changes in boost 1.67
* fix for JuPyMake support on Mac OS X
* removed fink as the default package manager for Mac OS X
* included support for the brew package manager on Mac OS X
=== Polymake 3.2r2 ===
-- distribution --
......
The step-by-step installation instructions can be found on the
polymake Wiki site:
http://www.polymake.org/polymake/doku.php/howto/install
https://www.polymake.org/doku.php/howto/install
The shortest possible summary for the truly impatient:
......
......@@ -19,7 +19,10 @@ use feature 'state';
prefer threejs
prefer svg.lattice
if (application::self()->configured->{"svg.rules"} > 0) {
prefer svg.lattice
}
$ThreeJS::is_used_in_jupyter=1;
......
......@@ -97,6 +97,8 @@ sub append {
# Create a three.js file.
label threejs
prefer threejs
# The following are rarely used.
# Much more common are the methods in apps/{graph,polytope,...}/rules/threejs.rules
......
......@@ -29,5 +29,6 @@ namespace polymake { namespace common { namespace {
};
FunctionInstance4perl(permuted_inv_nodes_X_X, perl::Canned< const Graph< Undirected > >, perl::Canned< const Array< int > >);
FunctionInstance4perl(permuted_inv_nodes_X_X, perl::Canned< const Graph< Directed > >, perl::Canned< const Array< int > >);
///==== Automatically generated contents end here. Please do not delete this line. ====
} } }
......@@ -51,12 +51,17 @@ property BOUNDED_COMPLEX : PolyhedralComplex<Scalar> {
rule BOUNDED_COMPLEX.GRAPH.NodePerm.PERMUTATION = VertexPerm.PERMUTATION;
rule BOUNDED_COMPLEX.GRAPH.ADJACENCY : GRAPH.ADJACENCY, FAR_FACE, BOUNDED, BOUNDED_COMPLEX.VERTEX_MAP, N_VERTICES {
$this->BOUNDED_COMPLEX->GRAPH->ADJACENCY= $this->BOUNDED ? $this->GRAPH->ADJACENCY :
permuted_inv_nodes( new props::Graph(induced_subgraph($this->GRAPH->ADJACENCY, ~ $this->FAR_FACE)), map_vertices_down($this->BOUNDED_COMPLEX->VERTEX_MAP, $this->N_VERTICES) );
rule BOUNDED_COMPLEX.GRAPH.ADJACENCY : GRAPH.ADJACENCY, FAR_FACE, BOUNDED_COMPLEX.VERTEX_MAP, N_VERTICES {
my $g = permuted_inv_nodes( new props::Graph(induced_subgraph($this->GRAPH->ADJACENCY, ~ $this->FAR_FACE)), map_vertices_down($this->BOUNDED_COMPLEX->VERTEX_MAP, $this->N_VERTICES) );
$g->squeeze;
$this->BOUNDED_COMPLEX->GRAPH->ADJACENCY = $g;
}
precondition : !BOUNDED;
weight 1.20;
rule BOUNDED_COMPLEX.GRAPH.ADJACENCY = GRAPH.ADJACENCY;
precondition : BOUNDED;
rule BOUNDED_COMPLEX.GRAPH.EDGE_COLORS : BOUNDED_COMPLEX.MAXIMAL_POLYTOPES_COMBINATORIAL_DIMS, BOUNDED_COMPLEX.MAXIMAL_POLYTOPES, BOUNDED_COMPLEX.GRAPH.ADJACENCY, BOUNDED_COMPLEX.GRAPH.N_EDGES {
polytope::edge_colored_bounded_graph($this->BOUNDED_COMPLEX->MAXIMAL_POLYTOPES_COMBINATORIAL_DIMS,
$this->BOUNDED_COMPLEX->MAXIMAL_POLYTOPES,
......
......@@ -523,14 +523,14 @@ user_method VISUAL(%Visual::Polygons::decorations, {CutOff => $Visual::Color::cu
my $all_ones=ones_vector<Float>($this->N_RAYS+1);
my $v= $all_ones | ($rays / $zero);
my $vif=new IncidenceMatrix($this->FACETS_THRU_RAYS->rows()+1,$this->N_RAYS+1);
$vif->minor(~[$this->FACETS_THRU_RAYS->rows()],~[$this->RAYS->rows()])=$this->FACETS_THRU_RAYS;
for(my $j=0; $j < $vif->rows()-1;++$j){
$vif->row($j) += $this->RAYS->rows();
my $ftv=new IncidenceMatrix($this->FACETS_THRU_RAYS->rows()+1,$this->N_RAYS+1);
$ftv->minor(~[$this->FACETS_THRU_RAYS->rows()],~[$this->RAYS->rows()])=$this->FACETS_THRU_RAYS;
for(my $j=0; $j < $ftv->rows()-1;++$j){
$ftv->row($j) += $this->RAYS->rows();
}
$vif->row($this->FACETS_THRU_RAYS->rows()) += new Set(0..$this->RAYS->rows()-1);
$ftv->row($this->FACETS_THRU_RAYS->rows()) += new Set(0..$this->RAYS->rows()-1);
my $p=new polytope::Polytope<Float>(VERTICES => $v, LINEALITY_SPACE => zero_vector<Float>() | $lineality, VERTICES_IN_FACETS=>$vif);
my $p=new polytope::Polytope<Float>(VERTICES => $v, LINEALITY_SPACE => zero_vector<Float>() | $lineality, FACETS_THRU_VERTICES=>$ftv);
my $pv= ($lineality->rows > 0 && $this->CONE_DIM > 1) ?
$p->VISUAL( $decor , BoundingBox=>$bb->{BoundingBox} ) :
......
......@@ -58,7 +58,7 @@ UserFunctionTemplate4perl("# @category Producing a polytope from polytopes"
"# @param Polytope P1"
"# @param Polytope P2"
"# @return Polytope"
"# @example The following creates the tensor product polytope of two squares and then prints its vertices."
"# @example [nocompare] The following creates the tensor product polytope of two squares and then prints its vertices."
"# > $p = tensor(cube(2),cube(2));"
"# > print $p->VERTICES;"
"# | 1 1 1 1 1"
......
......@@ -68,7 +68,8 @@ perl::Object vertex_figure(perl::Object p_in, int v_cut_off, perl::OptionSet opt
const bool simple_vertex=basis.rows()+AH.rows()==V.cols()-1;
typename Rows< Matrix<Scalar> >::iterator b=rows(basis).begin();
for (Entire< Graph<>::adjacent_node_list >::const_iterator nb_v=entire(G.adjacent_nodes(v_cut_off)); !nb_v.at_end(); ++nb_v, ++b)
*b = (1-cutoff_factor) * V[v_cut_off] + cutoff_factor * V[*nb_v];
*b = cutoff_factor * (V[*nb_v] - V[v_cut_off]);
basis.col(0) = -ones_vector<Scalar>(basis.rows());
Vector<Scalar> cutting_plane;
if (simple_vertex) {
......@@ -76,11 +77,12 @@ perl::Object vertex_figure(perl::Object p_in, int v_cut_off, perl::OptionSet opt
cutting_plane=null_space(basis/orth)[0];
} else {
// look for a valid separating hyperplane furthest from the vertex being cut off
cutting_plane=S.solve_lp(basis, orth, V[v_cut_off], false).second;
cutting_plane=S.solve_lp(basis, orth, average(rows(basis)), false).second;
}
cutting_plane[0] = - cutting_plane * V[v_cut_off];
p_out.take("FACETS") << F.minor(VIF.col(v_cut_off),All);
p_out.take("AFFINE_HULL") << AH / cutting_plane; //FIXME
p_out.take("AFFINE_HULL") << AH / cutting_plane;
}
if (!options["no_labels"]) {
......
......@@ -190,7 +190,7 @@ GraphIso::find_permutations(const GraphIso& g2, int n_cols) const
Array<int> GraphIso::canonical_perm() const
{
const Array<int> perm(p_impl->src_graph->get_nof_vertices(), p_impl->canon_labels);
Array<int> iperm;
Array<int> iperm(perm.size());
// the canonical labels from bliss are an inverse permutation for the nodes
inverse_permutation(perm,iperm);
return iperm;
......
......@@ -3,6 +3,15 @@
<property name="package.prefix" value="de/tuberlin/polymake" />
<property name="build.sysclasspath" value="ignore" />
<condition property="use-nativeheaderdir">
<and>
<antversion atleast="1.9.8"/>
<not>
<equals arg1="${ant.java.version}" arg2="1.7"/>
</not>
</and>
</condition>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
......@@ -10,7 +19,7 @@
<mkdir dir="${build.dir}/bundled/java/java" />
</target>
<target name="compile" depends="init">
<target name="compile-with-javah" depends="init" unless="use-nativeheaderdir">
<sequential>
<javac
executable="${javac}"
......@@ -21,26 +30,39 @@
encoding="UTF8">
<include name="${package.prefix}/**"/>
</javac>
<copy todir="${build.dir}/bundled/java/java"
preservelastmodified="yes">
<fileset
dir="src"
includes="**/*.txt"
excludes="**/*.java" />
</copy>
<javah
force="yes"
class="de.tuberlin.polymake.common.SharedMemoryMatrix"
outputfile="native/de_tuberlin_polymake_common_SharedMemoryMatrix.h">
<classpath location="${build.dir}/bundled/java/java" />
</javah>
</sequential>
</target>
<target name="native-header" depends="compile">
<javah
force="yes"
class="de.tuberlin.polymake.common.SharedMemoryMatrix"
outputfile="native/SharedMemoryMatrix_jni.h">
<classpath location="${build.dir}/bundled/java/java" />
</javah>
<target name="compile-with-native" depends="init" if="use-nativeheaderdir">
<javac
executable="${javac}"
srcdir="src"
destdir="${build.dir}/bundled/java/java"
nativeheaderdir="native"
failonerror="true"
debug="${debug}"
encoding="UTF8">
<include name="${package.prefix}/**"/>
</javac>
</target>
<target name="copy-files">
<copy todir="${build.dir}/bundled/java/java"
preservelastmodified="yes">
<fileset
dir="src"
includes="**/*.txt"
excludes="**/*.java" />
</copy>
</target>
<target name="all" depends="compile,native-header">
<target name="all" depends="compile-with-native,compile-with-javah,copy-files">
<jar destfile="${build.dir}/jars/${jar.name}">
<fileset
dir="${build.dir}/bundled/java/java"
......
......@@ -14,7 +14,7 @@
--------------------------------------------------------------------------------
*/
#include "SharedMemoryMatrix_jni.h"
#include "de_tuberlin_polymake_common_SharedMemoryMatrix.h"
#include <sys/ipc.h>
#include <sys/shm.h>
#include <errno.h>
......
......@@ -93,12 +93,12 @@ sub proceed {
# check Java version
my ($java_version)= `$JAVACMD -version 2>&1` =~ /version "([\d.]+)/s;
Polymake::Configure::v_cmp($java_version_num, "1.5") >= 0
Polymake::Configure::v_cmp($java_version, "1.7") >= 0
or die "Java run-time interpreter $JAVACMD",
$found_by eq "PATH"
? " found along your program PATH"
: $found_by && " found by environment variable $found_by",
" reports its version as $java_version, while minimal required is 1.5\n",
" reports its version as $java_version, while minimal required is 1.7\n",
"\nPlease upgrade your Java run-time system or JDK to a modern version,\n",
$found_by && "or specify a correct location in the option --with-java,\n",
"or disable using Java components completely: --without-java\n",
......@@ -166,7 +166,10 @@ to JReality and JavaView will be disabled permanently.
}
my ($ant_version)= `$ANT -version` =~ /version ([\d.]+)/;
Polymake::Configure::v_cmp($ant_version, "1.7.1") >= 0
or die "$ANT reports its version as $ant_version, while minimal required version is 1.7.1\n";
or die "$ANT reports its version as $ant_version, while minimal required version is 1.7.1\n";
# Java 10 needs javac with nativeheaderdir instead of javah task which requires ant 1.9.8
Polymake::Configure::v_cmp($java_version, "10") >= 0 and Polymake::Configure::v_cmp($ant_version, "1.9.8") < 0
and die "$ANT reports its version as $ant_version, while minimal required version for Java 10 is 1.9.8\n";
$NativeSO="so";
......
......@@ -101,15 +101,14 @@ pm::Integer operator*(unsigned int a, const pm::Integer& b)
}
inline bool int_quotient(pm::Integer& Quot, const pm::Integer& Num, const pm::Integer& Den){
pm::Div<pm::Integer> div = pm::div(Num,Den);
Quot = div.quot;
return !div.rem.is_zero();
Quot = abs(Num)/abs(Den);
return Quot*abs(Den)!=abs(Num);
}
inline bool int_quotient(long long& Quot, const pm::Integer& Num, const pm::Integer& Den){
pm::Div<pm::Integer> div = pm::div(Num,Den);
try_convert(Quot,div.quot);
return !div.rem.is_zero();
pm::Integer QI = abs(Num)/abs(Den);
Quot = (long long) QI;
return QI*abs(Den)!=abs(Num);
}
}
......
......@@ -131,8 +131,15 @@ perl::ListReturn normaliz_compute_with(perl::Object c, perl::OptionSet options,
(std::is_same<Scalar,mpz_class>::value && options["skip_long"]))
nmzCone.deactivateChangeOfPrecision();
nmzCone.compute(todo);
if (options["degree_one_generators"])
result << stdvectorvector_to_pmMatrix<Integer>(nmzCone.getDeg1Elements());
if (options["degree_one_generators"]){
Integer d(nmzCone.getGradingDenom());
if(d == 1){
result << stdvectorvector_to_pmMatrix<Integer>(nmzCone.getDeg1Elements());
} else {
Matrix<Integer> empty(0, c.give("CONE_DIM"));
result << empty;
}
}
if (options["hilbert_basis"]){
result << Matrix<Integer>(stdvectorvector_to_pmMatrix<Integer>(nmzCone.getHilbertBasis()));
result << Matrix<Integer>(stdvectorvector_to_pmMatrix<Integer>(nmzCone.getMaximalSubspace()));
......
......@@ -7,7 +7,7 @@
LIBNAME => 'lrsgmp',
SOURCEDIR => '${root}/bundled/lrs/external/lrs',
SOURCES => [ qw(lrslib.c lrsgmp.c) ],
CFLAGS => '-DGMP -DLRS_QUIET',
CFLAGS => '-DGMP -DMA -DLRS_QUIET',
} )
: ()
)
......@@ -20,6 +20,7 @@
#include "polymake/hash_set"
#include "polymake/ListMatrix.h"
#define MA
#define GMP
extern "C" {
#include <lrslib.h>
......@@ -32,6 +33,7 @@ extern "C" {
#undef copy
#undef sign
#undef GMP
#undef MA
namespace polymake { namespace polytope { namespace lrs_interface {
......
......@@ -17,7 +17,7 @@
sub allowed_options {
my ($allowed_options, $allowed_with)=@_;
@$allowed_with{ qw( lrs ) }=();
@$allowed_with{ qw( lrs lrs-include ) }=();
}
......@@ -26,7 +26,8 @@ sub usage {
" By default, polymake will try to use a system-wide\n",
" installation or fall back to the bundled lrslib\n",
" (bundled/lrs/external/lrs) if it exists.\n",
" To force the bundled version, specify 'bundled' as PATH.\n";
" To force the bundled version, specify 'bundled' as PATH.\n",
" --with-lrs-include=PATH Path to the folder containing lrslib.h\n";
}
sub check_bundled {
......@@ -36,7 +37,9 @@ sub check_bundled {
sub proceed {
my ($options)=@_;
my $lrs_path;
my $lrsversion;
my $lrs_inc = $options->{'lrs-include'};
my $lrs_version;
my $lrs_libname = "lrs";
$UseBundled = 1;
# suppress lrs output when it was built without LRS_QUIET
# 1: use /dev/null as output stream instead of nullptr
......@@ -44,26 +47,39 @@ sub proceed {
# we check whether solving an unbounded lp produces output
my $suppress_output=0;
if (defined ($lrs_path=$options->{lrs}) and $lrs_path ne "bundled") {
my $lrs_inc="$lrs_path/include";
my $lrs_lib=Polymake::Configure::get_libdir($lrs_path, "lrsgmp");
if (-f "$lrs_inc/lrslib.h" && -f "$lrs_lib/liblrsgmp.$Config::Config{so}" ) {
$CFLAGS = "-I$lrs_inc";
my $lrs_lib = Polymake::Configure::get_libdir($lrs_path, $lrs_libname);
unless (-f "$lrs_lib/lib$lrs_libname.$Config::Config{so}" ||
-f "$lrs_lib/lib$lrs_libname.a") {
# retry for legacy lrsgmp
$lrs_libname = "lrsgmp";
$lrs_lib = Polymake::Configure::get_libdir($lrs_path, $lrs_libname)
}
$lrs_inc //= "$lrs_path/include";
if (-f "$lrs_inc/lrslib/lrslib.h") {
$lrs_inc = "$lrs_inc/lrslib";
} elsif (!-f "$lrs_inc/lrslib.h") {
die "Invalid installation location of lrslib: header file lrslib.h not found\n";
}
if (-f "$lrs_lib/lib$lrs_libname.$Config::Config{so}" ) {
$LDFLAGS = "-L$lrs_lib -Wl,-rpath,$lrs_lib";
} elsif (-f "$lrs_inc/lrslib.h" && -f "$lrs_lib/liblrsgmp.a" ) {
$CFLAGS = "-I$lrs_inc";
} elsif (-f "$lrs_lib/lib$lrs_libname.a" ) {
$LDFLAGS = "-L$lrs_lib";
} else {
die "Invalid installation location of lrslib: header file lrslib.h and/or library liblrsgmp.$Config::Config{so} / liblrsgmp.a not found\n";
die "Invalid installation location of lrslib: library lib{lrs,lrsgmp}.$Config::Config{so} / lib{lrs,lrsgmp}.a not found\n";
}
}
if ($lrs_path ne "bundled") {
my $error=Polymake::Configure::build_test_program(<<'---', LIBS => "-llrsgmp -lgmp", CXXFLAGS => "$CFLAGS", LDFLAGS => "$LDFLAGS");
my $testcode = <<'---';
#include <cstddef>
#include <iostream>
#include <gmp.h>
#define GMP
#define MA
extern "C" {
#include <lrslib.h>
}
......@@ -102,6 +118,17 @@ int main (int argc, char *argv[])
exit(0);
}
---
RETRY:
$CFLAGS .=" -I$lrs_inc" if defined($lrs_inc);
my $error=Polymake::Configure::build_test_program($testcode, LIBS => "-l$lrs_libname -lgmp", CXXFLAGS => "$CFLAGS", LDFLAGS => "$LDFLAGS");
if ($error =~ /cannot find -llrs/ && $lrs_libname eq "lrs") {
$lrs_libname = "lrsgmp";
goto RETRY;
}
if ($?==0) {
my $message=Polymake::Configure::run_test_program();
if ($?) {
......@@ -117,13 +144,28 @@ int main (int argc, char *argv[])
$suppress_output = 2
if ($message =~ / gmp v\.\d+\.\d+/);
$UseBundled = 0;
$lrsversion = $lrsver;
$lrs_version = $lrsver;
} else {
check_bundled() and !defined($lrs_path) or
die "Your lrslib version $lrsver is too old, at least version 5.1 is required.\n";
}
}
} else {
if ($error =~ /lrslib\.h/m) {
(my $newcode = $testcode) =~ s#<lrslib.h>#<lrslib/lrslib.h>#g;
open my $source, "echo '$newcode' | $Polymake::Configure::CXX $CFLAGS -xc++ -E - 2>/dev/null |"
or die "This looks like recent lrslib with lrslib.h in a lrslib subfolder but we could not\n",
"run the preprocessor to find the lrslib include path '$Polymake::Configure::CXX $CFLAGS -xc++ -E -': $!\n",
"You can try specifying --with-lrs-include";
while (<$source>) {
if (m{\# \d+ "(\S+)/lrslib\.h"}) {
$CFLAGS .= " -I$1";
close $source;
goto RETRY;
}
}
close $source;
}
check_bundled() and !defined($lrs_path) or
die "Could not compile a test program checking for lrs library.\n",
"The most probable reasons are that the library is installed at a non-standard location,\n",
......@@ -140,10 +182,10 @@ int main (int argc, char *argv[])
undef $LIBS;
$CFLAGS='-I${root}/bundled/lrs/external/lrs';
} else {
$LIBS="-llrsgmp";
$LIBS="-l$lrs_libname";
$CFLAGS.=" -DPM_LRS_SUPPRESS_OUTPUT=$suppress_output" if $suppress_output;
}
return $UseBundled ? "bundled" : ("$lrsversion @ ".($lrs_path//"system"));
return $UseBundled ? "bundled" : ("$lrs_version @ ".($lrs_path//"system"));
}
......@@ -93,6 +93,10 @@ int main() {
"Please remember to enable C++ interface and GMP support when configuring the libppl!\n";
}
if (defined($Polymake::Configure::GCCversion) && Polymake::Configure::v_cmp($Polymake::Configure::GCCversion, "8.0.0") >= 0) {
$CXXFLAGS .= " -Wno-class-memaccess";
}
$LIBS="-lppl";
return "$ppl_version @ ".($ppl_path//"system");
}
......@@ -148,6 +148,9 @@ sub proceed {
if (defined $Polymake::Configure::CLANGversion) {
$CXXFLAGS .= " -Wno-deprecated-register";
}
# remove old -std= versions from CXXFLAGS which would override our c++14
$CXXFLAGS =~ s/-std=(?:c|gnu)\+\+(?:11|0x|03)//g;
$LIBS .= " -ldl" unless $LIBS =~ /-ldl/ or $^O ne "linux";
......
......@@ -42,13 +42,13 @@ void soplex_solve_lp(perl::Object p, perl::Object lp, bool maximize, perl::Optio
lp.take(maximize ? "MAXIMAL_VERTEX" : "MINIMAL_VERTEX") << S.second;
p.take("FEASIBLE") << true;
}
catch (infeasible)
catch (const infeasible&)
{
lp.take(maximize ? "MAXIMAL_VALUE" : "MINIMAL_VALUE") << perl::undefined();
lp.take(maximize ? "MAXIMAL_VERTEX" : "MINIMAL_VERTEX") << perl::undefined();
p.take("FEASIBLE") << false;
}
catch (unbounded)
catch (const unbounded&)
{
if (maximize)
lp.take("MAXIMAL_VALUE") << std::numeric_limits<Rational>::infinity();
......
......@@ -103,6 +103,11 @@ int main() {
"and specify its location using --with-soplex=PATH.\n",
"The complete error log follows:\n\n$error\n";
}
if (defined($Polymake::Configure::GCCversion) && Polymake::Configure::v_cmp($Polymake::Configure::GCCversion, "8.0.0") >= 0) {
$CXXFLAGS .= " -Wno-class-memaccess";
}
$LIBS="-lsoplex -lz";
return "$version [$gmp] @ $path";
}
......@@ -8,7 +8,7 @@ if ($ConfigFlags{'bundled.sympol.UseBundled'}) {
yal/reportlevel.cpp symmetrycomputation.cpp symmetrycomputationadm.cpp symmetrycomputationdirect.cpp symmetrycomputationidm.cpp
symmetrygroupconstruction/graphconstructiondefault.cpp symmetrygroupconstruction/matrixconstruction.cpp symmetrygroupconstruction/matrixconstructiondefault.cpp ) ],
'raycomputationcdd.cpp' => '-DGMPRATIONAL ${bundled.cdd.CFLAGS}',
'raycomputationlrs.cpp' => '-DGMP ${bundled.lrs.CFLAGS}',
'raycomputationlrs.cpp' => '-DGMP -DMA ${bundled.lrs.CFLAGS}',
$ConfigFlags{ExternalHeaders} =~ /\bpermlib\b/
? ( CXXFLAGS => '-I${root}/include/external/permlib' ) : (),
},
......
polymake (3.2r4-1) unstable; urgency=medium
* New upstream release.
* Bug fix: "[polymake] FTBFS with boost1.67", thanks to Giovanni
Mascellani (Closes: #911949).
* Bug fix: "polymake FTBFS: test failure", thanks to Adrian Bunk
(Closes: #912174).
* Add runtime dependency on sensible-utils, to use "sensible-browser"
-- David Bremner <bremner@debian.org> Mon, 26 Nov 2018 18:44:59 -0400
polymake (3.2r2-3) unstable; urgency=medium
* install polymake-config manpage again (missing in 3.2r2-1, -2)
......
......@@ -24,8 +24,8 @@ Build-Depends: debhelper (>= 10),
pkg-config
Standards-Version: 4.0.0
Homepage: http://www.polymake.org/
Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/polymake.git
Vcs-Git: https://anonscm.debian.org/git/collab-maint/polymake.git
Vcs-Browser: https://salsa.debian.org/bremner/polymake.git
Vcs-Git: https://salsa.debian.org/bremner/polymake.git
Package: polymake
Architecture: any-amd64 any-i386 alpha arm64 hppa hurd-i386 m68k mips64el powerpc ppc64 ppc64el s390x sh4 sparc64 x32
......@@ -53,6 +53,7 @@ Depends: libpolymake-dev-common (= ${source:Version}),
libxml-libxml-perl,
libxml-libxslt-perl,
libxml-writer-perl,
sensible-utils,
${perl:Depends},
${misc:Depends}
Replaces: polymake (<< 3.2)
......
......@@ -49,4 +49,4 @@ override_dh_perl:
override_dh_auto_build:
uglifyjs ${JSSOURCE} -c -m -o resources/threejs/js/three.polymake.js
ninja -C build/Opt all -j${MAX_CPUS}
ninja -v -C build/Opt all -j${MAX_CPUS}
......@@ -37,11 +37,18 @@
#include <list>
#include <vector>
#include <boost/version.hpp>
#include <boost/cstdint.hpp>
#include <boost/foreach.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
#if BOOST_VERSION / 100 >= 1067
#include <boost/next_prior.hpp>
#else
#include <boost/utility.hpp>
#endif
#include <permlib/bsgs_core.h>
......
......@@ -48,7 +48,16 @@
#include <boost/dynamic_bitset.hpp>
#include <boost/foreach.hpp>
#include <boost/cstdint.hpp>
#include <boost/version.hpp>
#if BOOST_VERSION / 100 >= 1067
#include <boost/integer/common_factor_rt.hpp>
#define permlib_boost_lcm boost::integer::lcm
#else
#include <boost/math/common_factor_rt.hpp>
#define permlib_boost_lcm boost::math::lcm
#endif
namespace permlib {
......@@ -343,7 +352,7 @@ inline boost::uint64_t Permutation::order() const {
std::list<CyclePair> cycleList = this->cycles();
boost::uint64_t ord = 1;
BOOST_FOREACH(const CyclePair& cyc, cycleList) {
ord = boost::math::lcm(ord, static_cast<boost::uint64_t>(cyc.second));
ord = permlib_boost_lcm(ord, static_cast<boost::uint64_t>(cyc.second));
}
return ord;
}
......
......@@ -38,7 +38,15 @@
#include <boost/foreach.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/version.hpp>
#if BOOST_VERSION / 100 >= 1067
#include <boost/next_prior.hpp>
#else
#include <boost/utility.hpp>
#endif
#include <vector>
#include <list>
......
......@@ -211,6 +211,7 @@ Main::Main(const std::string& user_opts, std::string install_top, std::string in
PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
if (perl_parse(aTHXx_ xs_init, argc, (char**)argv, *env)) {
destroy_perl(aTHXx);
PL_curinterp = nullptr;
throw std::runtime_error("could not initialize the perl interpreter");
}
#ifdef PERL_IMPLICIT_CONTEXT
......
......@@ -995,6 +995,7 @@ public:
{
permute_entries(dir()).copy(src.R, R, perm, inv_perm);
n_nodes=src.n_nodes;
R->prefix().n_edges=src.edges();
}
#if POLYMAKE_DEBUG
......
......@@ -1698,7 +1698,6 @@ BOOT:
CvNODEBUG_on(get_cv("Polymake::Core::CPlusPlus::call_ellipsis_function", false));
CvNODEBUG_on(get_cv("Polymake::Core::CPlusPlus::composite_access", false));
CvNODEBUG_on(get_cv("Polymake::Core::CPlusPlus::assign_to_cpp_object", false));
CvNODEBUG_on(get_cv("Polymake::Core::CPlusPlus::assign_array_to_cpp_object", false));
CvNODEBUG_on(get_cv("Polymake::Core::CPlusPlus::overload_clone_op", false));
CvNODEBUG_on(get_cv("Polymake::Core::CPlusPlus::convert_to_string", false));
CvNODEBUG_on(get_cv("Polymake::Core::CPlusPlus::convert_to_int", false));
......
......@@ -152,8 +152,11 @@ while (defined ($_=shift)) {
close CC;
if ($^O eq "darwin") {
$ldflags="$ConfigFlags{ARCHFLAGS} $ldflags -flat_namespace";
} elsif ($add_rpath) {
$ldflags.=" -Wl,-rpath,$ConfigFlags{InstallLib}";
} else {
$ldflags .= " -Wl,-E";
if ($add_rpath) {
$ldflags .= " -Wl,-rpath,$ConfigFlags{InstallLib}";
}
}
$ldflags=~s/^\s+//; $ldflags=~s/\s+$//; $ldflags=~s/\s{2,}/ /g;
if ($debug_asked=defined($debug)) {
......
......@@ -22,6 +22,9 @@ use warnings qw(FATAL void syntax misc);
# load the non-interactive basis routines first
use Polymake::ConfigureStandalone;
# the values of these variables are growing when extension configure script assigns something to them
my %augmented_vars=( CFLAGS=>1, CXXFLAGS=>1, CflagsSuppressWarnings=>1, LDFLAGS=>1, LIBS=>1 );
package Polymake::Configure;
if ($ENV{POLYMAKE_HOST_AGENT}) {
......
......@@ -32,13 +32,12 @@ BEGIN {
GCCversion ICCversion CLANGversion CPPStd AppleClang
LDFLAGS LDsharedFLAGS LDcallableFLAGS LDsonameFLAGS LIBS
LIBXML2_CFLAGS LIBXML2_LIBS ExternalHeaders
Arch FinkBase BundledExts BuildModes
Arch FinkBase BrewBase BundledExts BuildModes
InstallTop InstallArch InstallBin InstallInc InstallLib InstallDoc DESTDIR );
}
use vars map { "\$$_" } @conf_vars;
my %augmented_vars=( CFLAGS=>1, CXXFLAGS=>1, CflagsSuppressWarnings=>1, LDFLAGS=>1, LIBS=>1 );
my %supported_build_modes=( Cov => 1, San => 1 );
###############################################################################################
......@@ -188,7 +187,7 @@ sub retrieve_config_command_line {
local $_;
if ($config_file =~ /\.ninja$/) {
while (<$conf>) {
s{^\s*configure\.command[ \t]*=[ \t]*(?:\S+/configure(?=\s))?}{} and last;
s{^\s*configure\.command[ \t]*=(?:[ \t]*\S+/configure(?=\s))?}{} and last;
}
unless ($_) {
die <<"---";
......
......@@ -821,6 +821,7 @@ sub reconfigure {
}
require Polymake::Configure;
$self->set_build_dir;
my $err=Configure::configure_extension($self, "--force", @config_options);
if ($err ne "silent\n") {
if ($err) {
......
......@@ -445,7 +445,7 @@ sub display_help_topics {
next if is_object($_) && $_->annex->{display} =~ /^\s*noshow\s*$/;
print "-------------------\n" if $User::help_delimit && $n++;
if (is_object($_)) {
print $full_text && substr($_->full_path,1).":\n",
print $full_text ? substr($_->full_path,1).":\n" : "",
$_->display_text($full_text, $tell_about_full);
} else {
print $_->($full_text, $tell_about_full);
......
......@@ -409,6 +409,7 @@ sub diff_with {
# @param Int expected completion offset from the end of input_string
# @param String+ expected completions;
# the last one is interpreted as the expected append character if it consists of exactly one char
# if the last word is "..." all subsequent words in the output are ignored
sub check_completion {
unless (@_>3 && (is_string($_[0]) || is_integer($_[0])) && is_string($_[1]) && is_integer($_[2])) {
croak( "usage: check_completion('ID', 'partial input', expected_offset, 'expected completion', ...)" );
......
......@@ -73,7 +73,9 @@ sub new {
sub execute {
my ($self)=@_;
my $eq=equal_string_lists($self->expected_words, $self->gotten_words);
my $eq= $self->expected_words->[-1] eq "..." ?
@{$self->expected_words}-1 == equal_string_list_prefixes($self->expected_words, $self->gotten_words) :
equal_string_lists($self->expected_words, $self->gotten_words);
my $eq_append=!defined($self->expected_append) || $self->expected_append eq $self->gotten_append;
unless ($eq && $eq_append && $self->expected_offset==$self->gotten_offset) {
unless ($eq) {
......
......@@ -28,8 +28,8 @@ polymake_cc = conditional_decode( subprocess.check_output( [ "polymake-config",
os.environ["CC"] = polymake_cc
os.environ["CXX"] = polymake_cc
if platform.system() == "Darwin" :
version = platform.mac_ver()[0]
os.environ["MACOSX_DEPLOYMENT_TARGET"] = version.rsplit('.',1)[0]
version_arr = platform.mac_ver()[0].split('.')
os.environ["MACOSX_DEPLOYMENT_TARGET"] = version_arr[0]+'.'+version_arr[1]
setup(
name = 'JuPyMake',
......
......@@ -76,7 +76,7 @@ my (%options, %vars, %allowed_options, %allowed_with, %allowed_flags, %allowed_v
@allowed_vars{ qw( CC CFLAGS CXX CXXFLAGS CXXOPT CXXDEBUG LDFLAGS LIBS Arch DESTDIR ) }=();
if ($^O eq "darwin") {
@allowed_with{ qw( fink ) }=();
@allowed_with{ qw( fink brew ) }=();
}
my (@ext, @ext_disabled, %ext_with_config, %ext_requires, %ext_requires_opt, %ext_conflicts, %ext_failed, %ext_bad,
......@@ -91,6 +91,9 @@ parse_command_line(\@ARGV, $repeating_config);
construct_paths();
determine_cxx_compiler();
determine_cxx_library();
if ($^O eq "darwin") {
check_macos_package_manager();
}
determine_architecture();
collect_compiler_specific_options();
check_build_modes();
......@@ -168,7 +171,6 @@ exit(0);
### end of main body ###
sub usage {
my $GMPdef= $^O eq "darwin" ? '${fink}' : '/usr';
print STDERR <<'---';
This is a script preparing the build and installation of polymake.
......@@ -209,12 +211,12 @@ Allowed options (and their default values) are:
---
$^O eq "darwin" and
print STDERR <<'---';
--with-fink=PATH ( /sw ) fink installation directory
--without-fink don't use Fink packages at all
--with-fink=PATH fink installation directory. You can pass "default" as argument if fink is installed into its default location ( /sw )
--with-brew=PATH homebrew installation directory. You can pass "default" as argument if brew is installed into its default location ( /usr/local )
.
---
print STDERR <<"---";
--with-gmp=PATH ( $GMPdef ) GNU MultiPrecision library installation directory
--with-gmp=PATH ( /usr ) GNU MultiPrecision library installation directory
--with-mpfr=PATH ( =gmp-path ) GNU Multiple Precision Floating-point Reliable library installation directory
--with-libxml2=PATH ( find via \$PATH ) GNU XML processing library
......@@ -419,7 +421,7 @@ sub parse_command_line {
}
if ($repeating_config && $name =~ /^build/) {
$options{$name} //= $value;
} elsif ($value eq "default") {
} elsif ($value eq "default" && $name ne "fink" && $name ne "brew") {
delete $options{$name};
} else {
$options{$name}=$value;
......@@ -756,23 +758,8 @@ Please investigate and reconfigure.
#####################################################
sub check_fink {
print "checking fink installation ... ";
if (defined( $FinkBase=$options{fink} )) {
if (-d $FinkBase) {
unless (-f "$FinkBase/etc/fink.conf") {
die "option --with-fink does not point to the fink installation tree: $FinkBase/etc/fink.conf not found\n";
}
} elsif (-x $FinkBase && $FinkBase =~ s|/bin/fink$||) {
unless (-f "$FinkBase/etc/fink.conf") {
die "option --with-fink points to a broken fink installation: $FinkBase/etc/fink.conf not found\n";
}
} else {
die <<'---';
option --with-fink points to a wrong program: something like /path/bin/fink expected.
If you have renamed the main fink program, please specify the top directory: --with-fink=/path
---
}
} else {
$FinkBase=$options{fink};
if ( $FinkBase eq "default" ) {
# Fink location not specified, look for it at plausible places
(undef, my ($fink, $error))=find_program_in_path("fink", sub {
!(($FinkBase=$_[0]) =~ s|/bin/fink$|| && -f "$FinkBase/etc/fink.conf") && "!"
......@@ -781,18 +768,31 @@ If you have renamed the main fink program, please specify the top directory: --w
if ($error) {
die <<"---";
Found the fink program at $fink, but the corresponding configuration file is missing;
Please specify the top installation directory using option --with-fink
Please specify the top installation directory using option --with-fink=PATH
---
}
} elsif (-f "/sw/etc/fink.conf") {
$FinkBase="/sw";
} else {
die <<"---";
The Fink package system is a mandatory prerequisite to build and use polymake under MacOS.
Please refer to $Wiki/mac for details and installation instructions.
If you already have Fink installed at a non-standard location, please specify it using option --with-fink
The Fink package system cannot be found at a default location on your computer.
Please refer to $Wiki/howto/mac for installation instructions and other options to install polymake on a Mac.
If you have Fink installed at a non-standard location, please specify it using option --with-fink=PATH
---
}
} elsif (-d $FinkBase) {
unless (-f "$FinkBase/etc/fink.conf") {
die "option --with-fink does not point to the fink installation tree: $FinkBase/etc/fink.conf not found\n";
}
} elsif (-x $FinkBase && $FinkBase =~ s|/bin/fink$||) {
unless (-f "$FinkBase/etc/fink.conf") {
die "option --with-fink points to a broken fink installation: $FinkBase/etc/fink.conf not found\n";
}
} else {
die <<'---';
option --with-fink points to a wrong program: something like /path/bin/fink expected.
If you have renamed the main fink program, please specify the top directory: --with-fink=PATH
---
}
if (defined (my $anylib=(glob("$FinkBase/lib/*.dylib"))[0])) {
......@@ -811,19 +811,73 @@ If you already have Fink installed at a non-standard location, please specify it
print "ok ($FinkBase)\n";
}
#####################################################
sub check_brew {
$BrewBase=$options{brew};
if ( $BrewBase eq "default" ) {
$BrewBase = '/usr/local';
unless (-f "$BrewBase/bin/brew") {
die "brew installation corrupt: $BrewBase/bin/brew not found\n";
}
} else {
if (-d $BrewBase) {
unless (-f "$BrewBase/bin/brew") {
die "option --with-brew does not point to the brew installation tree: $BrewBase/bin/brew not found\n";
}
} elsif (-x $BrewBase && $BrewBase =~ s|/bin/brew$||) {
unless (-f "$BrewBase/bin/brew") {
die "option --with-brew points to a broken brew installation: $BrewBase/bin/brew not found\n";
}
} else {
die <<'---';
option --with-brew points to a wrong program: something like --with-brew=/path/bin/brew expected.
You can also pass --with-brew=PATH, where PATH is the base directory of your homebrew installation.
If you installed into the default location (/usr/local/), then you can also pass -with-brew=default or omit the option completely.
---
}
$CFLAGS .= " -I$BrewBase/include";
$CXXFLAGS .= " -I$BrewBase/include";
$LDFLAGS .= " -L$BrewBase/lib";
}
if (defined (my $anylib=(glob("$BrewBase/lib/*.dylib"))[0])) {
my ($brew_arch)= `lipo -info $anylib` =~ /architecture: (\S+)/;
if (defined $Arch) {
if ($Arch ne $brew_arch) {
die "Required architecture $Arch does not match installed brew architecture $brew_arch\n";
}
} else {
$Arch=$brew_arch;
}
} else {
die "Homebrew installation seems corrupt: no shared libraries found in $BrewBase/lib\n";
}
print "ok ($BrewBase)\n";
}
#####################################################
sub check_macos_package_manager {
print "checking for package manager ... ";
if (defined($options{fink}) and $options{fink} ne ".none.") {
check_fink();
} elsif (defined($options{brew}) and $options{brew} ne ".none.") {
check_brew();
} else {
print "no package manager specified\n";
}
}
#####################################################
sub determine_architecture {
print "determining architecture ... ";
if ($^O eq "darwin") {
if ($options{fink} ne ".none.") {
check_fink();
} elsif (defined $Arch) {
if ($Arch ne "i386" && $Arch ne "x86_64") {
die "Invalid architecture $Arch for Mac OS: allowed values are i386 and x86_64.\n";
if ( !defined($FinkBase) && !defined($BrewBase) ) {
if (defined $Arch) {
if ($Arch ne "i386" && $Arch ne "x86_64") {
die "Invalid architecture $Arch for Mac OS: allowed values are i386 and x86_64.\n";
}
} else {
$Arch = "x86_64";
}
} else {
# choose i386 for 10.5 and x86_64 for all others
`sw_vers | grep ProductVersion` =~ /(\d+(?:\.\d+)*)/;
$Arch= v_cmp($1, "10.6")>=0 ? "x86_64" : "i386";
}
$ARCHFLAGS= $NeedsArchFlag ? "-arch $Arch" : "";
$Arch="darwin.$Arch";
......@@ -836,9 +890,13 @@ sub determine_architecture {
}
# no arch flags set
unless ($options{native} eq ".none." or "$CFLAGS $CXXFLAGS" =~ /(?:^|\s)-m(?:arch|tune|cpu)=/) {
$CFLAGS .= " -march=native";
$CXXFLAGS .= " -march=native";
if ($options{native} ne ".none.") {
if ("$CFLAGS $CXXFLAGS" =~ /(?:^|\s)-m(?:arch|tune|cpu)=(\w+)/) {
$options{native} = ".none." unless $1 eq "native";
} else {
$CFLAGS .= " -march=native";
$CXXFLAGS .= " -march=native";
}
}
}
print "ok ($Arch)\n";
......@@ -1595,7 +1653,7 @@ AR=$Config::Config{ar}
---
# write configuration variables for successfully configured bundled extensions
foreach my $ext (keys %ext_survived) {
foreach my $ext (sort keys %ext_survived) {
write_config_vars("Polymake::Bundled::$ext", "bundled.$ext.", $conf);
print $conf "bundled.$ext.RequireExtensions=@{$ext_requires{$ext}}\n";
}
......
......@@ -589,9 +589,9 @@ sub install_bin_scripts {
s{^\#!\S+}{#!$Config::Config{perlpath}}s;
}
s/=Version(?=;)/=$Version/;
s/=InstallTop(?=;)/="$ConfigFlags{InstallTop}"/;
s/=InstallArch(?=;)/="$ConfigFlags{InstallArch}"/;
s{=Version(?=;)}{=$Version};
s{=InstallTop(?=;)}{='$ConfigFlags{InstallTop}'};
s{=InstallArch(?=;)}{='$ConfigFlags{InstallArch}'};
if (-e "$InstallBin/polymake-config") {
unlink "$InstallBin/polymake-config"
......