Closed h1laryz closed 6 months ago
Thanks for opening this, I’m sorry to see you are running into issues. I have never seen zlib fail to be found, it’s generally installed on all systems. Can you check if a libz.a/.so exists anywhere in /usr?
Thanks for opening this, I’m sorry to see you are running into issues. I have never seen zlib fail to be found, it’s generally installed on all systems. Can you check if a libz.a/.so exists anywhere in /usr?
~ $ find /usr -name 'libz.*'
/usr/lib/x86_64-linux-gnu/libz.so.1
/usr/lib/x86_64-linux-gnu/libz.so.1.2.11
/usr/lib/x86_64-linux-gnu/libz.a
/usr/lib/x86_64-linux-gnu/libz.so
~ $
Looking forward to your response!
The error stems from upstream at https://github.com/davea42/libdwarf-code/blob/4436b83de65fdc9df9e011decf2f643fb345b892/src/lib/libdwarf/cmake/libdwarfConfig.cmake.in#L7 but I can't see why this would fail.
Can you verify that /usr/lib/x86_64-linux-gnu/pkgconfig/zlib.pc
exists?
~ $ ls -a /usr/lib/x86_64-linux-gnu/pkgconfig/ | grep zlib
zlib.pc
so, actually, it exists
Thanks for your patience, I am going to address this tomorrow. I haven't come up with a workaround but I should be able to address the issue upstream.
I have been able to reproduce on a vm
Edit a few hours later: I think I understand the problem. I’ll look more tomorrow.
So, summary of the issue: libassert
's cmake config loads cpptrace
's cmake config which loads libdwarf
's cmake config which calls find_dependency(ZLIB)
which calls find_package
which runs FindZLIB.cmake
but that script fails to find zlib because cmake isn't searching in /usr/lib/x86_64-linux-gnu
by default. Related: https://github.com/mesonbuild/meson/issues/4812, https://gitlab.kitware.com/cmake/cmake/-/issues/20127.
Workaround: Call set(ZLIB_ROOT "/usr/lib/x86_64-linux-gnu")
before find_package(libassert REQUIRED)
. Or using an appropriate toolchain file should work.
I'm going to look into why CI didn't catch this problem and also I will try to find a way to make libdwarf or cpptrace automatically figure this out.
I have just realized the issue here is not libassert, cpptrace, libdwarf, or FindZLIB. It's using find_package(libassert REQUIRED)
before project(test CXX)
. If you move project(test CXX)
to the top everything works.
I've opened an issue on the cmake repo regarding improving diagnostics here https://gitlab.kitware.com/cmake/cmake/-/issues/25941.
I have just realized the issue here is not libassert, cpptrace, libdwarf, or FindZLIB. It's using
find_package(libassert REQUIRED)
beforeproject(test CXX)
. If you moveproject(test CXX)
to the top everything works.I've opened an issue on the cmake repo regarding improving diagnostics here https://gitlab.kitware.com/cmake/cmake/-/issues/25941.
oh, i am so sorry for such a stupid wasting your time :)
All good :) It’s super subtle.
I know it's not the best approach to install libs, but in my project already all libs are installed with
sudo make install
. After doingbut in my test project:
I have a problem on cmake generation:
Maybe it's a problem that i have this package installed with apt?
Please provide a solution. I need this library