Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[polymake] bump to 4.2 and add patch for sigint #1695

Merged
merged 4 commits into from
Oct 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 22 additions & 13 deletions P/polymake/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
using BinaryBuilder, Pkg

name = "polymake"
version = v"4.1.0"
version = v"4.2.0"

# Collection of sources required to build polymake
sources = [
GitSource("https://github.com/polymake/polymake.git", "8704ebbba9f8cc2b07f824a283ffed49a8c036be")
ArchiveSource("https://github.com/polymake/polymake/archive/V$(version.major).$(version.minor).tar.gz", "d308f551ef4c9f490a3a848d45a1ab41ae6461b1daf5be3deeaebad7df3816d4")
DirectorySource("./bundled")
]

# Bash recipe for building across all platforms
script = raw"""
# the prepared config files for non-native architectures
# assume a fixed source directory
mv $WORKSPACE/srcdir/{polymake-*,polymake}
cd $WORKSPACE/srcdir/polymake

perl_version=5.30.3
Expand All @@ -24,7 +27,12 @@ for dir in FLINT GMP MPFR PPL Perl bliss boost cddlib lrslib normaliz; do
ln -s .. ${prefix}/deps/${dir}_jll
done

# adjust for hardcoded /workspace dirs
atomic_patch -p1 ../patches/relocatable.patch

# to unbreak ctrl+c in julia
atomic_patch -p1 ../patches/sigint.patch

if [[ $target == *darwin* ]]; then
# we cannot run configure and instead provide config files
mkdir -p build/Opt
Expand Down Expand Up @@ -86,9 +94,10 @@ install_license COPYING
# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = [
MacOS(:x86_64, compiler_abi=CompilerABI(cxxstring_abi=:cxx11)),
Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(cxxstring_abi=:cxx11)),
Platform("x86_64", "linux"; libc="glibc"),
Platform("x86_64", "macos"),
]
platforms = expand_cxxstring_abis(platforms)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@giordano thanks for helping out!

@benlorenz was there a particular reason to only allow the cxx11 strings ABI (note: as far as I understand things, the cxxstring ABI does not restrict the C++ standard one can use; i.e. one can use the cxx03 string ABI also with C++11 or C++14 code, and vice versa use the cxx11 string ABI in C++03 code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@benlorenz benlorenz Oct 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no libcxxwrap_julia for the cxx03 ABI:

Linux(:i686; libc=:glibc, compiler_abi=CompilerABI(cxxstring_abi=:cxx11)),

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That may hopefully change in the future

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that a bunch of other packages are using CompilerABI, e.g. CMake, libcxxwrap_julia, libpolymake_julia, libsingular_julia, and more, so I guess all of those should be adjusted? Of course it's a bit annoying that this then means that people who want to test them locally now have to install dev versions of Julia 1.6, BinaryBuilder, and BinaryBuilderBase...

Copy link
Member

@giordano giordano Oct 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course it's a bit annoying that this then means that people who want to test them locally now have to install dev versions of Julia 1.6, BinaryBuilder, and BinaryBuilderBase...

I know, but unfortunately in BinaryBuilder now we heavily rely on features present in Julia nightly which makes keeping compatibility with older Julia versions nearly impossible, or too much effort to be worth it. The compatibility shim now used for the platforms doesn't really work great, I'm not going to spend time on it (my bandwidth is limited...), but anyone is welcome to improve it .

Note that to test one of these builders locally the quick and dirty trick is to locally set

platforms = Platform[]

and manually build from the command line for whatever platform you're interested in.


# The products that we will ensure are always built
products = [
Expand All @@ -100,17 +109,17 @@ products = [

# Dependencies that must be installed before this package can be built
dependencies = [
Dependency("CompilerSupportLibraries_jll")
Dependency("FLINT_jll")
Dependency("CompilerSupportLibraries_jll"),
Dependency("FLINT_jll"),
Dependency("GMP_jll", v"6.1.2"),
Dependency("MPFR_jll", v"4.0.2"),
Dependency("PPL_jll")
Dependency(PackageSpec(name="Perl_jll", uuid="83958c19-0796-5285-893e-a1267f8ec499", version=v"5.30.3"))
Dependency("bliss_jll")
Dependency("boost_jll")
Dependency("cddlib_jll")
Dependency("lrslib_jll")
Dependency("normaliz_jll")
Dependency("PPL_jll"),
Dependency(PackageSpec(name="Perl_jll", uuid="83958c19-0796-5285-893e-a1267f8ec499", version=v"5.30.3")),
Dependency("bliss_jll"),
Dependency("boost_jll"),
Dependency("cddlib_jll"),
Dependency("lrslib_jll"),
Dependency("normaliz_jll"),
]

# Build the tarballs, and possibly a `build.jl` as well.
Expand Down
4 changes: 2 additions & 2 deletions P/polymake/bundled/config/config-x86_64-apple-darwin14.ninja
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
configure.command=/workspace/srcdir/polymake/configure CXX=clang++ --with-libcxx --with-lrs-include=/workspace/destdir/include/lrslib
root=/workspace/srcdir/polymake
core.includes=-I${root}/include/core-wrappers -I${root}/include/core
app.includes=-I${root}/include/app-wrappers -I${root}/include/apps -I${root}/include/external/permlib -I${root}/include/external/TOSimplex
app.includes=-I${root}/include/app-wrappers -I${root}/include/apps -I${root}/include/external/permlib -I${root}/include/external/TOSimplex -I${root}/include/external/Miniball

CC = clang -target x86_64-apple-darwin14 --sysroot /opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root
CXX = clang++ -target x86_64-apple-darwin14 --sysroot /opt/x86_64-apple-darwin14/x86_64-apple-darwin14/sys-root
Expand All @@ -23,7 +23,7 @@ LDsharedFLAGS = -mmacosx-version-min=10.8 -L/workspace/destdir/lib -Wl,-rpath,/w
LDcallableFLAGS = -mmacosx-version-min=10.8 -L/workspace/destdir/lib -Wl,-rpath,/workspace/destdir/lib -dynamiclib -undefined dynamic_lookup -fstack-protector-strong -mmacosx-version-min=10.8 -fstack-protector-strong
LDsonameFLAGS = -install_name /workspace/destdir/lib/
LIBS = -lc++ -lflint -lmpfr -lgmp -lpthread
ExternalHeaders = permlib TOSimplex
ExternalHeaders = permlib TOSimplex Miniball
Arch = darwin.x86_64
BundledExts = cdd atint bliss flint libnormaliz lrs ppl sympol
BuildModes = Opt Debug
Expand Down
13 changes: 13 additions & 0 deletions P/polymake/bundled/patches/sigint.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/perllib/Polymake/Main.pm b/perllib/Polymake/Main.pm
index ce048584af..7a9a723dac 100644
--- a/perllib/Polymake/Main.pm
+++ b/perllib/Polymake/Main.pm
@@ -23,7 +23,7 @@ sub import {
(undef, my ($user_opts, $must_reset_SIGCHLD)) = @_;

# this guarantees initialization of internal structures for signal handling
- local $SIG{INT} = 'IGNORE';
+ local $SIG{USR1} = 'IGNORE';

# these redefinitions must happen before the whole slew of polymake perl code is loaded!
if ($must_reset_SIGCHLD) {