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

Add spkg-configure.m4 for 4ti2, remove direct use of SAGE_LOCAL #30887

Closed
mkoeppe opened this issue Nov 11, 2020 · 67 comments
Closed

Add spkg-configure.m4 for 4ti2, remove direct use of SAGE_LOCAL #30887

mkoeppe opened this issue Nov 11, 2020 · 67 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Nov 11, 2020

Part of #27330.

In addition to adjustments to src/sage/interfaces/four_ti_2.py, also the following needs changing:

src/sage/sandpiles/sandpile.py:path_to_zsolve = os.path.join(SAGE_LOCAL, 'bin', 'zsolve')

https://repology.org/project/4ti2/versions

CC: @dimpase @orlitzky @slel @antonio-rojas @kiwifb @jengelh @kwankyu @seblabbe

Component: packages: optional

Keywords: 4ti2, spkg-configure.m4

Author: Samuel Lelièvre, Matthias Koeppe

Branch/Commit: 646e182

Reviewer: Dima Pasechnik, Antonio Rojas

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

@mkoeppe mkoeppe added this to the sage-9.3 milestone Nov 11, 2020
@slel
Copy link
Member

slel commented Mar 22, 2021

Commit: d79e1c1

@slel
Copy link
Member

slel commented Mar 22, 2021

Changed keywords from none to 4ti2, spkg-configure.m4

@slel

This comment has been minimized.

@slel
Copy link
Member

slel commented Mar 22, 2021

Author: Samuel Lelièvre, ...

@slel
Copy link
Member

slel commented Mar 22, 2021

Branch: public/30887

@slel
Copy link
Member

slel commented Mar 22, 2021

comment:1

Here is distro information to get things started.


New commits:

d79e1c130887: Add distro info for 4ti2

@slel slel changed the title spkg-configure.m4 for 4ti2 Add spkg-configure.m4 for 4ti2 Mar 22, 2021
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 23, 2021

comment:2

latte_int uses 4ti2 as a library. The test is here: https://github.com/latte-int/latte/blob/master/m4/4ti2-check.m4#L48

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 23, 2021

comment:3

Also Py4ti2 (to be added in #31363) uses 4ti2 as a library - https://github.com/alfsan/Py4ti2/blob/master/setup.py

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 23, 2021

comment:4

singular is able to use 4ti2 via the command-line interface. Checks are done in https://github.com/Singular/Singular/blob/spielwiese/configure.ac#L352

configure.ac:AC_CHECK_PROGS([FOURTITWO_HILBERT], [hilbert 4ti2-hilbert])
configure.ac:AC_CHECK_PROGS([FOURTITWO_MARKOV], [markov 4ti2-markov])
configure.ac:AC_CHECK_PROGS([FOURTITWO_GRAVER], [graver 4ti2-graver])

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 23, 2021

comment:5

src/sage/interfaces/four_ti_2.py calls the executables

$ grep call src/sage/interfaces/four_ti_2.py
    def call(self, command, project, verbose=True):
            sage: four_ti_2.call("groebner", "test_file", False) # optional - 4ti2
        subprocess.call(cmd, shell=True, cwd=self.directory())
        self.call('zsolve -q', project)
        self.call('qsolve -q -parbitrary', project)
        self.call('rays -q -parbitrary', project)
        self.call('hilbert -q', project)
        self.call('graver -q', project)
        self.call('ppi 2> /dev/null', n)
        self.call('circuits -q -parbitrary', project)
        self.call('groebner -q -parbitrary', project)

and does not know that Debian installs them with an executable prefix.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 23, 2021

comment:6

polymake calls the executables groebner, zsolve, circuits, which are configurable (https://github.com/polymake/polymake/blob/c2a326f240b11a06e1b1d5fd1c2ca7278bbe60a2/apps/polytope/rules/_4ti2.rules) but it does not know that Debian installs them with an executable prefix

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 23, 2021

Dependencies: #31534

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 23, 2021

Changed commit from d79e1c1 to 602ffb0

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 23, 2021

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

7c272ecAdd MacPorts package info
8c9f53c30504: Add _recommended package info for MacPorts
bf0a4d230504: Use zmq-devel in MacPorts for zeromq
e42448930504: Fix gcc gfortran openblas info for MacPorts
b8b7092build/pkgs/{gcc,gfortran}/distros/macports.txt: Fixup
4acfc5cMerge #30504
857b7d5tox.ini: In -maximal environments, use IGNORE_MISSING_SYSTEM_PACKAGES=yes for all non-current distributions
4e561actox.ini: Use IGNORE_MISSING_SYSTEM_PACKAGES=no for rolling distributions, but IGNORE_MISSING_SYSTEM_PACKAGES=yes for unstable distributions
30d0e8aMerge #31534
602ffb0build/pkgs/4ti2/spkg-configure.m4: New

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 24, 2021

Changed commit from 602ffb0 to ff25e8f

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 24, 2021

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

ff25e8fbuild/pkgs/4ti2/spkg-configure.m4: Fix quoting

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Mar 28, 2021
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 23, 2021

Changed commit from ff25e8f to dd364a5

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 23, 2021

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

0f1317330887: Add distro info for 4ti2
1c1c1c8build/pkgs/4ti2/spkg-configure.m4: New
dd364a5build/pkgs/4ti2/spkg-configure.m4: Fix quoting

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jun 23, 2021

Changed dependencies from #31534 to none

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 23, 2021

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

45f8e59build/pkgs/4ti2/spkg-configure.m4: Check for executables with prefix '4ti2-' too
390c0d2build/pkgs/sage_conf/src/sage_conf.py.in, src/sage/env.py: Add FOURTITWO... variables

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 23, 2021

Changed commit from dd364a5 to 390c0d2

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jun 23, 2021

comment:14

On ubuntu-focal-maximal:

Checking whether SageMath should install SPKG 4ti2...
checking whether any of gmp mpir glpk zlib is installed as or will be installed as SPKG... no
checking for hilbert... no
checking for 4ti2-hilbert... 4ti2-hilbert
checking for markov... no
checking for 4ti2-markov... 4ti2-markov
checking for graver... no
checking for 4ti2-graver... 4ti2-graver
checking for zsolve... no
checking for 4ti2-zsolve... 4ti2-zsolve
checking for qsolve... no
checking for 4ti2-qsolve... 4ti2-qsolve
checking for rays... no
checking for 4ti2-rays... 4ti2-rays
checking for ppi... no
checking for 4ti2-ppi... 4ti2-ppi
checking for circuits... no
checking for 4ti2-circuits... 4ti2-circuits
checking for groebner... no
checking for 4ti2-groebner... 4ti2-groebner
checking for library 4ti2gmp... no
configure: no suitable system package found for SPKG 4ti2

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jun 24, 2021

comment:15

Ubuntu packaging does not have the headers and has the shared libs in a nonstandard place - can't use

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 19, 2021

comment:40

Thanks!

@vbraun
Copy link
Member

vbraun commented Jul 21, 2021

comment:41

Tests fail

@dimpase
Copy link
Member

dimpase commented Jul 21, 2021

comment:42

Volker, there are dozens of different ways external packages, vendored or not, with dependencies, may fail. More info please.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 25, 2021

Changed commit from 1b8634d to d9d4f99

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 25, 2021

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

d9d4f99Merge tag '9.4.beta6' into t/30887/public/30887

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 25, 2021

comment:44

Works fine with and without 4ti2 installed. If there is a failure on some machine, we obviously need more information than "tests fail".

@vbraun
Copy link
Member

vbraun commented Jul 25, 2021

comment:45
sage -t --long --warn-long 43.6 --random-seed=0 src/sage/misc/dev_tools.py
**********************************************************************
File "src/sage/misc/dev_tools.py", line 487, in sage.misc.dev_tools.import_statements
Failed example:
    import_statements('SAGE_ENV')
Expected:
    from sage.env import SAGE_ENV
Got:
    # ** Warning **: several modules for the object {'UNAME': 'Linux', 'HOSTNAME': 'zen', 'LOCAL_IDENTIFIER': 'zen.1421426', 'SAGE_VERSION': '9.4.beta6', 'SAGE_DATE': '2021-07-24', 'SAGE_VERSION_BANNER': 'SageMath version 9.4.beta6, Release Date: 2021-07-24', 'SAGE_VENV': '/home/release/Sage/local', 'SAGE_LIB': '/home/release/Sage/local/lib64/python3.9/site-packages', 'SAGE_EXTCODE': '/home/release/Sage/local/lib64/python3.9/site-packages/sage/ext_data', 'SAGE_VENV_SPKG_INST': '/home/release/Sage/local/var/lib/sage/installed', 'SAGE_LOCAL': '/home/release/Sage/local', 'SAGE_SHARE': '/home/release/Sage/local/share', 'SAGE_DOC': '/home/release/Sage/local/share/doc/sage', 'SAGE_SPKG_INST': '/home/release/Sage/local/var/lib/sage/installed', 'SAGE_ROOT': '/home/release/Sage', 'SAGE_SRC': '/home/release/Sage/src', 'SAGE_DOC_SRC': '/home/release/Sage/src/doc', 'SAGE_PKGS': '/home/release/Sage/build/pkgs', 'SAGE_ROOT_GIT': '/home/release/Sage/.git', 'DOT_SAGE': '/home/release/.sage/', 'SAGE_STARTUP_FILE': '/home/release/.sage/init-doctests.sage', 'SAGE_ARCHFLAGS': 'unset', 'SAGE_PKG_CONFIG_PATH': '/home/release/Sage/local/lib/pkgconfig', 'CONWAY_POLYNOMIALS_DATA_DIR': '/home/release/Sage/local/share/conway_polynomials', 'GRAPHS_DATA_DIR': '/home/release/Sage/local/share/graphs', 'ELLCURVE_DATA_DIR': '/home/release/Sage/local/share/ellcurves', 'POLYTOPE_DATA_DIR': '/home/release/Sage/local/share/reflexive_polytopes', 'GAP_ROOT_DIR': '/home/release/Sage/local/share/gap', 'THEBE_DIR': '/home/release/Sage/local/share/thebe', 'COMBINATORIAL_DESIGN_DATA_DIR': '/home/release/Sage/local/share/combinatorial_designs', 'CREMONA_MINI_DATA_DIR': '/home/release/Sage/local/share/cremona', 'CREMONA_LARGE_DATA_DIR': '/home/release/Sage/local/share/cremona', 'JMOL_DIR': '/home/release/Sage/local/share/jmol', 'MATHJAX_DIR': '/home/release/Sage/local/share/mathjax', 'MTXLIB': '/home/release/Sage/local/share/meataxe', 'THREEJS_DIR': '/home/release/Sage/local/share/threejs-sage', 'PPLPY_DOCS': '/home/release/Sage/local/share/doc/pplpy', 'MAXIMA': '/home/release/Sage/local/bin/maxima', 'MAXIMA_FAS': '/home/release/Sage/local/lib/ecl/maxima.fas', 'KENZO_FAS': '/home/release/Sage/local/lib/ecl/kenzo.fas', 'SAGE_NAUTY_BINS_PREFIX': '', 'FOURTITWO_HILBERT': '', 'FOURTITWO_MARKOV': '', 'FOURTITWO_GRAVER': '', 'FOURTITWO_ZSOLVE': '', 'FOURTITWO_QSOLVE': '', 'FOURTITWO_RAYS': '', 'FOURTITWO_PPI': '', 'FOURTITWO_CIRCUITS': '', 'FOURTITWO_GROEBNER': '', 'ARB_LIBRARY': 'arb', 'CBLAS_PC_MODULES': 'cblas', 'ECL_CONFIG': '/home/release/Sage/local/bin/ecl-config', 'NTL_INCDIR': '', 'NTL_LIBDIR': '', 'LIE_INFO_DIR': '/home/release/Sage/local/lib/LiE', 'OPENMP_CFLAGS': '-fopenmp', 'OPENMP_CXXFLAGS': '-fopenmp', 'SAGE_BANNER': '', 'SAGE_IMPORTALL': 'yes', 'SINGULAR_SO': '/home/release/Sage/local/lib/libSingular-4.2.0.so', 'GAP_SO': '/home/release/Sage/local/lib/libgap.so.0.0.0'}: sage.all, sage.all_cmdline, sage.env, sage.features.four_ti_2, sage.repl.ipython_kernel.all_jupyter
    from sage.env import SAGE_ENV
**********************************************************************
1 item had failures:
   1 of  37 in sage.misc.dev_tools.import_statements
    [60 tests, 1 failure, 0.22 s]
----------------------------------------------------------------------
sage -t --long --warn-long 43.6 --random-seed=0 src/sage/misc/dev_tools.py  # 1 doctest failed
----------------------------------------------------------------------

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 25, 2021

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

646e182src/sage/features/four_ti_2.py: Move import of SAGE_ENV inside the `__init__` method, to remove confusion of sage.misc.dev_tools

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 25, 2021

Changed commit from d9d4f99 to 646e182

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 25, 2021

comment:47

Thanks, fixed.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 3, 2021

comment:49

Let's get this in please.

@antonio-rojas
Copy link
Contributor

comment:50

All good here with both distro packaging and building from source against system 4ti2

@antonio-rojas
Copy link
Contributor

Changed reviewer from Dima Pasechnik to Dima Pasechnik, Antonio Rojas

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 4, 2021

comment:51

Thank you!

@vbraun
Copy link
Member

vbraun commented Oct 10, 2021

Changed branch from public/30887 to 646e182

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants