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

Fix gp2c spkg-configure to let configure succeed on Fedora 32 #31051

Closed
dcoudert opened this issue Dec 15, 2020 · 28 comments
Closed

Fix gp2c spkg-configure to let configure succeed on Fedora 32 #31051

dcoudert opened this issue Dec 15, 2020 · 28 comments

Comments

@dcoudert
Copy link
Contributor

On some systems, e.g. Fedora 32, /bin is a symlink to /usr/bin
and the PATH has the symlink /bin in front of /usr/bin.

In this situation, with the version of build/pkgs/gp2c/spkg-configure.m4
from #30231 (merged in Sage 9.2.beta8), running ./configure fails
while checking for gp2c.

This ticket amends build/pkgs/gp2c/spkg-configure.m4 to solve
that problem.

The problem occurs even without trying to build gp2c, as currently
configure checks for system packages including of disabled optional
packages (see #29498 for fixing that).

CC: @dimpase @slel @orlitzky

Component: packages: optional

Keywords: gp2c

Author: David Coudert, Michael Orlitzky

Branch/Commit: fa3c4fc

Reviewer: Dima Pasechnik

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

@dcoudert
Copy link
Contributor Author

New commits:

524f4e6change AC_MSG_ERROR to AC_MSG_WARN in spkg-configure.m4 of gp2c

@dcoudert
Copy link
Contributor Author

Branch: public/misc/31051_gp2c

@dcoudert
Copy link
Contributor Author

Commit: 524f4e6

@slel

This comment has been minimized.

@slel
Copy link
Member

slel commented Dec 15, 2020

Changed keywords from none to gp2c

@slel slel changed the title change AC_MSG_ERROR to AC_MSG_ERROR in the configuration of gp2c Change AC_MSG_ERROR to AC_MSG_WARN in gp2c configuration Dec 15, 2020
@dimpase
Copy link
Member

dimpase commented Dec 15, 2020

Reviewer: Dima Pasechnik

@dimpase
Copy link
Member

dimpase commented Dec 15, 2020

comment:3

OK

@dimpase

This comment has been minimized.

@dimpase
Copy link
Member

dimpase commented Dec 15, 2020

comment:5

Do I get it right that the compilation goes through with the change on Fedora 32, right?

@dcoudert
Copy link
Contributor Author

comment:6

Yes, I was able to compile with this change (plus the use of upstream url for libsemigroups).

@mkoeppe
Copy link
Member

mkoeppe commented Dec 15, 2020

comment:7

I don't think this is the correct fix. When gp2c is enabled to be installed, then this should be a hard error

@orlitzky
Copy link
Contributor

comment:8

Replying to @mkoeppe:

I don't think this is the correct fix. When gp2c is enabled to be installed, then this should be a hard error

True, and building gp2c should also fail since we don't know where pari.cfg is. Like the comment says, "If we can't find pari.cfg, gp2c isn't going to work."

What was the original ./configure command, and what did it output? What does it output after the message was changed to a warning? Something is fishy.

@dcoudert
Copy link
Contributor Author

comment:9

I tried to upgrade from 9.3.beta3. After git pull on develop branch, I tried make build and it fails during configuration. the config.log can be found in the message https://groups.google.com/g/sage-release/c/dmqD6CIRUVo/m/9oCozIMkAwAJ.
and in this message https://groups.google.com/g/sage-release/c/dmqD6CIRUVo/m/CM7JJqJNAwAJ you can find the config.log with this modification.

I agree that this might be a symptom of another issue.

@orlitzky
Copy link
Contributor

comment:10

Ok, there are two things weird:

  1. Why is it trying to install the (optional) gp2c package when you haven't enabled it with --enable-gp2c?
  2. Why can't it find your system pari.cfg?

The real problem is the first item... but, I'm curious. Your config log shows...

configure:17361: checking for gp
configure:17379: found /bin/gp

Is that really where gp lives, or is it a symlink to /usr/bin/gp? Perhaps /bin is a symlink to /usr/bin? We use that path when guessing the location of pari.cfg, so having it return /bin/gp instead of /usr/bin/gp would throw a wrench into things. It's an easy fix however.

(But regardless, you haven't enabled gp2c at all, so you shouldn't be hitting this problem.)

@dcoudert
Copy link
Contributor Author

comment:11

You get it right, /bin is a symlink

gelati:/home/dcoudert>ls -ll /bin 
lrwxrwxrwx. 1 root root 7 Jan 28  2020 /bin -> usr/bin
gelati:/home/dcoudert> ls -l /usr/bin/gp*  
lrwxrwxrwx  1 root root       7 Nov 12 23:19 /usr/bin/gp -> gp-2.11
-rwxr-xr-x  1 root root  132936 Nov 12 23:19 /usr/bin/gp-2.11
...

I haven't enabled gp2c. May be it's a dependency of another package ? I haven't check that. I have (ok, it's certainly not the best way to get the list):

gelati:/home/dcoudert/sage> ./sage -t src/sage/graphs/print_graphs.py 
too few successful tests, not using stored timings
Running doctests with ID 2020-12-16-01-44-24-894c14a1.
Git branch: develop
Using --optional=benzene,bliss,buckygen,build,cryptominisat,csdp,dochtml,dot2tex,fedora,gap_packages,glucose,libsemigroups,mcqd,memlimit,pip,plantri,python_igraph,rubiks,sage,sage_numerical_backends_cplex,sage_spkg,tdlib,texttable
Doctesting 1 file.
sage -t --random-seed=0 src/sage/graphs/print_graphs.py
    [12 tests, 0.02 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------
Total time for all tests: 0.0 seconds
    cpu time: 0.0 seconds
    cumulative wall time: 0.0 seconds

@orlitzky
Copy link
Contributor

Changed branch from public/misc/31051_gp2c to u/mjo/ticket/31051

@orlitzky
Copy link
Contributor

comment:12

This should fix the second problem, and allow --enable-gp2c to work on systems where /bin is a symlink to /usr/bin. I still have no idea about the larger issue, though.


New commits:

fa3c4fcTrac #31051: support /bin -> /usr/bin symlink in gp2c spkg-configure.

@orlitzky
Copy link
Contributor

Changed commit from 524f4e6 to fa3c4fc

@mkoeppe
Copy link
Member

mkoeppe commented Dec 16, 2020

comment:13

Replying to @dcoudert:

I haven't enabled gp2c. May be it's a dependency of another package ?

For all packages, including non-enabled optional packages, the presence of system packages is checked. Wishlist tickets #29372, #29498 propose to change this.

@orlitzky
Copy link
Contributor

comment:14

Replying to @mkoeppe:

For all packages, including non-enabled optional packages, the presence of system packages is checked. Wishlist tickets #29372, #29498 propose to change this.

This failure is within an AS_IF([test "x$sage_spkg_install_gp2c" = "xyes"]... block. Should that be passing when gp2c is not enabled?

@slel

This comment has been minimized.

@slel slel changed the title Change AC_MSG_ERROR to AC_MSG_WARN in gp2c configuration Fix gp2c spkg-configure to let configure succeed on Fedora 32 Dec 16, 2020
@dcoudert
Copy link
Contributor Author

comment:16

It's working for me on that desktop. Thanks!

I let you decide if we can set back to positive review and how to change authors/reviewers.

@dimpase
Copy link
Member

dimpase commented Dec 16, 2020

comment:17

Looks good to me. Please add the names :-)

Let me also point out that the fact that my fix worked too is an indication that there could be a better way to discover pari.cfg than the one currently implemented in spkg-configure of gp2c.

@orlitzky
Copy link
Contributor

Changed author from David Coudert to David Coudert, Michael Orlitzky

@orlitzky
Copy link
Contributor

comment:18

I would still very much prefer that we not do these checks at all when gp2c is disabled, but if everyone's content to do that in some other ticket, this is still an improvement.

Ultimately, pari itself should tell us where pari.cfg is installed, via either pkg-config or something like gp --pari-cfg. Nobody thinks enumerating all possible locations is a good way to do it, but the build would eventually fail if gp2c was enabled and if we allowed the check to proceed with a warning. The previous way of running find on all of /usr and then waiting five minutes was even worse.

@dimpase
Copy link
Member

dimpase commented Dec 19, 2020

comment:19

pari.cfg file can be found in the PARI object directory and is installed in $prefix/lib/pari/.

this is in gp2c docs of the Par project:
https://pari.math.u-bordeaux.fr/pub/pari/manuals/gp2c/gp2c.html

Fedora is wrong about the location it installs pari.cfg to

@orlitzky
Copy link
Contributor

comment:20

And those docs are wrong =)

pari.cfg is installed to $(sysdatadir), which defaults to (but is not guaranteed to be) $prefix/lib/pari

@vbraun
Copy link
Member

vbraun commented Dec 27, 2020

Changed branch from u/mjo/ticket/31051 to fa3c4fc

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