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

care for <format> unsupported environment? #22

Open
jg1uaa opened this issue Jul 13, 2024 · 2 comments
Open

care for <format> unsupported environment? #22

jg1uaa opened this issue Jul 13, 2024 · 2 comments

Comments

@jg1uaa
Copy link
Contributor

jg1uaa commented Jul 13, 2024

I tried to build termbench-pro on Debian-12 with clang++-16 and gcc-12.2.0, there is some errors related with std::format like this.

(clang-16)

[ 25%] Building CXX object libtermbench/CMakeFiles/termbench.dir/termbench.cpp.o
cd /home/uaa/termbench-pro/build/libtermbench && /usr/bin/clang++-16 -Dtermbench_EXPORTS -I/home/uaa/termbench-pro -isystem /home/uaa/termbench-pro/build/_deps/glaze-src/include -O2 -g -DNDEBUG -fPIC -Wall -Wduplicate-enum -Wextra -Wfinal-dtor-non-final-class -Wimplicit-fallthrough -Wmissing-declarations -Wnewline-eof -Wno-unknown-attributes -Wno-unknown-pragmas -Wnull-dereference -Wsign-conversion -Wsuggest-destructor-override -pedantic -Wconversion -fdiagnostics-color=always -Werror -Wextra-semi -Wpessimizing-move -Wredundant-move -Qunused-arguments -Wno-missing-braces -std=c++20 -MD -MT libtermbench/CMakeFiles/termbench.dir/termbench.cpp.o -MF CMakeFiles/termbench.dir/termbench.cpp.o.d -o CMakeFiles/termbench.dir/termbench.cpp.o -c /home/uaa/termbench-pro/libtermbench/termbench.cpp
In file included from /home/uaa/termbench-pro/libtermbench/termbench.cpp:14:
/home/uaa/termbench-pro/libtermbench/termbench.h:123:21: error: no member named 'format' in namespace 'std'
        return std::format("{:7.3f} GB", _value / 1024.0 / 1024.0 / 1024.0);
               ~~~~~^
/home/uaa/termbench-pro/libtermbench/termbench.h:125:21: error: no member named 'format' in namespace 'std'
        return std::format("{:7.3f} MB", _value / 1024.0 / 1024.0);
               ~~~~~^
/home/uaa/termbench-pro/libtermbench/termbench.h:127:21: error: no member named 'format' in namespace 'std'
        return std::format("{:7.3f} KB", _value / 1024.0);
               ~~~~~^
/home/uaa/termbench-pro/libtermbench/termbench.h:128:17: error: no member named 'format' in namespace 'std'
    return std::format("{:7.3f} bytes", _value);
           ~~~~~^
/home/uaa/termbench-pro/libtermbench/termbench.cpp:17:10: fatal error: 'format' file not found
#include <format>
         ^~~~~~~~
5 errors generated.

(gcc-12.2.0)

[ 25%] Building CXX object libtermbench/CMakeFiles/termbench.dir/termbench.cpp.o
cd /home/uaa/termbench-pro/build/libtermbench && /usr/bin/c++ -Dtermbench_EXPORTS -I/home/uaa/termbench-pro -isystem /home/uaa/termbench-pro/build/_deps/glaze-src/include -O2 -g -DNDEBUG -fPIC -Wall -Wduplicated-cond -Wextra -Wimplicit-fallthrough -Wlogical-op -Wmissing-declarations -Wno-unknown-pragmas -Wnull-dereference -Wsign-conversion -pedantic -Wconversion -fdiagnostics-color=always -Werror -Wextra-semi -Wpessimizing-move -Wredundant-move -Wno-missing-braces -std=c++20 -MD -MT libtermbench/CMakeFiles/termbench.dir/termbench.cpp.o -MF CMakeFiles/termbench.dir/termbench.cpp.o.d -o CMakeFiles/termbench.dir/termbench.cpp.o -c /home/uaa/termbench-pro/libtermbench/termbench.cpp
/home/uaa/termbench-pro/libtermbench/termbench.cpp:17:10: fatal error: format: そのようなファイルやディレクトリはありません
   17 | #include <format>
      |          ^~~~~~~~
compilation terminated.

I don't know what compiler is required (latest GCC?), but I think using libfmt is better for a while.
(contour-terminal's scripts/install-deps.sh requires termbenchpro and it is used by build.yml, so this problem needs to be fixed for easy-to-add new distros)

@christianparpart
Copy link
Member

Hey; seems like you need either GCC 13 or higher or Clang (I thought 17) with libc++17 or higher.

Isn't there anything less old on Debian? Sorry for asking so blind, I'm not a Debian user :)

@Yaraslaut
Copy link
Member

Even with clang, everything is compiled against libstdc++, formatting support was added in GCC 13, so you need at least gcc 13 on your system to compile it.
@jg1uaa last release of contour that uses fmt is https://github.com/contour-terminal/contour/releases/tag/v0.5.0.7168 but please note that you need fmt version lower than 11

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

No branches or pull requests

3 participants