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

Potential rpath problem with libplanarity #592

Open
fingolfin opened this issue Oct 12, 2023 · 4 comments
Open

Potential rpath problem with libplanarity #592

fingolfin opened this issue Oct 12, 2023 · 4 comments
Labels
build-system Label for PRs or issues related to the build system

Comments

@fingolfin
Copy link
Contributor

I was sitting with @AndreasEnge to update the guix package for GAP, and we tested which packages work. We run into an error that looks a lot like the libsemigroups problem related to rpath handling.

Specifically, it built the bundled libplanarity but that then later was not found. Fixing this may be a matter of adding KEXT_LDFLAGS += -Wl,-rpath,$(PWD)/bin/lib to the build system. But there is of course a second part, setting rpath for an installed libplanarity, which I guess could also be adapted from Semigroups....

@james-d-mitchell
Copy link
Member

james-d-mitchell commented Oct 12, 2023

Thanks for the report @fingolfin, I'm a bit confused though. Is this a problem in the Semigroups package or the Digraphs package? With libplanarity or libsemigroups? There's a mixture of both in the issue at present.

Wait I replied too fast, let me properly read your comment

@fingolfin
Copy link
Contributor Author

so my analogy was that Digraphs+libplanarity is roughly comparable to Semigroups + libsemigroups, in terms of build system requirements and issues. Thus, the issue of missing rpath settings in the library respectively the kernel extension also exists here, and must be fixed just as it was fixed in Semigroups. This is not just hypothetical but was born out by an experiment by Andreas Enge.

I would offer to submit a patch but unfortunately cannot currently reproduce the issue :-/. Perhaps @AndreasEnge can and is willing to help.... Or perhaps we can find a Linux distro where it is easy to repro and then setup a virtualized one to make it reproducible in CI tests?

@james-d-mitchell
Copy link
Member

Thanks @fingolfin, I understood this after reading your issue properly, I did not pay enough attention the first time :(

I'll be happy to accept a PR if one is forthcoming, I also can't reproduce this at present, so don't know exactly what will fix it.

@james-d-mitchell james-d-mitchell added the build-system Label for PRs or issues related to the build system label Jan 10, 2024
@AndreasEnge
Copy link

Hello, and sorry for the delay!

When I compile gap with digraphs in Guix (currently it is disabled), then execute
LoadPackage("digraphs");
I obtain the following:
Error, LOAD_DYN: failed to load kernel module /gnu/store/f7mza32nic84bzla026hidvsql9f0ig1-gap-4.12.2/share/gap/pkg/d
igraphs/bin/x86_64-unknown-linux-gnu-default64-kv8/digraphs.so, libplanarity.so.0: cannot open shared object
file: No such file or directory in
LOAD_DYN( filename ) at /gnu/store/f7mza32nic84bzla026hidvsql9f0ig1-gap-4.12.2/share/gap/lib/files.gd:592 called from
<function "LoadDynamicModule">( )
called from read-eval loop at /gnu/store/f7mza32nic84bzla026hidvsql9f0ig1-gap-4.12.2/share/gap/pkg/digraphs/init.g:24
Error, was not in any namespace at /gnu/store/f7mza32nic84bzla026hidvsql9f0ig1-gap-4.12.2/share/gap/lib/variable.g:269 called from
LEAVE_NAMESPACE( ); at /gnu/store/f7mza32nic84bzla026hidvsql9f0ig1-gap-4.12.2/share/gap/lib/package.gi:1325 called from
ReadPackage( pkgname, "init.g"
); at /gnu/store/f7mza32nic84bzla026hidvsql9f0ig1-gap-4.12.2/share/gap/lib/package.gi:1686 called from
<function "LoadPackage">( )
called from read-eval loop at stdin:2

Indeed ldd on digraphs.so shows that libplanarity.so.0 is not found.
Probably because it is in a different subdirectory:
/gnu/store/f7mza32nic84bzla026hidvsql9f0ig1-gap-4.12.2/share/gap/pkg/digraphs/bin/lib/libplanarity.so
instead of a subdirectory of the bin/ directory, and this is not put into the rpath.

But my impression is that this will be the same for the semigroups package (which depends on digraphs, so that I cannot meaningfully test it): ldd on semigroups.so also does not find libsemigroups.so.

This may be an idosyncrasy of Guix, or maybe a more general problem.

Andreas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-system Label for PRs or issues related to the build system
Projects
None yet
Development

No branches or pull requests

3 participants