I got a library that wants liblttng-ust that I’m trying to build as part of a flatpak package:
In file included from /home/workspace/lomiri-ui-toolkit/src/LomiriMetrics/lttng/tracepoints.c:21:
/home/workspace/lomiri-ui-toolkit/src/LomiriMetrics/lttng/tracepoints_p.h:27:10: fatal error: lttng/tracepoint.h: No such file or directory
27 | #include <lttng/tracepoint.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:665: .obj/tracepoints.o] Error 1
make[2]: Leaving directory '/home/workspace/lomiri-ui-toolkit/build/src/LomiriMetrics/lttng'
make[1]: *** [Makefile:131: sub-metrics-lttng-plugin-make_first] Error
So I tried to instal liblttng-ust like the following to address this (yes I know I’m not using the sources mechanism as I’m likely intended to do, for now my focus is on seeing if I can get it to work at all and I’m quite new to flatpak):
cd lttng-ust-build
wget --output-document=urcu.tar.bz2 https://lttng.org/files/urcu/userspace-rcu-latest-0.15.tar.bz2 || { echo "Failed to download urcu."; exit 1; }
tar -xf urcu.tar.bz2
wget --output-document=ust.tar.bz2 https://lttng.org/files/lttng-ust/lttng-ust-2.13.9.tar.bz2 || { echo "Failed to download lttng-ust."; exit 1; }
tar -xf ust.tar.bz2
cd userspace-rcu-*
./configure --prefix=/app/ || { echo "Failed to install urcu."; exit 1; }
make || { echo "Failed to install urcu."; exit 1; }
make install || { echo "Failed to install urcu."; exit 1; }
cd ..
cd lttng-ust-*
./configure --prefix=/app/ --disable-numa || { echo "Failed to install lttng-ust."; exit 1; }
make || { echo "Failed to install lttng-ust."; exit 1; }
make install || { echo "Failed to install lttng-ust."; exit 1; }
ldconfig || { echo "Failed to install lttng-ust."; exit 1;
Now this has a very curious result. Because the header is found, but the library can’t be found by the linker:
g++ -Wl,-O1 -Wl,--enable-new-dtags -shared -o libumlttng.so .obj/tracepoints.o .obj/lttng.o -llttng-ust -lpthread
/usr/lib/gcc/aarch64-unknown-linux-gnu/14.2.0/../../../../aarch64-unknown-linux-gnu/bin/ld: cannot find -llttng-ust: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:80: libumlttng.so] Error 1
This seems rather strange to me, isn’t /app the correct prefix? It seems to be for any other libraries I want to be found and reused. Just to test it out, I tried copying liblttng-ust from /app/lib to /app/usr/lib to see if it makes any difference:
mkdir -p /app/usr/lib/
cp /app/lib/liblttng*.so /app/usr/lib/
But that doesn’t result in the linker finding it either.
I’m probably doing something obvious wrong that causes liblttng-ust not to be found in this flatpak build environment, even though all the other libraries are found.
Does somebody have a clue what my mistake would be? I would be very thankful for any ideas and pointers.