Open ZeroChaos- opened 2 years ago
Hi,
it seems there is an issue with a very recent GCC version. Your logs report
-- The C compiler identification is GNU 11.2.1
-- The CXX compiler identification is GNU 11.2.1
You could try to build with GCC <= 11.2.0 or Clang <= 13.0.1, which are the most recent versions that I have tested (on Archlinux).
Clang 13.0.1 is available in Gentoo and the failure looks pretty similar
[1022/1088] : && /usr/lib/llvm/13/bin/clang++ -Os -march=native -mtune=native -pipe -frecord-gcc-switches -Wall -Wno-comment -Wno-reorder -Wno-unused-variable -Wtype-limits -std=c++14 -fno-strict-aliasing -Wno-unused-but-set-variable -march=native -mfpmath=sse -mavx2 -DLV_HAVE_AVX2 -DLV_HAVE_AVX -DLV_HAVE_SSE -fvisibility=hidden -ggdb -DBUILD_TYPE_RELWITHDEBINFO -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 srsgnb/src/stack/mac/test/CMakeFiles/sched_nr_parallel_test.dir/sched_nr_parallel_test.cc.o -o srsgnb/src/stack/mac/test/sched_nr_parallel_test -Wl,-rpath,/var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04_build/srsgnb/src/stack/mac/test srsgnb/src/stack/mac/libsrsgnb_mac.a srsgnb/src/stack/mac/test/libsched_nr_test_suite.so lib/src/common/libsrsran_common.a lib/src/asn1/librrc_nr_asn1.a /usr/lib64/libboost_program_options.so.1.78.0 /usr/lib64/libboost_system.so.1.78.0 srsgnb/src/stack/mac/libsrsgnb_mac.a srsenb/src/stack/mac/common/libsrsenb_mac_common.a lib/src/mac/libsrsran_mac.a lib/src/asn1/librrc_nr_asn1.a lib/src/asn1/libasn1_utils.a lib/src/common/libsrsran_common.a lib/src/phy/libsrsran_phy.a -lpthread -lm /usr/lib64/libfftw3f.so lib/src/support/libsupport.a lib/src/srslog/libsrslog.a /usr/lib64/libmbedcrypto.so /usr/lib64/libdw.so && :
FAILED: srsgnb/src/stack/mac/test/sched_nr_parallel_test
: && /usr/lib/llvm/13/bin/clang++ -Os -march=native -mtune=native -pipe -frecord-gcc-switches -Wall -Wno-comment -Wno-reorder -Wno-unused-variable -Wtype-limits -std=c++14 -fno-strict-aliasing -Wno-unused-but-set-variable -march=native -mfpmath=sse -mavx2 -DLV_HAVE_AVX2 -DLV_HAVE_AVX -DLV_HAVE_SSE -fvisibility=hidden -ggdb -DBUILD_TYPE_RELWITHDEBINFO -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 srsgnb/src/stack/mac/test/CMakeFiles/sched_nr_parallel_test.dir/sched_nr_parallel_test.cc.o -o srsgnb/src/stack/mac/test/sched_nr_parallel_test -Wl,-rpath,/var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04_build/srsgnb/src/stack/mac/test srsgnb/src/stack/mac/libsrsgnb_mac.a srsgnb/src/stack/mac/test/libsched_nr_test_suite.so lib/src/common/libsrsran_common.a lib/src/asn1/librrc_nr_asn1.a /usr/lib64/libboost_program_options.so.1.78.0 /usr/lib64/libboost_system.so.1.78.0 srsgnb/src/stack/mac/libsrsgnb_mac.a srsenb/src/stack/mac/common/libsrsenb_mac_common.a lib/src/mac/libsrsran_mac.a lib/src/asn1/librrc_nr_asn1.a lib/src/asn1/libasn1_utils.a lib/src/common/libsrsran_common.a lib/src/phy/libsrsran_phy.a -lpthread -lm /usr/lib64/libfftw3f.so lib/src/support/libsupport.a lib/src/srslog/libsrslog.a /usr/lib64/libmbedcrypto.so /usr/lib64/libdw.so && :
/usr/bin/x86_64-pc-linux-gnu-ld: srsgnb/src/stack/mac/test/CMakeFiles/sched_nr_parallel_test.dir/sched_nr_parallel_test.cc.o: in function `sched_nr_base_test_bench':
/var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04/srsgnb/src/stack/mac/test/sched_nr_parallel_test.cc:38: undefined reference to `srsenb::sched_nr_base_test_bench::sched_nr_base_test_bench(srsenb::sched_nr_interface::sched_args_t const&, std::vector<srsenb::sched_nr_cell_cfg_t, std::allocator<srsenb::sched_nr_cell_cfg_t> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int)'
/usr/bin/x86_64-pc-linux-gnu-ld: srsgnb/src/stack/mac/test/CMakeFiles/sched_nr_parallel_test.dir/sched_nr_parallel_test.cc.o: in function `srsenb::run_sched_nr_test(unsigned int)':
/var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04/srsgnb/src/stack/mac/test/sched_nr_parallel_test.cc:101: undefined reference to `srsenb::sched_nr_base_test_bench::user_cfg(unsigned short, srsenb::sched_nr_ue_cfg_t const&)'
/usr/bin/x86_64-pc-linux-gnu-ld: /var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04/srsgnb/src/stack/mac/test/sched_nr_parallel_test.cc:103: undefined reference to `srsenb::sched_nr_base_test_bench::run_slot(srsran::slot_point)'
/usr/bin/x86_64-pc-linux-gnu-ld: /var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04/srsgnb/src/stack/mac/test/sched_nr_parallel_test.cc:106: undefined reference to `srsenb::sched_nr_base_test_bench::stop()'
/usr/bin/x86_64-pc-linux-gnu-ld: /var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04/srsgnb/src/stack/mac/test/sched_nr_parallel_test.cc:114: undefined reference to `srsenb::sched_nr_base_test_bench::~sched_nr_base_test_bench()'
/usr/bin/x86_64-pc-linux-gnu-ld: srsgnb/src/stack/mac/test/CMakeFiles/sched_nr_parallel_test.dir/sched_nr_parallel_test.cc.o: in function `sched_nr_base_test_bench':
/var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04/srsgnb/src/stack/mac/test/sched_nr_parallel_test.cc:38: undefined reference to `srsenb::sched_nr_base_test_bench::~sched_nr_base_test_bench()'
/usr/bin/x86_64-pc-linux-gnu-ld: srsgnb/src/stack/mac/test/CMakeFiles/sched_nr_parallel_test.dir/sched_nr_parallel_test.cc.o: in function `srsenb::run_sched_nr_test(unsigned int)':
/var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04/srsgnb/src/stack/mac/test/sched_nr_parallel_test.cc:114: undefined reference to `srsenb::sched_nr_base_test_bench::~sched_nr_base_test_bench()'
/usr/bin/x86_64-pc-linux-gnu-ld: srsgnb/src/stack/mac/test/CMakeFiles/sched_nr_parallel_test.dir/sched_nr_parallel_test.cc.o: in function `~sched_nr_tester':
/var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04/srsgnb/src/stack/mac/test/sched_nr_parallel_test.cc:35: undefined reference to `srsenb::sched_nr_base_test_bench::~sched_nr_base_test_bench()'
/usr/bin/x86_64-pc-linux-gnu-ld: srsgnb/src/stack/mac/test/CMakeFiles/sched_nr_parallel_test.dir/sched_nr_parallel_test.cc.o:(.data.rel.ro._ZTVN6srsenb15sched_nr_testerE[_ZTVN6srsenb15sched_nr_testerE]+0x10): undefined reference to `srsenb::sched_nr_base_test_bench::~sched_nr_base_test_bench()'
/usr/bin/x86_64-pc-linux-gnu-ld: srsgnb/src/stack/mac/test/CMakeFiles/sched_nr_parallel_test.dir/sched_nr_parallel_test.cc.o:(.data.rel.ro._ZTIN6srsenb15sched_nr_testerE[_ZTIN6srsenb15sched_nr_testerE]+0x10): undefined reference to `typeinfo for srsenb::sched_nr_base_test_bench'
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
So I just tested, and this bug seems to only pop up with -Os. If I compile with -O3 instead, I get https://github.com/srsran/srsRAN/issues/854
I can see some external configurations being loaded, e.g.
cmake -C /var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04_build/gentoo_common_config.cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_UHD=yes -DENABLE_BLADERF=yes -DENABLE_SOAPYSDR=yes -DENABLE_ZEROMQ=yes -DENABLE_HARDSIM=yes -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=/var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04_build/gentoo_toolchain.cmake /var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04
and a few extra CC/CXX flags, (on the first sight for example -Os -march=native -mtune=native -pipe -frecord-gcc-switches
)
Could you please also try to build without them? https://docs.srsran.com/en/latest/general/source/1_installation.html
The gentoo override files are pretty dull and shouldn't be affecting anything. I can't build in the package manager without them afaik, but I'll include them here in case you see anything which might be problematic.
gentoo_common_config.cmake
set(CMAKE_GENTOO_BUILD ON CACHE BOOL "Indicate Gentoo package build")
set(LIB_SUFFIX 64 CACHE STRING "library path suffix" FORCE)
set(CMAKE_INSTALL_LIBDIR lib64 CACHE PATH "Output directory for libraries")
set(CMAKE_INSTALL_INFODIR "/usr/share/info" CACHE PATH "")
set(CMAKE_INSTALL_MANDIR "/usr/share/man" CACHE PATH "")
set(CMAKE_USER_MAKE_RULES_OVERRIDE "/var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04_build/gentoo_rules.cmake" CACHE FILEPATH "Gentoo override rules")
set(CMAKE_INSTALL_DOCDIR "/usr/share/doc/srsran-22.04" CACHE PATH "")
set(BUILD_SHARED_LIBS ON CACHE BOOL "")
set(CMAKE_INSTALL_ALWAYS 1)
set(CMAKE_ASM_FLAGS_RELWITHDEBINFO "" CACHE STRING "")
set(CMAKE_ASM-ATT_FLAGS_RELWITHDEBINFO "" CACHE STRING "")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "" CACHE STRING "")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "" CACHE STRING "")
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "" CACHE STRING "")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "" CACHE STRING "")
set(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO "" CACHE STRING "")
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "" CACHE STRING "")
set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "" CACHE STRING "")
gentoo_rules.cmake
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "ASM compile command" FORCE)
set(CMAKE_ASM-ATT_COMPILE_OBJECT "<CMAKE_ASM-ATT_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c -x assembler <SOURCE>" CACHE STRING "ASM-ATT compile command" FORCE)
set(CMAKE_ASM-ATT_LINK_FLAGS "-nostdlib" CACHE STRING "ASM-ATT link flags" FORCE)
set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C compile command" FORCE)
set(CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C++ compile command" FORCE)
set(CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> -Os -march=native -mtune=native -pipe -frecord-gcc-switches <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "Fortran compile command" FORCE)
I removed my custom cflags from gentoo_rules.cmake and from the environment and rebuilt. I get an extremely similar error still
[1022/1088] : && /usr/bin/x86_64-pc-linux-gnu-g++ -Wall -Wno-comment -Wno-reorder -Wno-unused-variable -Wtype-limits -std=c++14 -fno-strict-aliasing -Wno-unused-but-set-variable -march=native -mfpmath=sse -mavx2 -DLV_HAVE_AVX2 -DLV_HAVE_AVX -DLV_HAVE_SSE -fvisibility=hidden -ggdb -DBUILD_TYPE_RELWITHDEBINFO -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 srsgnb/src/stack/mac/test/CMakeFiles/sched_nr_parallel_test.dir/sched_nr_parallel_test.cc.o -o srsgnb/src/stack/mac/test/sched_nr_parallel_test -Wl,-rpath,/var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04_build/srsgnb/src/stack/mac/test srsgnb/src/stack/mac/libsrsgnb_mac.a srsgnb/src/stack/mac/test/libsched_nr_test_suite.so lib/src/common/libsrsran_common.a lib/src/asn1/librrc_nr_asn1.a /usr/lib64/libboost_program_options.so.1.78.0 /usr/lib64/libboost_system.so.1.78.0 srsgnb/src/stack/mac/libsrsgnb_mac.a srsenb/src/stack/mac/common/libsrsenb_mac_common.a lib/src/mac/libsrsran_mac.a lib/src/asn1/librrc_nr_asn1.a lib/src/asn1/libasn1_utils.a lib/src/common/libsrsran_common.a lib/src/phy/libsrsran_phy.a -lpthread -lm /usr/lib64/libfftw3f.so lib/src/support/libsupport.a lib/src/srslog/libsrslog.a /usr/lib64/libmbedcrypto.so /usr/lib64/libdw.so /usr/lib64/libsctp.so && :
FAILED: srsgnb/src/stack/mac/test/sched_nr_parallel_test
: && /usr/bin/x86_64-pc-linux-gnu-g++ -Wall -Wno-comment -Wno-reorder -Wno-unused-variable -Wtype-limits -std=c++14 -fno-strict-aliasing -Wno-unused-but-set-variable -march=native -mfpmath=sse -mavx2 -DLV_HAVE_AVX2 -DLV_HAVE_AVX -DLV_HAVE_SSE -fvisibility=hidden -ggdb -DBUILD_TYPE_RELWITHDEBINFO -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 srsgnb/src/stack/mac/test/CMakeFiles/sched_nr_parallel_test.dir/sched_nr_parallel_test.cc.o -o srsgnb/src/stack/mac/test/sched_nr_parallel_test -Wl,-rpath,/var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04_build/srsgnb/src/stack/mac/test srsgnb/src/stack/mac/libsrsgnb_mac.a srsgnb/src/stack/mac/test/libsched_nr_test_suite.so lib/src/common/libsrsran_common.a lib/src/asn1/librrc_nr_asn1.a /usr/lib64/libboost_program_options.so.1.78.0 /usr/lib64/libboost_system.so.1.78.0 srsgnb/src/stack/mac/libsrsgnb_mac.a srsenb/src/stack/mac/common/libsrsenb_mac_common.a lib/src/mac/libsrsran_mac.a lib/src/asn1/librrc_nr_asn1.a lib/src/asn1/libasn1_utils.a lib/src/common/libsrsran_common.a lib/src/phy/libsrsran_phy.a -lpthread -lm /usr/lib64/libfftw3f.so lib/src/support/libsupport.a lib/src/srslog/libsrslog.a /usr/lib64/libmbedcrypto.so /usr/lib64/libdw.so /usr/lib64/libsctp.so && :
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld: srsgnb/src/stack/mac/test/CMakeFiles/sched_nr_parallel_test.dir/sched_nr_parallel_test.cc.o: in function `srsenb::run_sched_nr_test(unsigned int)':
/var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04/srsgnb/src/stack/mac/test/sched_nr_parallel_test.cc:101: undefined reference to `srsenb::sched_nr_base_test_bench::user_cfg(unsigned short, srsenb::sched_nr_ue_cfg_t const&)'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04/srsgnb/src/stack/mac/test/sched_nr_parallel_test.cc:103: undefined reference to `srsenb::sched_nr_base_test_bench::run_slot(srsran::slot_point)'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04/srsgnb/src/stack/mac/test/sched_nr_parallel_test.cc:106: undefined reference to `srsenb::sched_nr_base_test_bench::stop()'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld: srsgnb/src/stack/mac/test/CMakeFiles/sched_nr_parallel_test.dir/sched_nr_parallel_test.cc.o: in function `srsenb::sched_nr_tester::sched_nr_base_test_bench(srsenb::sched_nr_interface::sched_args_t const&, std::vector<srsenb::sched_nr_cell_cfg_t, std::allocator<srsenb::sched_nr_cell_cfg_t> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int)':
/var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04/srsgnb/src/stack/mac/test/sched_nr_parallel_test.cc:38: undefined reference to `srsenb::sched_nr_base_test_bench::sched_nr_base_test_bench(srsenb::sched_nr_interface::sched_args_t const&, std::vector<srsenb::sched_nr_cell_cfg_t, std::allocator<srsenb::sched_nr_cell_cfg_t> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int)'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04/srsgnb/src/stack/mac/test/sched_nr_parallel_test.cc:38: undefined reference to `srsenb::sched_nr_base_test_bench::~sched_nr_base_test_bench()'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld: srsgnb/src/stack/mac/test/CMakeFiles/sched_nr_parallel_test.dir/sched_nr_parallel_test.cc.o: in function `srsenb::sched_nr_tester::~sched_nr_tester()':
/var/tmp/portage/net-wireless/srsran-22.04/work/srsran-22.04/srsgnb/src/stack/mac/test/sched_nr_parallel_test.cc:35: undefined reference to `srsenb::sched_nr_base_test_bench::~sched_nr_base_test_bench()'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld: srsgnb/src/stack/mac/test/CMakeFiles/sched_nr_parallel_test.dir/sched_nr_parallel_test.cc.o:(.data.rel.ro._ZTIN6srsenb15sched_nr_testerE[_ZTIN6srsenb15sched_nr_testerE]+0x10): undefined reference to `typeinfo for srsenb::sched_nr_base_test_bench'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Thanks for the feedback.
I could reproduce your build issue by adding BUILD_SHARED_LIBS=ON
as configured by the gentoo_common_config.cmake
you posted before.
I added a patch to fix the build process, regardless of whether that option is set or not. You can find the branch here: https://github.com/srsran/srsRAN/tree/fix_issue_852
Could you please confirm if this patch fixes the build process?
P.S. As an immediate workaround I suggest to set BUILD_SHARED_LIBS
to OFF
explicitly,
e.g. append -DBUILD_SHARED_LIBS=OFF
to the cmake args.
Nice, confirmed that https://github.com/srsran/srsRAN/commit/2e1a7abfb313f874add9efa2cdd716dffd842782.patch fixes this. I'm retesting my other bugs but I am fairly certain they are all interelated and just happened to hit a failure at a slightly different point.
Config looks like this
Build failure here:
Seems to get a bit further than https://github.com/srsran/srsRAN/issues/835 , but still doesn't build. Is there a way to disable these tests that I'm missing? How do others build this successfully?