cmake should make use of pkgconfig to detect shared libuv and gmp libs correctly #6183
Open
1 task done
Labels
bug
Something isn't working
Prerequisites
Please put an X between the brackets as you perform the following steps:
https://github.com/leanprover/lean4/issues
Description
With lean4 built from source on Linux
/usr/lib/libuv.so
and/usr/lib/libgmp.so
are being passing directly to be linked by gcc (rather than-luv
and-lgmp
etc).This causes many warnings from gcc: see below.
I am not good with cmake and so far failed to come up with a viable patch for this:
the current cmake (as of 4.13/4.14) in
src/cmake/Modules/
leads toGMP_LIBRARIES=/usr/lib/libgmp.so
and
LIBUV_LIBRARIES=/usr/lib/libuv.so
on Linux which is not desired (at least for gcc).I suppose I could also try clang - is that recommended for Linux builds?
I tried to use the cmake
PkgConfig
module macros but failed to get the right kind of output (boggle).Note pkgconf is a compatible replacement of pkg-config: they are mostly equivalent.
It doesn't matter whether pkgconf or pkg-config is used.
For reference on Fedora Linux:
Whether all those are strictly needed I dunno, but they are listed.
But this is what
LIBUV_LIBRARIES
should equal or at the very least-luv
.Context
[Broader context that the issue occurred in. If there was any prior discussion on the Lean Zulip, link it here as well.]
Steps to Reproduce
Expected behavior:
No unused linker warnings
Actual behavior:
(This is with patched in -lgmp, so normally there would be double the number of warnings.)
Versions
on Fedora Linux
Additional Information
I am currently working around it by directly patching pkgconf --libs output into
src/cmake/Modules/Find*.cmake
(and for stage0 of course).See fedora-haskell/lean4@c88870c
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
The text was updated successfully, but these errors were encountered: