Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQUEST] Explain more thoroughly on how to compile btop with GCC 10 #786

Open
akamayu-ouo opened this issue Mar 1, 2024 · 2 comments · May be fixed by #787
Open

[REQUEST] Explain more thoroughly on how to compile btop with GCC 10 #786

akamayu-ouo opened this issue Mar 1, 2024 · 2 comments · May be fixed by #787
Assignees
Labels
enhancement New feature or request

Comments

@akamayu-ouo
Copy link

Is your feature request related to a problem? Please describe.

I tried to build btop with make on an Ubuntu 20.04 machine with g++ 10.5.0 and got errors about missing header <source_location> in btop_tools.hpp.

$ make CXX=g++-10 GPU_SUPPORT=false
...
In file included from src/btop_input.cpp:29:
src/btop_tools.hpp:40:10: fatal error: source_location: No such file or directory
   40 | #include <source_location>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:379: obj/btop_input.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from src/btop.cpp:49:
src/btop_tools.hpp:40:10: fatal error: source_location: No such file or directory
   40 | #include <source_location>
      |          ^~~~~~~~~~~~~~~~~
...

It was confusing since make asked for gcc 10.1.0 when I used some older version of gcc, so I expected gcc 10.5.0 would be sufficient.

$ make CXX=g++-9 GPU_SUPPORT=false
Makefile:89: *** ERROR: Compiler too old. (Requires Clang 16.0.0, GCC 10.1.0).  Stop.

It turned out that support for <source_location> was added in gcc 11 1, so to compile btop with gcc 10, I had to add OPTFLAGS=-DNDEBUG to avoid the header being included. (Not sure if the flag is intended for this, but it works.)

Describe the solution you'd like

Add descriptions in README on how to disable <source_location> when compiling with gcc 10 or bump the minimal support version of gcc to 11.

@akamayu-ouo akamayu-ouo added the enhancement New feature or request label Mar 1, 2024
@akamayu-ouo akamayu-ouo changed the title [REQUEST] Explain more thouroughly on how to compile btop with GCC 10 [REQUEST] Explain more thoroughly on how to compile btop with GCC 10 Mar 1, 2024
@imwints
Copy link
Contributor

imwints commented Mar 1, 2024

It was confusing since make asked for gcc 10.1.0 when I used some older version of gcc, so I expected gcc 10.5.0 would be sufficient.

The commit introducing <source_location> happened pretty recent so I guess no one thought about testing and updating the build requirements.

GCC 10 never had proper C++ 20 support and was probably only supported since it was the most recent version of GCC when btop started. Might be time to drop it altogether if we want to use more C++ 20 features like <source_location> and <semaphore>.

The other solution would be to add some ugly macro stuff to replace functionality which increases maintenance. So I'm all for dropping GCC 10.

By the way -DNDEBUG is not a 'feature' so I wouldn't give instructions how to disable it.

@imwints imwints linked a pull request Mar 1, 2024 that will close this issue
@akamayu-ouo
Copy link
Author

GCC 10 never had proper C++ 20 support and was probably only supported since it was the most recent version of GCC when btop started. Might be time to drop it altogether if we want to use more C++ 20 features like <source_location> and <semaphore>.

The other solution would be to add some ugly macro stuff to replace functionality which increases maintenance. So I'm all for dropping GCC 10.

The alternative is not so attractive. I think dropping GCC 10 is a good call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants