jeremy-rifkin / libassert

The most over-engineered C++ assertion library
MIT License
539 stars 36 forks source link

Problems with make install #92

Closed h1laryz closed 6 months ago

h1laryz commented 6 months ago

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 doing

~/libassert/build $ cmake -DCMAKE_BUILD_TYPE=Debug ..                                                          git:main
-- Cpptrace auto config: Using libgcc unwind for unwinding
-- Cpptrace auto config: Using libdwarf for symbols
-- Cpptrace auto config: Using cxxabi for demangling
-- ZSTD VERSION: 1.5.5
-- Performing Test C_FLAG_DDEBUGLEVEL_1
-- Performing Test C_FLAG_DDEBUGLEVEL_1 - Success
-- Performing Test CXX_FLAG_DDEBUGLEVEL_1
-- Performing Test CXX_FLAG_DDEBUGLEVEL_1 - Success
-- CMAKE_INSTALL_PREFIX: /usr/local
-- CMAKE_INSTALL_LIBDIR: lib
-- ZSTD_LEGACY_SUPPORT not defined!
-- ZSTD_MULTITHREAD_SUPPORT is enabled
-- Building dwarfgen    ... OFF
-- Building dwarfexample... OFF
-- Building api tests   ...
-- HAVE_UINTPTR_T 1: uintptr_t defined in stdint.h... YES
-- uintptr_t value considered NO
-- HAVE_INTPTR_T 1: intptr_t defined in stdint.h... YES
-- intptr_t value considered NO
-- CMAKE_SIZEOF_VOID_P ... 8
-- Compiler warning options... NO
-- Install prefix ... /usr/local
-- Configuring done
-- Generating done
-- Build files have been written to: /home/h1lary/libassert/build
~/libassert/build $ sudo make install                                                                          git:main
Consolidate compiler generated dependencies of target libzstd_static
[  1%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/common/debug.c.o
[  1%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/common/entropy_common.c.o
[  2%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/common/error_private.c.o
[  3%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/common/fse_decompress.c.o
[  4%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/common/pool.c.o
[  5%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/common/threading.c.o
[  6%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/common/xxhash.c.o
[  6%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/common/zstd_common.c.o
[  7%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/compress/fse_compress.c.o
[  8%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/compress/hist.c.o
[  9%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/compress/huf_compress.c.o
[ 10%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/compress/zstd_compress.c.o
[ 11%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/compress/zstd_compress_literals.c.o
[ 11%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/compress/zstd_compress_sequences.c.o
[ 12%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/compress/zstd_compress_superblock.c.o
[ 13%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/compress/zstd_double_fast.c.o
[ 14%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/compress/zstd_fast.c.o
[ 15%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/compress/zstd_lazy.c.o
[ 16%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/compress/zstd_ldm.c.o
[ 16%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/compress/zstd_opt.c.o
[ 17%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/compress/zstdmt_compress.c.o
[ 18%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/decompress/huf_decompress.c.o
[ 19%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/decompress/huf_decompress_amd64.S.o
[ 20%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/decompress/zstd_ddict.c.o
[ 21%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/decompress/zstd_decompress.c.o
[ 21%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/decompress/zstd_decompress_block.c.o
[ 22%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/dictBuilder/cover.c.o
[ 23%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/dictBuilder/divsufsort.c.o
[ 24%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/dictBuilder/fastcover.c.o
[ 25%] Building C object _deps/zstd-build/lib/CMakeFiles/libzstd_static.dir/__/__/__/lib/dictBuilder/zdict.c.o
[ 26%] Linking C static library libzstd.a
[ 26%] Built target libzstd_static
Consolidate compiler generated dependencies of target dwarf
[ 27%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_abbrev.c.o
[ 28%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_alloc.c.o
[ 29%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_crc.c.o
[ 30%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_crc32.c.o
[ 30%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_arange.c.o
[ 31%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_debug_sup.c.o
[ 32%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_debugaddr.c.o
[ 33%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_debuglink.c.o
[ 34%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_die_deliv.c.o
[ 35%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_debugnames.c.o
[ 35%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_dsc.c.o
[ 36%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_elf_load_headers.c.o
[ 37%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_elfread.c.o
[ 38%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_elf_rel_detector.c.o
[ 39%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_error.c.o
[ 40%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_fill_in_attr_form.c.o
[ 40%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_find_sigref.c.o
[ 41%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_fission_to_cu.c.o
[ 42%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_form.c.o
[ 43%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_form_class_names.c.o
[ 44%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_frame.c.o
[ 45%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_frame2.c.o
[ 45%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_gdbindex.c.o
[ 46%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_global.c.o
[ 47%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_gnu_index.c.o
[ 48%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_groups.c.o
[ 49%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_harmless.c.o
[ 50%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_generic_init.c.o
[ 50%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_init_finish.c.o
[ 51%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_leb.c.o
[ 52%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_line.c.o
[ 53%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_loc.c.o
[ 54%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_loclists.c.o
[ 55%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_locationop_read.c.o
[ 55%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_machoread.c.o
[ 56%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_macro.c.o
[ 57%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_macro5.c.o
[ 58%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_memcpy_swap.c.o
[ 59%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_names.c.o
[ 60%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_object_read_common.c.o
[ 60%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_object_detector.c.o
[ 61%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_peread.c.o
[ 62%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_query.c.o
[ 63%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_ranges.c.o
[ 64%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_rnglists.c.o
[ 65%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_safe_arithmetic.c.o
[ 65%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_safe_strcpy.c.o
[ 66%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_secname_ck.c.o
[ 67%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_seekr.c.o
[ 68%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_setup_sections.c.o
[ 69%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_string.c.o
[ 70%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_stringsection.c.o
[ 70%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_tied.c.o
[ 71%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_str_offsets.c.o
[ 72%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_tsearchhash.c.o
[ 73%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_util.c.o
[ 74%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_xu_index.c.o
[ 75%] Building C object _deps/libdwarf-build/src/lib/libdwarf/CMakeFiles/dwarf.dir/dwarf_print_lines.c.o
[ 75%] Linking C static library libdwarf.a
[ 75%] Built target dwarf
Consolidate compiler generated dependencies of target cpptrace-lib
[ 75%] Building CXX object _deps/cpptrace-build/CMakeFiles/cpptrace-lib.dir/src/cpptrace.cpp.o
[ 76%] Building CXX object _deps/cpptrace-build/CMakeFiles/cpptrace-lib.dir/src/ctrace.cpp.o
[ 77%] Building CXX object _deps/cpptrace-build/CMakeFiles/cpptrace-lib.dir/src/demangle/demangle_with_cxxabi.cpp.o
[ 78%] Building CXX object _deps/cpptrace-build/CMakeFiles/cpptrace-lib.dir/src/demangle/demangle_with_winapi.cpp.o
[ 79%] Building CXX object _deps/cpptrace-build/CMakeFiles/cpptrace-lib.dir/src/demangle/demangle_with_nothing.cpp.o
[ 80%] Building CXX object _deps/cpptrace-build/CMakeFiles/cpptrace-lib.dir/src/symbols/symbols_with_addr2line.cpp.o
[ 80%] Building CXX object _deps/cpptrace-build/CMakeFiles/cpptrace-lib.dir/src/symbols/symbols_with_dbghelp.cpp.o
[ 81%] Building CXX object _deps/cpptrace-build/CMakeFiles/cpptrace-lib.dir/src/symbols/symbols_with_dl.cpp.o
[ 82%] Building CXX object _deps/cpptrace-build/CMakeFiles/cpptrace-lib.dir/src/symbols/symbols_with_libbacktrace.cpp.o
[ 83%] Building CXX object _deps/cpptrace-build/CMakeFiles/cpptrace-lib.dir/src/symbols/symbols_with_libdwarf.cpp.o
[ 84%] Building CXX object _deps/cpptrace-build/CMakeFiles/cpptrace-lib.dir/src/symbols/symbols_with_nothing.cpp.o
[ 85%] Building CXX object _deps/cpptrace-build/CMakeFiles/cpptrace-lib.dir/src/symbols/symbols_core.cpp.o
[ 85%] Building CXX object _deps/cpptrace-build/CMakeFiles/cpptrace-lib.dir/src/unwind/unwind_with_execinfo.cpp.o
[ 86%] Building CXX object _deps/cpptrace-build/CMakeFiles/cpptrace-lib.dir/src/unwind/unwind_with_libunwind.cpp.o
[ 87%] Building CXX object _deps/cpptrace-build/CMakeFiles/cpptrace-lib.dir/src/unwind/unwind_with_nothing.cpp.o
[ 88%] Building CXX object _deps/cpptrace-build/CMakeFiles/cpptrace-lib.dir/src/unwind/unwind_with_unwind.cpp.o
[ 89%] Building CXX object _deps/cpptrace-build/CMakeFiles/cpptrace-lib.dir/src/unwind/unwind_with_winapi.cpp.o
[ 90%] Building CXX object _deps/cpptrace-build/CMakeFiles/cpptrace-lib.dir/src/unwind/unwind_with_dbghelp.cpp.o
[ 90%] Building CXX object _deps/cpptrace-build/CMakeFiles/cpptrace-lib.dir/src/snippets/snippet.cpp.o
[ 91%] Linking CXX static library libcpptrace.a
[ 91%] Built target cpptrace-lib
Consolidate compiler generated dependencies of target libassert-lib
[ 92%] Building CXX object CMakeFiles/libassert-lib.dir/src/assert.cpp.o
[ 93%] Building CXX object CMakeFiles/libassert-lib.dir/src/analysis.cpp.o
[ 94%] Building CXX object CMakeFiles/libassert-lib.dir/src/utils.cpp.o
[ 95%] Building CXX object CMakeFiles/libassert-lib.dir/src/formatting_and_type_tools.cpp.o
[ 96%] Building CXX object CMakeFiles/libassert-lib.dir/src/stringification.cpp.o
[ 96%] Building CXX object CMakeFiles/libassert-lib.dir/src/platform.cpp.o
[ 97%] Building CXX object CMakeFiles/libassert-lib.dir/src/printing.cpp.o
[ 98%] Building CXX object CMakeFiles/libassert-lib.dir/src/paths.cpp.o
[ 99%] Building CXX object CMakeFiles/libassert-lib.dir/src/tokenizer.cpp.o
[100%] Linking CXX static library libassert.a
[100%] Built target libassert-lib
Install the project...
-- Install configuration: "Debug"
-- Up-to-date: /usr/local/lib/cmake/zstd/zstdTargets.cmake
-- Installing: /usr/local/lib/cmake/zstd/zstdTargets-debug.cmake
-- Up-to-date: /usr/local/lib/cmake/zstd/zstdConfig.cmake
-- Up-to-date: /usr/local/lib/cmake/zstd/zstdConfigVersion.cmake
-- Up-to-date: /usr/local/lib/pkgconfig/libzstd.pc
-- Up-to-date: /usr/local/include/zstd.h
-- Up-to-date: /usr/local/include/zdict.h
-- Up-to-date: /usr/local/include/zstd_errors.h
-- Installing: /usr/local/lib/libzstd.a
-- Installing: /usr/local/lib/libdwarf.a
-- Up-to-date: /usr/local/include/libdwarf.h
-- Up-to-date: /usr/local/include/dwarf.h
-- Up-to-date: /usr/local/lib/cmake/libdwarf/libdwarfConfig.cmake
-- Up-to-date: /usr/local/lib/cmake/libdwarf/libdwarfConfigVersion.cmake
-- Up-to-date: /usr/local/lib/libdwarf.a
-- Up-to-date: /usr/local/include/libdwarf.h
-- Up-to-date: /usr/local/include/dwarf.h
-- Up-to-date: /usr/local/lib/cmake/libdwarf/libdwarf-targets.cmake
-- Installing: /usr/local/lib/cmake/libdwarf/libdwarf-targets-debug.cmake
-- Up-to-date: /usr/local/lib/pkgconfig/libdwarf.pc
-- Up-to-date: /usr/local/lib/cmake/libdwarf/FindZSTD.cmake
-- Up-to-date: /usr/local/include
-- Up-to-date: /usr/local/include/ctrace
-- Up-to-date: /usr/local/include/ctrace/ctrace.h
-- Up-to-date: /usr/local/include/cpptrace
-- Up-to-date: /usr/local/include/cpptrace/cpptrace.hpp
-- Installing: /usr/local/lib/libcpptrace.a
-- Up-to-date: /usr/local/lib/cmake/cpptrace/cpptrace-config.cmake
-- Up-to-date: /usr/local/lib/cmake/cpptrace/cpptrace-config-version.cmake
-- Up-to-date: /usr/local/lib/cmake/cpptrace/cpptrace-targets.cmake
-- Installing: /usr/local/lib/cmake/cpptrace/cpptrace-targets-debug.cmake
-- Up-to-date: /usr/local/include
-- Up-to-date: /usr/local/include/libassert
-- Up-to-date: /usr/local/include/libassert/assert.hpp
-- Up-to-date: /usr/local/include/libassert/assert-gtest.hpp
-- Up-to-date: /usr/local/include/libassert/assert-catch2.hpp
-- Installing: /usr/local/lib/libassert.a
-- Up-to-date: /usr/local/lib/cmake/libassert/libassert-config.cmake
-- Up-to-date: /usr/local/lib/cmake/libassert/libassert-config-version.cmake
-- Up-to-date: /usr/local/lib/cmake/libassert/libassert-targets.cmake
-- Installing: /usr/local/lib/cmake/libassert/libassert-targets-debug.cmake

but in my test project:

cmake_minimum_required(VERSION 3.22)

find_package(libassert REQUIRED)

project(test CXX)

file(GLOB_RECURSE SOURCES src/*.cpp)

add_executable(${PROJECT_NAME} ${SOURCES})

target_include_directories(${PROJECT_NAME} PRIVATE include)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
target_compile_options(${PROJECT_NAME} PUBLIC -isystem -Wall -Wextra -Wpedantic -Werror)
target_link_libraries(${PROJECT_NAME}
        PRIVATE
        libassert::assert
)

I have a problem on cmake generation:

~/cxx/test/cmake-build-debug $ cmake ..
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.22/Modules/FindZLIB.cmake:120 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  /usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
  /usr/local/lib/cmake/libdwarf/libdwarfConfig.cmake:31 (find_dependency)
  /usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
  /usr/local/lib/cmake/cpptrace/cpptrace-config.cmake:8 (find_dependency)
  /usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
  /usr/local/lib/cmake/libassert/libassert-config.cmake:6 (find_dependency)
  CMakeLists.txt:3 (find_package)

-- Configuring incomplete, errors occurred!

Maybe it's a problem that i have this package installed with apt?

zlib1g-dev

Please provide a solution. I need this library

jeremy-rifkin commented 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?

h1laryz commented 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?

~ $ 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
~ $
h1laryz commented 6 months ago

Looking forward to your response!

jeremy-rifkin commented 6 months ago

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?

h1laryz commented 6 months ago
~ $ ls -a /usr/lib/x86_64-linux-gnu/pkgconfig/ | grep zlib 
zlib.pc

so, actually, it exists

jeremy-rifkin commented 6 months ago

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.

jeremy-rifkin commented 6 months ago

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.

jeremy-rifkin commented 6 months ago

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.

jeremy-rifkin commented 6 months ago

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.

h1laryz commented 6 months ago

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.

oh, i am so sorry for such a stupid wasting your time :)

jeremy-rifkin commented 6 months ago

All good :) It’s super subtle.