aligungr / UERANSIM

Open source 5G UE and RAN (gNodeB) implementation.
GNU General Public License v3.0
776 stars 319 forks source link

'make' fails on current version #256

Open chliny2016 opened 3 years ago

chliny2016 commented 3 years ago

@aligungr

my environment: ubuntu 16.04

after I successfully installed all the

sudo apt update sudo apt upgrade

sudo apt install make sudo apt install g++ sudo apt install libsctp-dev lksctp-tools sudo apt install iproute2 sudo snap install cmake --classic

when I run 'make', got a lot of errors:

andrew@andrew-SYS-E200-8D:~/UERANSIM$ make rm -fr logs # Old version log files mkdir -p build rm -fr build/*

cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" . -B cmake-build-debug

cmake -DCMAKE_BUILD_TYPE=Release -G "CodeBlocks - Unix Makefiles" . -B cmake-build-release -- Configuring done -- Generating done -- Build files have been written to: /home/andrew/UERANSIM/cmake-build-release

cmake --build cmake-build-debug --target all

cmake --build cmake-build-release --target all make[1]: Entering directory '/home/andrew/UERANSIM/cmake-build-release' make[2]: Entering directory '/home/andrew/UERANSIM/cmake-build-release' make[3]: Entering directory '/home/andrew/UERANSIM/cmake-build-release' make[3]: Leaving directory '/home/andrew/UERANSIM/cmake-build-release' [ 2%] Built target ext make[3]: Entering directory '/home/andrew/UERANSIM/cmake-build-release' make[3]: Leaving directory '/home/andrew/UERANSIM/cmake-build-release' make[3]: Entering directory '/home/andrew/UERANSIM/cmake-build-release' [ 2%] Building CXX object src/utils/CMakeFiles/utils.dir/bit_string.cpp.o In file included from /home/andrew/UERANSIM/src/utils/bit_string.hpp:12:0, from /home/andrew/UERANSIM/src/utils/bit_string.cpp:9: /home/andrew/UERANSIM/src/utils/bits.hpp:19:31: error: expected ‘,’ before ‘)’ token static_assert(sizeof(int) == 4); ^ /home/andrew/UERANSIM/src/utils/bits.hpp:19:31: error: expected string-literal before ‘)’ token /home/andrew/UERANSIM/src/utils/bits.hpp: In function ‘int bits::BitRange8(uint8_t)’: /home/andrew/UERANSIM/src/utils/bits.hpp:24:43: error: expected ‘,’ before ‘)’ token static_assert(start >= 0 && start <= 7); ^ /home/andrew/UERANSIM/src/utils/bits.hpp:24:43: error: expected string-literal before ‘)’ token /home/andrew/UERANSIM/src/utils/bits.hpp:25:39: error: expected ‘,’ before ‘)’ token static_assert(end >= 0 && end <= 7); ^ /home/andrew/UERANSIM/src/utils/bits.hpp:25:39: error: expected string-literal before ‘)’ token /home/andrew/UERANSIM/src/utils/bits.hpp:26:31: error: expected ‘,’ before ‘)’ token static_assert(start <= end); ^ /home/andrew/UERANSIM/src/utils/bits.hpp:26:31: error: expected string-literal before ‘)’ token /home/andrew/UERANSIM/src/utils/bits.hpp: In function ‘void bits::SetBitRange8(uint8_t&, int)’: /home/andrew/UERANSIM/src/utils/bits.hpp:42:43: error: expected ‘,’ before ‘)’ token static_assert(start >= 0 && start <= 7); ^ /home/andrew/UERANSIM/src/utils/bits.hpp:42:43: error: expected string-literal before ‘)’ token /home/andrew/UERANSIM/src/utils/bits.hpp:43:39: error: expected ‘,’ before ‘)’ token static_assert(end >= 0 && end <= 7); ^ /home/andrew/UERANSIM/src/utils/bits.hpp:43:39: error: expected string-literal before ‘)’ token /home/andrew/UERANSIM/src/utils/bits.hpp:44:31: error: expected ‘,’ before ‘)’ token static_assert(start <= end); ^ /home/andrew/UERANSIM/src/utils/bits.hpp:44:31: error: expected string-literal before ‘)’ token /home/andrew/UERANSIM/src/utils/bits.hpp: In function ‘constexpr uint32_t bits::Mask32()’: /home/andrew/UERANSIM/src/utils/bits.hpp:74:32: error: expected primary-expression before ‘...’ token return ((1u << TIndexes) | ... | 0u); ^ /home/andrew/UERANSIM/src/utils/bits.hpp:74:32: error: expected ‘)’ before ‘...’ token /home/andrew/UERANSIM/src/utils/bits.hpp: In function ‘void bits::Bmp4Dec1111(int, T1, T2, T3, T4)’: /home/andrew/UERANSIM/src/utils/bits.hpp:182:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<T1, nullptr_t>::value) ^ /home/andrew/UERANSIM/src/utils/bits.hpp:184:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<T2, nullptr_t>::value) ^ /home/andrew/UERANSIM/src/utils/bits.hpp:186:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<T3, nullptr_t>::value) ^ /home/andrew/UERANSIM/src/utils/bits.hpp:188:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<T4, nullptr_t>::value) ^ /home/andrew/UERANSIM/src/utils/bits.hpp: In function ‘void bits::Bmp4Dec112(int, T1, T2, T3)’: /home/andrew/UERANSIM/src/utils/bits.hpp:199:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<T1, nullptr_t>::value) ^ /home/andrew/UERANSIM/src/utils/bits.hpp:201:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<T2, nullptr_t>::value) ^ /home/andrew/UERANSIM/src/utils/bits.hpp:203:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<T3, nullptr_t>::value) ^ /home/andrew/UERANSIM/src/utils/bits.hpp: In function ‘void bits::Bmp4Dec121(int, T1, T2, T3)’: /home/andrew/UERANSIM/src/utils/bits.hpp:214:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<T1, nullptr_t>::value) ^ /home/andrew/UERANSIM/src/utils/bits.hpp:216:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<T2, nullptr_t>::value) ^ /home/andrew/UERANSIM/src/utils/bits.hpp:218:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<T3, nullptr_t>::value) ^ /home/andrew/UERANSIM/src/utils/bits.hpp: In function ‘void bits::Bmp4Dec211(int, T1, T2, T3)’: /home/andrew/UERANSIM/src/utils/bits.hpp:229:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<T1, nullptr_t>::value) ^ /home/andrew/UERANSIM/src/utils/bits.hpp:231:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<T2, nullptr_t>::value) ^ /home/andrew/UERANSIM/src/utils/bits.hpp:233:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<T3, nullptr_t>::value) ^ /home/andrew/UERANSIM/src/utils/bits.hpp: In function ‘void bits::Bmp4Dec13(int, T1, T2)’: /home/andrew/UERANSIM/src/utils/bits.hpp:243:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<T1, nullptr_t>::value) ^ /home/andrew/UERANSIM/src/utils/bits.hpp:245:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<T2, nullptr_t>::value) ^ /home/andrew/UERANSIM/src/utils/bits.hpp: In function ‘void bits::Bmp4Dec22(int, T1, T2)’: /home/andrew/UERANSIM/src/utils/bits.hpp:255:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<T1, nullptr_t>::value) ^ /home/andrew/UERANSIM/src/utils/bits.hpp:257:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<T2, nullptr_t>::value) ^ /home/andrew/UERANSIM/src/utils/bits.hpp: In function ‘void bits::Bmp4Dec31(int, T1, T2)’: /home/andrew/UERANSIM/src/utils/bits.hpp:267:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<T1, nullptr_t>::value) ^ /home/andrew/UERANSIM/src/utils/bits.hpp:269:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<T2, nullptr_t>::value) ^ /home/andrew/UERANSIM/src/utils/bits.hpp: In function ‘void bits::Bmp4Dec4(int, T1)’: /home/andrew/UERANSIM/src/utils/bits.hpp:278:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<T1, nullptr_t>::value) ^ src/utils/CMakeFiles/utils.dir/build.make:94: recipe for target 'src/utils/CMakeFiles/utils.dir/bit_string.cpp.o' failed make[3]: [src/utils/CMakeFiles/utils.dir/bit_string.cpp.o] Error 1 make[3]: Leaving directory '/home/andrew/UERANSIM/cmake-build-release' CMakeFiles/Makefile2:735: recipe for target 'src/utils/CMakeFiles/utils.dir/all' failed make[2]: [src/utils/CMakeFiles/utils.dir/all] Error 2 make[2]: Leaving directory '/home/andrew/UERANSIM/cmake-build-release' Makefile:102: recipe for target 'all' failed make[1]: [all] Error 2 make[1]: Leaving directory '/home/andrew/UERANSIM/cmake-build-release' makefile:5: recipe for target 'build' failed make: [build] Error 2 andrew@andrew-SYS-E200-8D:~/UERANSIM$

aligungr commented 3 years ago

@chliny2016 gcc 9.0.0 or later is required to build UERANSIM. Maybe your gcc version < 9.

chliny2016 commented 3 years ago

@aligungr , thanks a lot! yes, mine is gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609, let me upgrade it.

ghost commented 3 years ago

@aligungr, FYI, I have no problem building UERANSIM with gcc 7.5.0 (I use Ubuntu 18.04 and its default gcc verson is 7.5.0)

dcrowley-Onis commented 3 years ago

And your cmake is >3.16 ?

dcrowley-Onis commented 3 years ago

I've modified to use both 7.c gcc and 10.c gcc - I see the same error as the new issue I have opened. Might yet be an environment issue. Will further check