Problem building heaptrack

downloaded current libunwind (v1.9) and built with prefix : ./configure --prefix=/home/mandrews/downloads/github/libunwind/build

nm -C libunwind.so | grep -i backtrace
0000000000003770 W backtrace
0000000000003770 T unw_backtrace
0000000000003890 T unw_backtrace2

installed Prerquisites:

sudo apt install libelf-dev libltdl-dev zlib1g-dev libzstd-dev libboost-system-dev libboost-filesystem-dev libboost-container-dev libboost-iostreams-dev libboost-program-options-dev

download heaptrack and tried to build with :

cmake -DCMAKE_BUILD_TYPE=Release -DLIBUNWIND_INCLUDE_DIR=/home/mandrews/downloads/github/libunwind/build/include -DCMAKE_INSTALL_PREFIX=/home/mandrews/downloads/github/heaptrack/build -DLIBUNWIND_LIBRARY=/home/mandrews/downloads/github/libunwind/build/lib ā€¦

which returns error:

CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Libunwind (missing: LIBUNWIND_HAS_UNW_BACKTRACE) (found
version ā€œ1.9ā€)
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
cmake/FindLibunwind.cmake:70 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:155 (find_package)

Iā€™m confused - it seems to find v1.9, the correct libunwind, which does have unw_backtrace so ???

got it working; here is the full recipe for ubuntu 22:

Build Heaptrack

root dir:


cd /home/mandrews/downloads/github

Build a version of libunwind with unw_backtrace:


git clone https://github.com/libunwind/libunwind.git
 cd libunwind && mkdir build
 autoreconf -i
 ./configure --prefix=/home/mandrews/downloads/github/libunwind/build
 make -j$(nproc)
 make install

check it has unw_backtrace:
nm -C libunwind.so | grep -i backtrace
0000000000003770 W backtrace
0000000000003770 T unw_backtrace
0000000000003890 T unw_backtrace2


Install Prerequisites


sudo apt install libelf-dev libltdl-dev zlib1g-dev libunwind-15-dev libzstd-dev libboost-system-dev libboost-filesystem-dev libboost-container-dev libboost-iostreams-dev libboost-program-options-dev elfutils libdwarf-dev libdw-dev

for the GUI


sudo apt install extra-cmake-modules libkchart-dev libkf5coreaddons-dev libkf5i18n-dev libkf5threadweaver-dev libkf5configwidgets-dev libkf5kio-dev libkf5iconthemes-dev

Building


git clone https://github.com/KDE/heaptrack.git
 cd heaptrack
 mkdir build && cd build
 cmake -DCMAKE_BUILD_TYPE=Release .. # look for messages about missing dependencies!
 make -j$(nproc)

here is what i used to build:
rm CMakeCache.txt

cmake -DCMAKE_BUILD_TYPE=Release -DLIBUNWIND_INCLUDE_DIR=/home/mandrews/downloads/github/libunwind/build/include   -DLIBUNWIND_LIBRARY=/home/mandrews/downloads/github/libunwind/build/lib/libunwind.so -DLIBUNWIND_HAS_UNW_BACKTRACE=TRUE -DLIBDW_INCLUDE_DIR=/usr/include/libdwarf/libdwarf.h -DLIBDW_LIBRARIES=/usr/lib/x86_64-linux-gnu/libdw.so.1 -DCMAKE_INSTALL_PREFIX=/home/mandrews/downloads/github/heaptrack/build ..