google / uVkCompute

A micro Vulkan compute pipeline and a collection of benchmarking compute shaders
Apache License 2.0
224 stars 38 forks source link

fails to compile on Linux (clang and gcc) #14

Closed gdamjan closed 2 years ago

gdamjan commented 2 years ago

Archlinux latest as of today. tried with gcc and clang. clang is version 13.0.0-2

$ cmake -DCMAKE_C_COMPILER=$(which clang) -DCMAKE_CXX_COMPILER=$(which clang++)  -G Ninja -S ./ -B build/
$ cmake --build build/
[73/257] Building CXX object third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o
FAILED: third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o 
/usr/bin/clang++  -I/home/damjan/src/uVkCompute/third_party/abseil-cpp -w -Wall -Wextra -Weverything -Wno-c++98-compat-pedantic -Wno-conversion -Wno-covered-switch-default -Wno-deprecated -Wno-disabled-macro-expansion -Wno-double-promotion -Wno-comma -Wno-extra-semi -Wno-extra-semi-stmt -Wno-packed -Wno-padded -Wno-sign-compare -Wno-float-conversion -Wno-float-equal -Wno-format-nonliteral -Wno-gcc-compat -Wno-global-constructors -Wno-exit-time-destructors -Wno-non-modular-include-in-module -Wno-old-style-cast -Wno-range-loop-analysis -Wno-reserved-id-macro -Wno-shorten-64-to-32 -Wno-switch-enum -Wno-thread-safety-negative -Wno-unknown-warning-option -Wno-unreachable-code -Wno-unused-macros -Wno-weak-vtables -Wno-zero-as-null-pointer-constant -Wbitfield-enum-conversion -Wbool-conversion -Wconstant-conversion -Wenum-conversion -Wint-conversion -Wliteral-conversion -Wnon-literal-null-conversion -Wnull-conversion -Wobjc-literal-conversion -Wno-sign-conversion -Wstring-conversion -DNOMINMAX -std=gnu++14 -MD -MT third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o -MF third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o.d -o third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o -c /home/damjan/src/uVkCompute/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc
/home/damjan/src/uVkCompute/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:26: error: no member named 'numeric_limits' in namespace 'std'
  if (x->version == std::numeric_limits<uint32_t>::max()) {
                    ~~~~~^
/home/damjan/src/uVkCompute/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:41: error: unexpected type name 'uint32_t': expected expression
  if (x->version == std::numeric_limits<uint32_t>::max()) {
                                        ^
/home/damjan/src/uVkCompute/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:52: error: no member named 'max' in the global namespace
  if (x->version == std::numeric_limits<uint32_t>::max()) {
                                                 ~~^
3 errors generated.
[86/257] Building CXX object third_party/abseil-cpp/absl/strings/CMakeFiles/absl_cord.dir/cord.cc.o
ninja: build stopped: subcommand failed.
gdamjan commented 2 years ago

with gcc 11.1.0-1 it fails similarly but in a different place:

[71/257] Building CXX object third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o
FAILED: third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o 
/usr/bin/c++  -I/home/damjan/src/uVkCompute/third_party/abseil-cpp -w -Wall -Wextra -Wcast-qual -Wconversion-null -Wmissing-declarations -Woverlength-strings -Wpointer-arith -Wundef -Wunused-local-typedefs -Wunused-result -Wvarargs -Wvla -Wwrite-strings -Wno-missing-field-initializers -Wno-sign-compare -DNOMINMAX -std=gnu++14 -MD -MT third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o -MF third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o.d -o third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o -c /home/damjan/src/uVkCompute/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc
/home/damjan/src/uVkCompute/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc: In member function ‘void absl::synchronization_internal::GraphCycles::RemoveNode(void*)’:
/home/damjan/src/uVkCompute/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:26: error: ‘numeric_limits’ is not a member of ‘std’
  451 |   if (x->version == std::numeric_limits<uint32_t>::max()) {
      |                          ^~~~~~~~~~~~~~
/home/damjan/src/uVkCompute/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:49: error: expected primary-expression before ‘>’ token
  451 |   if (x->version == std::numeric_limits<uint32_t>::max()) {
      |                                                 ^
/home/damjan/src/uVkCompute/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:52: error: ‘::max’ has not been declared; did you mean ‘std::max’?
  451 |   if (x->version == std::numeric_limits<uint32_t>::max()) {
      |                                                    ^~~
      |                                                    std::max
In file included from /usr/include/c++/11.1.0/algorithm:62,
                 from /home/damjan/src/uVkCompute/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:38:
/usr/include/c++/11.1.0/bits/stl_algo.h:3467:5: note: ‘std::max’ declared here
 3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
[84/257] Building CXX object third_party/abseil-cpp/absl/strings/CMakeFiles/absl_cord.dir/cord.cc.o
ninja: build stopped: subcommand failed.
gdamjan commented 2 years ago

Confirmed compiles after:

rm -rf ./build/
git pull --recurse-submodules
cmake -DCMAKE_C_COMPILER=$(which clang) -DCMAKE_CXX_COMPILER=$(which clang++)  -G Ninja -S ./ -B build/
cmake --build build/