osmo-trx.git indeed uses boost, but not all target binaries do. In fact, only osmo-trx-usrp1 does, and it uses it minimally. Only references to boost in code are here:

Transceiver52M/device/usrp1/USRPDevice.h
35:#include <boost/shared_ptr.hpp>
36:typedef boost::shared_ptr<usrp_standard_tx> usrp_standard_tx_sptr;
37:typedef boost::shared_ptr<usrp_standard_rx> usrp_standard_rx_sptr;

However, the build failure happens for osmo-trx-uhd binary target, which uses UHD as a backend but doesn't use boost itself at all:
[  397s] /usr/bin/ld: ./device/uhd/.libs/libdevice.a(UHDDevice.o):
 undefined reference to symbol '_ZN5boost6system16generic_categoryEv'

Related files to UHDDevice.o are:
https://git.osmocom.org/osmo-trx/tree/Transceiver52M/device/uhd

So unless I'm missing something important, UHDDevice shouldn't be failing to build because it's not explicitly using boost, and boost is only used internally by UHD in there.

I'm personally using ArchLinux and in there the patch removing the -lboost_system is not applied. I tried applying the patch on my system (removing -lboost_system from uhd.pc) and osmo-trx-uhd is still building fine on my system (but it seems it doesn't in Debian testing/unstable). I'm using 3.14.1.0-1 on my system.

With that patch applied, I see only reference to boost appears while linking osmo-trx-usrp1, which is correct because it's the only one using boost explicitly:
"""
libtool: link: g++ -I/home/pespin/dev/sysmocom/build/new/out/include/ -I/home/pespin/dev/sysmocom/build/new/out/include/ -I/home/pespin/dev/sysmocom/build/new/out/include/ -g -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined -o osmo-trx-usrp1 osmo_trx_usrp1-osmo-trx.o -Wl,-rpath -Wl,/usr/lib -Wl,-rpath -Wl,/usr/lib -Wl,-rpath -Wl,/usr/lib ./device/usrp1/.libs/libdevice.a ./.libs/libtransceiver_common.a ../Transceiver52M/arch/x86/.libs/libarch.a ../GSM/.libs/libGSM.a ../CommonLibs/.libs/libcommon.a -L/home/pespin/dev/sysmocom/build/new/out/lib -lfftw3f /home/pespin/dev/sysmocom/build/new/out/lib/libosmoctrl.so /home/pespin/dev/sysmocom/build/new/out/lib/libosmogsm.so -lgnutls /home/pespin/dev/sysmocom/build/new/out/lib/libosmovty.so /home/pespin/dev/sysmocom/build/new/out/lib/libosmocore.so -ltalloc -ldl /home/pespin/dev/sysmocom/build/new/out/lib/libusrp.so -L/usr/lib64 -lboost_thread -lpthread -lboost_system -lusb-1.0 -Wl,-rpath -Wl,/home/pespin/dev/sysmocom/build/new/out/lib -Wl,-rpath -Wl,/home/pespin/dev/sysmocom/build/new/out/lib
"""

Checking ldd, my libuhd links to libboost_system internally:
"""
ldd /usr/lib/libuhd.so.3.14.1 | grep boost
libboost_chrono.so.1.69.0 => /usr/lib/libboost_chrono.so.1.69.0 (0x00007fe729c2f000) libboost_date_time.so.1.69.0 => /usr/lib/libboost_date_time.so.1.69.0 (0x00007fe729c1c000) libboost_filesystem.so.1.69.0 => /usr/lib/libboost_filesystem.so.1.69.0 (0x00007fe729bfe000) libboost_regex.so.1.69.0 => /usr/lib/libboost_regex.so.1.69.0 (0x00007fe729b1e000) libboost_serialization.so.1.69.0 => /usr/lib/libboost_serialization.so.1.69.0 (0x00007fe729ada000) libboost_thread.so.1.69.0 => /usr/lib/libboost_thread.so.1.69.0 (0x00007fe729ab3000) libboost_system.so.1.69.0 => /usr/lib/libboost_system.so.1.69.0 (0x00007fe72932b000)
"""

And same goes for osmo-trx-uhd (probably inherited by linking to libuhd):
"""
ldd new/out/bin/osmo-trx-uhd | grep -e boost -e uhd
        libuhd.so.3.14.1 => /usr/lib/libuhd.so.3.14.1 (0x00007f60ce5b0000)
libboost_chrono.so.1.69.0 => /usr/lib/libboost_chrono.so.1.69.0 (0x00007f60cd0f8000) libboost_date_time.so.1.69.0 => /usr/lib/libboost_date_time.so.1.69.0 (0x00007f60cd0e5000) libboost_filesystem.so.1.69.0 => /usr/lib/libboost_filesystem.so.1.69.0 (0x00007f60cd0c7000) libboost_regex.so.1.69.0 => /usr/lib/libboost_regex.so.1.69.0 (0x00007f60ccfe5000) libboost_serialization.so.1.69.0 => /usr/lib/libboost_serialization.so.1.69.0 (0x00007f60ccfa1000) libboost_thread.so.1.69.0 => /usr/lib/libboost_thread.so.1.69.0 (0x00007f60ccf7a000) libboost_system.so.1.69.0 => /usr/lib/libboost_system.so.1.69.0 (0x00007f60ccd25000)
"""

So far my conclusion is that the debian patch is fine (same patch doesn't seem to break build on ArchLinux), but something else is wrong in Debian testing/unstable. Perhaps libuhd is not linked to libboost_system.so there?


--
- Pau Espin Pedrol <pes...@sysmocom.de>         http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Director: Harald Welte

Reply via email to