Opened 22 months ago

Closed 5 months ago

#31403 closed defect (fixed)

giac: Make cliquer a dependency, libnauty an optional dependency

Reported by: Matthias Köppe Owned by:
Priority: critical Milestone: sage-9.7
Component: packages: standard Keywords:
Cc: François Bissey, Dima Pasechnik, David Joyner, Bernard Parisse, Jerry James Merged in:
Authors: Matthias Koeppe Reviewers: Dima Pasechnik
Report Upstream: N/A Work issues:
Branch: 06c4df1 (Commits, GitHub, GitLab) Commit: 06c4df159874b6cb8acbfbf77ff9526b788f093a
Dependencies: Stopgaps:

Status badges

Description (last modified by Matthias Köppe)

giac uses libnauty if it finds it, so it should be an optional dependency.

Also, giac uses cliquer if it finds it, see https://groups.google.com/g/sage-release/c/R-8gvElDIUo/m/tHvIEdaQAAAJ

We add these missing dependencies.

Follow up: if libnauty is not configured to be installed (nor present as a system package), then we should disable its use by giac. The corresponding test in giac's configure script is not robust - it explicitly checks in /usr/local; which may be disabled on macOS using -isysroot.

Change History (33)

comment:1 Changed 21 months ago by Matthias Köppe

Milestone: sage-9.3sage-9.4

Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review of ticket status, priority, and last modification date.

comment:2 Changed 17 months ago by Matthias Köppe

Milestone: sage-9.4sage-9.5

comment:3 Changed 12 months ago by Matthias Köppe

Milestone: sage-9.5sage-9.6

comment:4 Changed 8 months ago by Matthias Köppe

Milestone: sage-9.6sage-9.7

comment:5 Changed 7 months ago by Matthias Köppe

Cc: François Bissey Dima Pasechnik David Joyner added
Milestone: sage-9.7sage-9.6
Priority: majorblocker
Summary: giac: Make libnauty an optional dependencygiac: Make cliquer a dependency, libnauty an optional dependency

comment:6 Changed 7 months ago by Matthias Köppe

Branch: u/mkoeppe/giac__make_cliquer_a_dependency__libnauty_an_optional_dependency

comment:7 Changed 7 months ago by Matthias Köppe

Authors: Matthias Koeppe
Commit: 06c4df159874b6cb8acbfbf77ff9526b788f093a

New commits:

06c4df1build/pkgs/giac/dependencies: Add cliquer, add libnauty as an optional dep

comment:8 Changed 7 months ago by Matthias Köppe

Cc: Bernard Parisse added
Description: modified (diff)

comment:9 Changed 7 months ago by Matthias Köppe

Status: newneeds_review

comment:10 Changed 7 months ago by François Bissey

This is just wrong. libcliquer is not a direct dependency of giac, it only depends on it through nauty.

$ readelf -d /usr/lib64/libgiac.so

Dynamic section at offset 0x1377818 contains 42 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libntl.so.43]
 0x0000000000000001 (NEEDED)             Shared library: [libpari-gmp-tls.so.7]
 0x0000000000000001 (NEEDED)             Shared library: [libgsl.so.27]
 0x0000000000000001 (NEEDED)             Shared library: [liblapack.so.3]
 0x0000000000000001 (NEEDED)             Shared library: [libblas.so.3]
 0x0000000000000001 (NEEDED)             Shared library: [libnauty.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libcurl.so.4]
 0x0000000000000001 (NEEDED)             Shared library: [libglpk.so.40]
 0x0000000000000001 (NEEDED)             Shared library: [libpng16.so.16]
 0x0000000000000001 (NEEDED)             Shared library: [libecm.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libmpfi.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libmpfr.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgmp.so.10]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [ld-linux-x86-64.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x000000000000000e (SONAME)             Library soname: [libgiac.so.0]

No libcliquer above. But

$ readelf -d /usr/lib64/libnauty.so

Dynamic section at offset 0x76d08 contains 29 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libcliquer.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [ld-linux-x86-64.so.2]
 0x000000000000000e (SONAME)             Library soname: [libnauty.so.2]

libcliquer is present here. Of course when you look at ldd's output you see all the libraries that are needed in a transitive fashion, so libcliquer shows up there. But libcliquer doesn't appear to be directly linked to libgiac or giac for that matter.

comment:12 Changed 7 months ago by François Bissey

I am just looking at the configure script for giac

AC_CHECK_LIB(cliquer,main) 
AC_CHECK_LIB(nauty,main)
AC_CHECK_HEADERS(nauty/naututil.h)

It is all automagic. I am fairly sure the libcliquer detection is there so that when nauty is found the libcliquer flags are properly included too. Notice how no headers are checked for cliquer, just adding the library for linking.

comment:13 Changed 7 months ago by François Bissey

Another point is that the giac actively uses HAVE_LIBNAUTY in some code but HAVE_LIBCLIQUER is only present in configure objects. So nauty is optional and cliquer is just its dependency.

comment:14 Changed 7 months ago by Matthias Köppe

Our nauty package also does not declare a dependency on cliquer. The dependency has to go somewhere

comment:15 Changed 7 months ago by François Bissey

We definitely need to add cliquer to nauty then.

comment:16 in reply to:  13 Changed 7 months ago by Matthias Köppe

Replying to fbissey:

Another point is that the giac actively uses HAVE_LIBNAUTY in some code but HAVE_LIBCLIQUER is only present in configure objects. So nauty is optional and cliquer is just its dependency.

This certainly makes sense, given upstream nauty's inadequate build system.

comment:17 in reply to:  15 Changed 7 months ago by Matthias Köppe

Replying to fbissey:

We definitely need to add cliquer to nauty then.

Actually it looks like upstream nauty (and thus our package) uses a vendored copy of cliquer.

comment:18 Changed 7 months ago by Matthias Köppe

So on systems with nauty linking to an unvendored cliquer (Debian?), I think it will be nondeterministic whether the GIAC build picks up our libcliquer or system libcliquer.

comment:19 Changed 7 months ago by Matthias Köppe

Adding the dependency will remove this nondeterminism.

comment:20 Changed 7 months ago by François Bissey

You are posting too fast for me to make coherent answers :) I guess removing the non-deterministic behavior is the best course of action. debian, gentoo, probably fedora and arch, are unvendoring. I don't know about others or anaconda and brew.

comment:21 Changed 7 months ago by Matthias Köppe

Sorry - I should take a break

comment:22 Changed 7 months ago by François Bissey

It doesn't help that it is 9:50am here and I am in the middle of meetings and trying to help people with my "day job" at the same time.

comment:23 Changed 7 months ago by Matthias Köppe

Priority: blockercritical

comment:24 Changed 7 months ago by Dima Pasechnik

This misses the issue of system-wide nauty, which should only be used if it's linked to libcliquer, no? E.g. on Debian stable I see

$ ldd /usr/lib/x86_64-linux-gnu/libnauty.so
        linux-vdso.so.1 (0x00007ffe223f8000)
        libcliquer.so.1 => /lib/libcliquer.so.1 (0x00007e4c9cd43000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007e4c9cb7e000)
        /lib64/ld-linux-x86-64.so.2 (0x00007e4c9cfe4000)

but apparently this is not the case on Ubuntu 21.

comment:25 Changed 7 months ago by François Bissey

If ubuntu 21 uses a vendored version of cliquer, it doesn't have to be linked to an external library.

That's one of the issue we have here. Some distribution will use external cliquer while some other will not. That's why the branch is just going with "let's just make sure it is always present".

comment:26 in reply to:  25 Changed 7 months ago by Dima Pasechnik

Replying to fbissey:

If ubuntu 21 uses a vendored version of cliquer, it doesn't have to be linked to an external library.

Huh? The problem is that nauty must be linked to libcliquer (vendored or nor), not the other way around.

Last edited 7 months ago by Dima Pasechnik (previous) (diff)

comment:27 Changed 7 months ago by François Bissey

OK my phrasing may not have been the best. If ubuntu 21's nauty uses a vendored libcliquer - like the sage optional package does - it may not need libcliquer.

If ubuntu 21's nauty does use an external libcliquer and it isn't installed along nauty then it is a bug in that version of ubuntu.

comment:28 in reply to:  27 Changed 7 months ago by Dima Pasechnik

Cc: Jerry James added

Replying to fbissey:

OK my phrasing may not have been the best. If ubuntu 21's nauty uses a vendored libcliquer - like the sage optional package does - it may not need libcliquer.

If it used a vendored libcliquer we won't be seeing this bug reported. According to https://ubuntu.pkgs.org/21.10/ubuntu-universe-amd64/libnauty2_2.7r1+ds-2_amd64.deb.html libcliquer is "Required".

If ubuntu 21's nauty does use an external libcliquer and it isn't installed along nauty then it is a bug in that version of ubuntu.

cc-ing Fedora's people.

comment:29 Changed 7 months ago by Matthias Köppe

Milestone: sage-9.6sage-9.7

comment:31 Changed 5 months ago by Dima Pasechnik

Reviewers: Dima Pasechnik
Status: needs_reviewpositive_review

lgtm

comment:32 Changed 5 months ago by Matthias Köppe

Thanks!

comment:33 Changed 5 months ago by Volker Braun

Branch: u/mkoeppe/giac__make_cliquer_a_dependency__libnauty_an_optional_dependency06c4df159874b6cb8acbfbf77ff9526b788f093a
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.