#31051 closed defect (fixed)

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

Reported by: dcoudert Owned by:
Priority: major Milestone: sage-9.3
Component: packages: optional Keywords: gp2c
Cc: dimpase, slelievre, mjo Merged in:
Authors: David Coudert, Michael Orlitzky Reviewers: Dima Pasechnik
Report Upstream: N/A Work issues:
Branch: fa3c4fc (Commits, GitHub, GitLab) Commit: fa3c4fc42254a6c3adda5c4d65d05aba82ad0432
Dependencies: Stopgaps:

Status badges

Description (last modified by slelievre)

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).

Change History (21)

comment:1 Changed 12 months ago by dcoudert

  • Branch set to public/misc/31051_gp2c
  • Commit set to 524f4e6bcdc4750d5a532c3615f39e420f183b1c
  • Status changed from new to needs_review

New commits:

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

comment:2 Changed 12 months ago by slelievre

  • Cc slelievre added
  • Description modified (diff)
  • Keywords gp2c added
  • Summary changed from change AC_MSG_ERROR to AC_MSG_ERROR in the configuration of gp2c to Change AC_MSG_ERROR to AC_MSG_WARN in gp2c configuration

comment:3 Changed 12 months ago by dimpase

  • Cc mjo added
  • Reviewers set to Dima Pasechnik
  • Status changed from needs_review to positive_review

OK

comment:4 Changed 12 months ago by dimpase

  • Description modified (diff)

comment:5 Changed 12 months ago by dimpase

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

comment:6 Changed 12 months ago by dcoudert

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

comment:7 follow-up: Changed 12 months ago by mkoeppe

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

comment:8 in reply to: ↑ 7 Changed 12 months ago by mjo

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.

comment:9 Changed 12 months ago by dcoudert

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.

comment:10 Changed 12 months ago by mjo

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.)

comment:11 follow-up: Changed 12 months ago by dcoudert

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

comment:12 Changed 12 months ago by mjo

  • Branch changed from public/misc/31051_gp2c to u/mjo/ticket/31051
  • Commit changed from 524f4e6bcdc4750d5a532c3615f39e420f183b1c to fa3c4fc42254a6c3adda5c4d65d05aba82ad0432
  • Status changed from positive_review to needs_work

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.

comment:13 in reply to: ↑ 11 ; follow-up: Changed 12 months ago by mkoeppe

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.

comment:14 in reply to: ↑ 13 Changed 12 months ago by mjo

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?

comment:15 Changed 12 months ago by slelievre

  • Description modified (diff)
  • Summary changed from Change AC_MSG_ERROR to AC_MSG_WARN in gp2c configuration to Fix gp2c spkg-configure to let configure succeed on Fedora 32

comment:16 Changed 12 months ago by dcoudert

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.

comment:17 Changed 12 months ago by dimpase

  • Status changed from needs_work to positive_review

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.

comment:18 Changed 12 months ago by mjo

  • Authors changed from David Coudert to David Coudert, Michael Orlitzky

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.

comment:19 Changed 12 months ago by dimpase

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

Last edited 12 months ago by dimpase (previous) (diff)

comment:20 Changed 12 months ago by mjo

And those docs are wrong =)

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

comment:21 Changed 11 months ago by vbraun

  • Branch changed from u/mjo/ticket/31051 to fa3c4fc42254a6c3adda5c4d65d05aba82ad0432
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.