sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.45k stars 481 forks source link

spkg-configure.m4 for polymake #31527

Closed mkoeppe closed 3 years ago

mkoeppe commented 3 years ago

Polymake is available on a number of systems (https://repology.org/project/polymake/versions) and also on Homebrew via a custom tap: https://polymake.org/doku.php/download/start#binary_releases

We add system package info and spkg-configure.m4

Fixing broken distribution packages is beyond the scope of the ticket.

Depends on #32605

CC: @videlec @jplab @kliem paffenholz@opt.tu-darmstadt.de @antonio-rojas @dimpase @orlitzky

Component: build: configure

Author: Matthias Koeppe

Branch/Commit: 03f17c9

Reviewer: Antonio Rojas, Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/31527

mkoeppe commented 3 years ago

Branch: u/mkoeppe/spkg_configure_m4_for_polymake

mkoeppe commented 3 years ago

Dependencies: #31335

mkoeppe commented 3 years ago

Commit: 2bbee93

mkoeppe commented 3 years ago

New commits:

40996b3.homebrew-build-env: Use /usr/local/opt/polymake if it exists
2bbee93build/pkgs/polymake/spkg-configure.m4: New
mkoeppe commented 3 years ago
comment:3

With polymake from Andreas's tap, need to do export PERL5LIB="/usr/local/Cellar/polymake/4.3_1/libexec/perl5/lib/perl5/darwin-thread-multi-2level:/usr/local/Cellar/polymake/4.3_1/libexec/perl5/lib/perl5" (this is done in the polymake script but we use the callable library through jupymake)

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 2bbee93 to cd792c5

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

00b3109build/pkgs/sagelib/spkg-install: Set SETUPTOOLS_USE_DISTUTILS=local
fd23c0dbuild/pkgs/setuptools/patches: Add distutils patch from https://github.com/fxcoudert/cpython/commit/6511bf56.patch
3601c51Adapt the patch to apply to the vendored distutils
9ad84ccMerge branch 't/31344/homebrew__docbuild_crashes__libtcl_atforkprepare' into t/31335/homebrew__unused_packages__singular__pari_______in__usr_local_leak_into_sagelib_build
ae4ea55Merge branch 't/31344/homebrew__docbuild_crashes__libtcl_atforkprepare' into t/31335/homebrew__unused_packages__singular__pari_______in__usr_local_leak_into_sagelib_build
add7db4Merge tag '9.3.beta7' into t/31335/homebrew__unused_packages__singular__pari_______in__usr_local_leak_into_sagelib_build
4e777e7Merge tag '9.3.beta8' into t/31335/homebrew__unused_packages__singular__pari_______in__usr_local_leak_into_sagelib_build
e03c5acbuild/bin/sage-build-env: Set SETUPTOOLS_USE_DISTUTILS here, not in build/pkgs/sagelib/spkg-install
f125453Merge #31335
cd792c5build/pkgs/polymake/distros: Add more
mkoeppe commented 3 years ago

Changed dependencies from #31335 to #31335, #31482

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from cd792c5 to 4fef65a

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

55211fabuild/pkgs/latte_int: Upgrade to 1.7.6
78daa99build/pkgs/latte_int/dependencies: Make lrslib only an optional dependency
156fc9fMerge #31482
4fef65abuild/pkgs/polymake/dependencies: Make lrslib only an optional dependency
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

35558b3build/pkgs/polymake/spkg-install.in: Only pass --with-lrs if it is installed
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 4fef65a to 35558b3

mkoeppe commented 3 years ago
comment:9

Replying to @mkoeppe:

With polymake from Andreas's tap, need to do export PERL5LIB="/usr/local/Cellar/polymake/4.3_1/libexec/perl5/lib/perl5/darwin-thread-multi-2level:/usr/local/Cellar/polymake/4.3_1/libexec/perl5/lib/perl5" (this is done in the polymake script but we use the callable library through jupymake)

Setting this globally unfortunately breaks autotools (aclocal) from homebrew:

Usage: DynaLoader::dl_find_symbol(libhandle, symbolname) at /usr/local/Cellar/polymake/4.3_1/libexec/perl5/lib/perl5/darwin-thread-multi-2level/XSLoader.pm line 89.
Compilation failed in require at /usr/local/Cellar/polymake/4.3_1/libexec/perl5/lib/perl5/File/Path.pm line 6.
BEGIN failed--compilation aborted at /usr/local/Cellar/polymake/4.3_1/libexec/perl5/lib/perl5/File/Path.pm line 6.
Compilation failed in require at /usr/local/bin/aclocal line 33.
BEGIN failed--compilation aborted at /usr/local/bin/aclocal line 33.

Too bad that polymake-config does not advertise the necessary Perl library path...

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

93fcbd6build/pkgs/polymake/distros/debian.txt: Add libpolymake-dev
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 35558b3 to 93fcbd6

mkoeppe commented 3 years ago

Changed dependencies from #31335, #31482 to none

mkoeppe commented 3 years ago
comment:12

Moving this ticket to 9.4, as it seems unlikely that it will be merged in 9.3, which is in the release candidate stage

mkoeppe commented 3 years ago
comment:13

Saving the continuation:

JuPyMake/JuPyMake.cpp at master · sebasguts/JuPyMake https://github.com/sebasguts/JuPyMake/blob/master/JuPyMake.cpp

jupyter-polymake/kernel.py at master · polymake/jupyter-polymake https://github.com/polymake/jupyter-polymake/blob/master/jupyter_kernel_polymake/kernel.py

jupyter-kernel-polymake · PyPI https://pypi.org/project/jupyter-kernel-polymake/

Failed to install on OSX Mojave Mac::SystemDirectory is not installed. · Issue #39 · sqitchers/homebrew-sqitch https://github.com/sqitchers/homebrew-sqitch/issues/39

tokuhirom/plenv: Perl binary manager https://github.com/tokuhirom/plenv

polymake Downloads [polymake wiki] https://polymake.org/doku.php/download/start

mkoeppe commented 3 years ago
comment:14

Perlbrew https://perlbrew.pl/

gugod/App-perlbrew: Manage perl installations in your $HOME https://github.com/gugod/App-perlbrew

App::perlbrew - Manage perl installations in your $HOME - metacpan.org https://metacpan.org/pod/App::perlbrew

polymake Downloads [polymake wiki] https://polymake.org/doku.php/download/start#binary_releases

perl:mongodb package versions - Repology https://repology.org/project/perl:mongodb/versions

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

b211f2a.homebrew-build-env: Use /usr/local/opt/polymake if it exists
27b4992build/pkgs/polymake/spkg-configure.m4: New
d30256bbuild/pkgs/polymake/spkg-configure.m4: If system polymake is in use, do not require Perl packages
6860f90build/pkgs/polymake/distros: Add more
f4eb33bbuild/pkgs/polymake/dependencies: Make lrslib only an optional dependency
d93788abuild/pkgs/polymake/spkg-install.in: Only pass --with-lrs if it is installed
9ad9e2fbuild/pkgs/polymake/distros/debian.txt: Add libpolymake-dev
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 93fcbd6 to 9ad9e2f

mkoeppe commented 3 years ago

Dependencies: #32605

mkoeppe commented 3 years ago
comment:18

Replying to @mkoeppe:

With polymake from Andreas's tap, need to do export PERL5LIB="[...]" (this is done in the polymake script but we use the callable library through jupymake)

Fixed in latest version of the homebrew formula according to https://github.com/polymake/polybundle/issues/19#issuecomment-938612849

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 9ad9e2f to 1832397

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

2576f86build/make/Makefile.in: If a script package has no spkg-install, run "sage -info" and exit with error
feb8de7build/pkgs/: Remove spkg-install scripts for dummy script packages
8f782c0.github/workflows/tox-{optional,experimental}.yml: Do not try to test dummy script packages
4b292bebuild/pkgs/perl_mongodb/spkg-install: Remove
a7b6352build/bin/sage-spkg-info: Fix display of system packages
e65b309bootstrap: Do not provide ./configure --enable-SPKG options for dummy optional packages
b485d46m4/sage_spkg_collect.m4: Do not advertise dummy optional packages as installable
8c8e1c4Merge #31163
015b899build/bin/sage-print-system-package-command: Handle cpan
1832397Merge #32605
mkoeppe commented 3 years ago

Changed dependencies from #32605 to #32605, #30887

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 1832397 to 83a98be

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

ea548d7sage.features.four_ti_2: New, use it in sage.interfaces.four_ti_2, sage.sandpiles
f826dedbuild/pkgs/4ti2/spkg-configure.m4: Check for executable's with prefix 4ti2_ too
56016ceuse AC_LINK_IFELSE instead of obsolete AC_TRY_LINK
2b45b77sage.feature.join_feature: New, factored out from LatteFeature; use it to implement FourTi2Feature
5c23cc9DocTestReporter: Fix 'sage -t --optional=all'
1b8634dsage.doctest.external: Add 4ti2
d9d4f99Merge tag '9.4.beta6' into t/30887/public/30887
646e182src/sage/features/four_ti_2.py: Move import of SAGE_ENV inside the `__init__` method, to remove confusion of sage.misc.dev_tools
b090dc0Merge #30887
83a98besrc/sage/features/polymake.py: New
mkoeppe commented 3 years ago

Changed dependencies from #32605, #30887 to #32605, #30887, #32547

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

ccd779a#32547 : replace nonexistent llvm-toolchain with clang as Debian alternative to llvm spkg
b2281faMerge #32547
d2cbfe7build/pkgs/polymake/distros/homebrew.txt: New
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 83a98be to d2cbfe7

mkoeppe commented 3 years ago

Author: Matthias Koeppe

mkoeppe commented 3 years ago
comment:25

Tested successfully on homebrew

mkoeppe commented 3 years ago
comment:27

Testing with tox -e docker-ubuntu-groovy-maximal, where configure accepts system polymake 4.1-4build1, gives many doctest failures of the form:

      File "/sage/local/lib/python3.8/site-packages/sage/interfaces/polymake.py", line 2598, in _start
        InitializePolymake()          # Can only be called once
    JuPyMake.PolymakeError: polymake::Main - /usr/lib/polymake/shared is not a symlink

Indeed:

ls -l /usr/lib/polymake/
total 12
-rw-r--r-- 1 root root 2024 Aug 17  2020 config.ninja
drwxr-xr-x 2 root root 4096 Oct  8 21:18 lib
drwxr-xr-x 3 root root 4096 Oct  8 21:18 perlx
mkoeppe commented 3 years ago
comment:28

... so clearly we need to extend spkg-configure.m4 to test that libpolymake has not been debianized to death

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

f1f362dbuild/pkgs/polymake/spkg-configure.m4: Actually use POLYMAKE_VERSION_MIN
c6b5f8cbuild/pkgs/polymake/spkg-configure.m4: Link and run a test program with libpolymake
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from d2cbfe7 to c6b5f8c

mkoeppe commented 3 years ago
comment:30

Now correctly rejects polymake on this system (tox -e docker-ubuntu-groovy-maximal -- config.status)

mkoeppe commented 3 years ago
comment:31

Same on ubuntu-impish-maximal (with system polymake 4.3)

mkoeppe commented 3 years ago
comment:32

On fedora-34-maximal:

configure:34443: checking whether libpolymake works
configure:34479: g++ -o conftest  -I/usr/include/polymake/external -I/usr/include/arb -I/usr/include/eigen3 -I/usr/include/gfanlib -I/usr/include/nauty -I/usr/include -I/usr/include -DPOLYMAKE_VERSION=404 -fPIC -pipe -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wno-unused-local-typedefs -std=c++14 -ftemplate-depth-200 -fno-strict-aliasing -fopenmp -Wshadow -Wlogical-op -Wconversion -Wzero-as-null-pointer-constant -Wno-parentheses -Wno-error=unused-function -Wno-stringop-overflow -Wno-array-bounds -Wno-maybe-uninitialized -Wno-free-nonheap-object -DPOLYMAKE_WITH_FLINT -O2 -DPOLYMAKE_DEBUG=0   -Dlinux   -I/usr/include -lpolymake -Wl,-z,relro -Wl,--as-needed -lnormaliz -ldl -fuse-ld=gold -fopenmp -L/usr/lib64 -Wl,-E  conftest.cpp -lmpfi -lmpc -lm4rie -llrcalc -lnauty -lhomfly -liml -lgiac -lecm -lpari -lcurl -lcliquer -lcddgmp -lbz2 -lflint -lmpfr -lglpk -lgmp -lm  -lntl -lLfunction >&5
cc1plus: error: '-Wformat-security' ignored without '-Wformat' [-Werror=format-security]
cc1plus: some warnings being treated as errors
mkoeppe commented 3 years ago
comment:33

Same on fedora-35-maximal

So system polymake is rejected. This is correct because building jupymake would fail with the same error.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

d9fc03ebuild/pkgs/perl_cpan_polymake_prereq/distros/fedora.txt: perl-TermReadKey, not perl-Term-ReadKey
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from c6b5f8c to d9fc03e

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from d9fc03e to 777d1b8

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

777d1b8build/pkgs/polymake/distros/nix.txt: New
dimpase commented 3 years ago
comment:38

needs a rebase

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

edce768Merge tag '9.5.beta3' into t/31527/spkg_configure_m4_for_polymake
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 777d1b8 to edce768

mkoeppe commented 3 years ago

Changed dependencies from #32605, #30887, #32547 to #32605

dimpase commented 3 years ago
comment:41

gentoo's polymake is too old atm, it's 3.0_p2 there (and broken).