On 2023/09/05 15:58, Stuart Henderson wrote: > On 2023/09/05 16:34, Jos Dehaes wrote: > > Hi, > > > > I want to add the btop port. I used a package from the tech mailing list by > > Stuart Henderson as a base. The problem is that btop needs to be compiled > > with C++20 compiler. He suggested using clang 16, but I could not get that > > to work. > > > > I just used the native g++ detection in the btop Makefile, and this works, > > provided that g++ version 11 is installed. I could not find a way to encode > > that in the port. > > > > Kindly provide guidance on how to get this included. > > > > Cheers, > > Jos > > As I said before, GCC 11 cannot be used as a build dependency in ports. > > The clang 16 bits in the tree are very new, wait for it to settle a bit. >
the attached tar does build with clang 16 but it still fails: c++ -std=c++20 -pthread -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS -D_FILE_OFFSET_BITS=64 -fexceptions -fstack-clash-protection -fcf-protection -fstack-protector -lkvm -O2 -ftree-vectorize -flto=thin -Wall -Wextra -pedantic -isystem include -Isrc -MMD -c -o obj/btop.o src/btop.cpp clang-16: warning: -lkvm: 'linker' input unused [-Wunused-command-line-argument] clang-16: warning: argument unused during compilation: '-fstack-clash-protection' [-Wunused-command-line-argument] In file included from src/btop.cpp:47: src/btop_tools.hpp:159:48: error: no member named 'count_if' in namespace 'std::ranges' return (wide ? wide_ulen(str) : std::ranges::count_if(str, [](char c) { return (static_cast<unsigned char>(c) & 0xC0) != 0x80; })); ~~~~~~~~~~~~~^ src/btop_tools.hpp:179:16: error: no member named 'for_each' in namespace 'std::ranges' std::ranges::for_each(str, [](auto& c) { c = ::toupper(c); } ); ~~~~~~~~~~~~~^ src/btop_tools.hpp:185:16: error: no member named 'for_each' in namespace 'std::ranges' std::ranges::for_each(str, [](char& c) { c = ::tolower(c); } ); ~~~~~~~~~~~~~^ src/btop_tools.hpp:214:10: error: no member named 'distance' in namespace 'std::ranges'; did you mean 'std::distance'? return std::ranges::distance(vec.begin(), std::ranges::find(vec, find_val)); ^~~~~~~~~~~~~~~~~~~~~ std::distance /usr/include/c++/v1/__iterator/distance.h:47:1: note: 'std::distance' declared here distance(_InputIter __first, _InputIter __last) ^ 4 errors generated.
btop.tgz
Description: application/tar-gz