warthog-network / Warthog

Experimental cryptocurrency implementation
MIT License
21 stars 13 forks source link

Debian 11 - kernel 5.10.0-28-amd64 - build from the sources fails - meson.build:1:0: ERROR: Value "c++20" (of type "string") for combo option "C++ language standard to use" is not one of the choices. #55

Closed blackmennewstyle closed 4 months ago

blackmennewstyle commented 5 months ago

Hello beautiful devs :heart:

I have been trying to build your interesting project on Debian 11 - kernel 5.10.0-28-amd64 but i am facing the following error:

ceedii@callisto:~/Warthog-0.4.24$ meson build --buildtype=release
The Meson build system
Version: 0.56.2
Source dir: /home/ceedii/Warthog-0.4.24
Build dir: /home/ceedii/Warthog-0.4.24/build
Build type: native build
Project name: Warthog
Project version: 0.4.24
C compiler for the host machine: ccache cc (gcc 10.2.1 "cc (Debian 10.2.1-6) 10.2.1 20210110")
C linker for the host machine: cc ld.bfd 2.35.2

meson.build:1:0: ERROR: Value "c++20" (of type "string") for combo option "C++ language standard to use" is not one of the choices. Possible choices are (as string): "none", "c++98", "c++03", "c++11", "c++14", "c++17", "c++1z", "c++2a", "gnu++03", "gnu++11", "gnu++14", "gnu++17", "gnu++1z", "gnu++2a".

A full log can be found at /home/ceedii/Warthog-0.4.24/build/meson-logs/meson-log.txt

Here the content of /home/ceedii/Warthog-0.4.24/build/meson-logs/meson-log.txt:

Build started at 2024-04-30T03:12:32.378014
Main binary: /usr/bin/python3
Build Options: -Dbuildtype=release
Python system: Linux
The Meson build system
Version: 0.56.2
Source dir: /home/ceedii/Warthog-0.4.24
Build dir: /home/ceedii/Warthog-0.4.24/build
Build type: native build
Project name: Warthog
Project version: 0.4.24
None of 'CC' are defined in the environment, not changing global flags.
None of 'CFLAGS' are defined in the environment, not changing global flags.
None of 'LDFLAGS' are defined in the environment, not changing global flags.
None of 'CPPFLAGS' are defined in the environment, not changing global flags.
None of 'CC_LD' are defined in the environment, not changing global flags.
Sanity testing C compiler: ccache cc
Is cross compiler: False.
None of 'CC_LD' are defined in the environment, not changing global flags.
Sanity check compiler command line: ccache cc /home/ceedii/Warthog-0.4.24/build/meson-private/sanitycheckc.c -o /home/ceedii/Warthog-0.4.24/build/meson-private/sanitycheckc.exe -pipe -D_FILE_OFFSET_BITS=64
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: /home/ceedii/Warthog-0.4.24/build/meson-private/sanitycheckc.exe
C compiler for the host machine: ccache cc (gcc 10.2.1 "cc (Debian 10.2.1-6) 10.2.1 20210110")
C linker for the host machine: cc ld.bfd 2.35.2
None of 'AR' are defined in the environment, not changing global flags.
None of 'CXX' are defined in the environment, not changing global flags.
None of 'CXXFLAGS' are defined in the environment, not changing global flags.
None of 'LDFLAGS' are defined in the environment, not changing global flags.
None of 'CPPFLAGS' are defined in the environment, not changing global flags.
None of 'CXX_LD' are defined in the environment, not changing global flags.

meson.build:1:0: ERROR: Value "c++20" (of type "string") for combo option "C++ language standard to use" is not one of the choices. Possible choices are (as string): "none", "c++98", "c++03", "c++11", "c++14", "c++17", "c++1z", "c++2a", "gnu++03", "gnu++11", "gnu++14", "gnu++17", "gnu++1z", "gnu++2a".

Any help on how to bypass that compilation error?

CoinFuMasterShifu commented 5 months ago

You need a newer compiler, at least gcc11. You can switch to a newer OS or try to compile and install a recent gcc from source. I don't think it is easily possible to use apt-get install here, maybe if you use dist-upgrade. I would try to install gcc from source. After that make sure you don't confuse the old and the new version (check with gcc --version which version is called by default.

blackmennewstyle commented 4 months ago

Any reason why you don't support old gcc version? Lot of people are still using Debian 11 and even Ubuntu 20.04.

blackmennewstyle commented 4 months ago

Apparently, it was a bug in meson https://github.com/mesonbuild/meson/issues/11890#issuecomment-1599576580

I imagine the current version i have inside my Debian 11 does not carry that fix.

ByPumbaa commented 4 months ago

Are you sure it was that linked bug? I also think it is related to the old gcc version. The reason we need at least gcc11 is C++20 support. It is nicer to use code using C++20 features and therefore people must compile with a C++20 compatible compiler.

blackmennewstyle commented 4 months ago

I actually upgraded my meson and it was working but it was crashing after because of my C++ version sadly when executing the ninja compilation lol