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

build errors: std::numeric_limits & _mm_storeu_si32 #119

Closed
thomas725 opened this issue Oct 31, 2021 · 10 comments
Closed

build errors: std::numeric_limits & _mm_storeu_si32 #119

thomas725 opened this issue Oct 31, 2021 · 10 comments
Labels
bug Something isn't working question Further information is requested

Comments

@thomas725
Copy link

thomas725 commented Oct 31, 2021

I have a few problems that prevent me from building your project:

path/backscrub/build/abseil-cpp/absl/synchronization/internal/graphcycles.cc: In member function ‘void absl::lts_2020_02_25::synchronization_internal::GraphCycles::RemoveNode(void*)’:
path/backscrub/build/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()) {
      |                          ^~~~~~~~~~~~~~
path/backscrub/build/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()) {
      |                                                 ^
path/backscrub/build/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 path/backscrub/build/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)
      |     ^~~
In file included from path/backscrub/build/xnnpack/src/f32-vbinary/gen/vadd-minmax-sse-x4.c:15:
path/backscrub/build/xnnpack/src/xnnpack/intrinsics-polyfill.h:27:6: error: conflicting types for ‘_mm_storeu_si32’; have ‘void(const void *, __m128i)’
   27 | void _mm_storeu_si32(const void* address, __m128i v) {
      |      ^~~~~~~~~~~~~~~
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/xmmintrin.h:1316,
                 from path/backscrub/build/xnnpack/src/f32-vbinary/gen/vadd-minmax-sse-x4.c:12:
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/emmintrin.h:756:1: note: previous definition of ‘_mm_storeu_si32’ with type ‘void(void *, __m128i)’
  756 | _mm_storeu_si32 (void *__P, __m128i __B)
      | ^~~~~~~~~~~~~~~
make[2]: *** [_deps/xnnpack-build/CMakeFiles/XNNPACK.dir/build.make:8518: _deps/xnnpack-build/CMakeFiles/XNNPACK.dir/src/f32-vbinary/gen/vadd-minmax-sse-x4.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3790: _deps/xnnpack-build/CMakeFiles/XNNPACK.dir/all] Error 2

Can you help me? I'm running Manjaro Linux (=Arch derivate)

@BenBE
Copy link
Collaborator

BenBE commented Oct 31, 2021

Can you see if this is while compiling the TensorFlow Light library or while building backscrub itself? Also can you somehow provide the full command lines for the compiler calls (make VERBOSE=1 should do)?

@BenBE BenBE added bug Something isn't working question Further information is requested labels Oct 31, 2021
@thomas725
Copy link
Author

thomas725 commented Oct 31, 2021

this is the part of the output of make VERBOSE=1 containing errors:

Consolidate compiler generated dependencies of target absl_graphcycles_internal
make[2]: Leaving directory 'path/backscrub/build'
make  -f _deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/build.make _deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/build
make[2]: Entering directory 'path/backscrub/build'
[  5%] Building CXX object _deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o
cd path/backscrub/build/_deps/abseil-cpp-build/absl/synchronization && /usr/bin/c++ -DTFLITE_BUILD_WITH_XNNPACK_DELEGATE -D__CLANG_SUPPORT_DYN_ANNOTATION__ -Ipath/backscrub/build/abseil-cpp -O3 -DNDEBUG -fPIC -Wall -Wextra -Wcast-qual -Wconversion-null -Wmissing-declarations -Woverlength-strings -Wpointer-arith -Wunused-local-typedefs -Wunused-result -Wvarargs -Wvla -Wwrite-strings -Wno-missing-field-initializers -Wno-sign-compare -pthread -std=c++14 -MD -MT _deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o -MF CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o.d -o CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o -c path/backscrub/build/abseil-cpp/absl/synchronization/internal/graphcycles.cc
path/backscrub/build/abseil-cpp/absl/synchronization/internal/graphcycles.cc: In member function ‘void absl::lts_2020_02_25::synchronization_internal::GraphCycles::RemoveNode(void*)’:
path/backscrub/build/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()) {
      |                          ^~~~~~~~~~~~~~
path/backscrub/build/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()) {
      |                                                 ^
path/backscrub/build/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 path/backscrub/build/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)
      |     ^~~
make[2]: *** [_deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/build.make:76: _deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o] Error 1
make[2]: Leaving directory 'path/backscrub/build'
make[1]: *** [CMakeFiles/Makefile2:2937: _deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/all] Error 2
make[1]: Leaving directory 'path/backscrub/build'
make: *** [Makefile:156: all] Error 2

About the question which part is beeing built here: I don't know, sorry.
All I did was:

git clone https://github.com/floe/backscrub
cd backscrub
mkdir build
cd build
cmake ..
make -j $(nproc || echo 4)

@BenBE
Copy link
Collaborator

BenBE commented Oct 31, 2021

Okay, this looks quite strange, but it at least answers the question of which part it's trying to build. Given the path that it failed at this looks like XNNPACK inside the TensorFlow Light build.

Can you have a shot at trying to build the experimental branch? Be sure to properly update submodules when switching to that branch, or clone afresh. Also you may try to avoid side-effects from parallel builds (just make instead of make -j4), but given the above errors this is unlikely the root cause here.

One oddity though: What compiler is your /usr/bin/c++ linked to? GCC or Clang? Based on the compiler flags provided in the command line this looks like Clang, but would be good to clarify. Which version? Can you also check trying to compile with GCC instead and see if this resolves the problem?

@thomas725
Copy link
Author

okey, I have checked out the experimental branch and tried again, looks the same:

[  5%] Building CXX object _deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o
cd path/backscrub/build/_deps/abseil-cpp-build/absl/synchronization && /usr/bin/c++ -DTFLITE_BUILD_WITH_XNNPACK_DELEGATE -D__CLANG_SUPPORT_DYN_ANNOTATION__ -Ipath/backscrub/build/abseil-cpp -O3 -DNDEBUG -fPIC -Wall -Wextra -Wcast-qual -Wconversion-null -Wmissing-declarations -Woverlength-strings -Wpointer-arith -Wunused-local-typedefs -Wunused-result -Wvarargs -Wvla -Wwrite-strings -Wno-missing-field-initializers -Wno-sign-compare -pthread -std=c++14 -MD -MT _deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o -MF CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o.d -o CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o -c path/backscrub/build/abseil-cpp/absl/synchronization/internal/graphcycles.cc
path/backscrub/build/abseil-cpp/absl/synchronization/internal/graphcycles.cc: In member function ‘void absl::lts_2020_02_25::synchronization_internal::GraphCycles::RemoveNode(void*)’:
path/backscrub/build/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()) {
      |                          ^~~~~~~~~~~~~~
path/backscrub/build/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()) {
      |                                                 ^
path/backscrub/build/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 path/backscrub/build/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)
      |     ^~~
make[2]: *** [_deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/build.make:76: _deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o] Error 1
make[2]: Leaving directory 'path/backscrub/build'
make[1]: *** [CMakeFiles/Makefile2:2937: _deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/all] Error 2
make[1]: Leaving directory 'path/backscrub/build'
make: *** [Makefile:156: all] Error 2
    ~/Development/git/backscrub/build   @abee2f87 

@thomas725
Copy link
Author

thomas725 commented Nov 1, 2021

One oddity though: What compiler is your /usr/bin/c++ linked to? GCC or Clang? Based on the compiler flags provided in the command line this looks like Clang, but would be good to clarify. Which version? Can you also check trying to compile with GCC instead and see if this resolves the problem?

Sorry, when I replied yesterday I didn't have the time to read through your complete comment. Under /usr/bin/c++ I find a file, not a link.

I find quite a few related binaries there:

-rwxr-xr-x 4 root root  1,2M 13. Mai 16:02 c++
-rwxr-xr-x 1 root root   51K 15. Mai 13:19 c44
-rwxr-xr-x 1 root root   224 13. Mai 16:02 c89
-rwxr-xr-x 1 root root   215 13. Mai 16:02 c99
-rwxr-xr-x 1 root root  1,2M 13. Mai 16:02 cpp
-rwxr-xr-x 3 root root  1,2M 13. Mai 16:02 gcc
-rwxr-xr-x 2 root root   35K 13. Mai 16:02 gcc-ar
-rwxr-xr-x 2 root root   35K 13. Mai 16:02 gcc-nm
-rwxr-xr-x 2 root root   35K 13. Mai 16:02 gcc-ranlib
-rwxr-xr-x 3 root root  1,2M 13. Mai 16:02 x86_64-pc-linux-gnu-gcc
-rwxr-xr-x 3 root root  1,2M 13. Mai 16:02 x86_64-pc-linux-gnu-gcc-11.1.0
-rwxr-xr-x 2 root root   35K 13. Mai 16:02 x86_64-pc-linux-gnu-gcc-ar
-rwxr-xr-x 2 root root   35K 13. Mai 16:02 x86_64-pc-linux-gnu-gcc-nm
-rwxr-xr-x 2 root root   35K 13. Mai 16:02 x86_64-pc-linux-gnu-gcc-ranlib

Running c++ --version returns c++ (GCC) 11.1.0

About not using parallel threads anymore, I guess I'm already not doing that anymore since you told me to use make VERBOSE=1 instead of make -j $(nproc || echo 4)

Lastly, I think I'm having troubles following your instruction to

Be sure to properly update submodules when switching to that branch, or clone afresh.

How do I do that? I mean I'd know how to do a fresh clone, but not how to clone a different branch, only how to checkout a branch after cloning...?

UPDATE: ah, okey, it seem's I can directly checkout a branch by using this command:
git clone -b experimental --depth=1 --recursive https://github.com/floe/backscrub.git
(at least that's how I would read the top answer @ https://stackoverflow.com/questions/1911109/how-do-i-clone-a-specific-git-branch )

So what I did now was:

cd ~/Development/git
mv backscrub backscrub_try1
git clone -b experimental --depth=1 --recursive https://github.com/floe/backscrub.git
mkdir backscrub/build
cd backscrub/build
cmake ..
make VERBOSE=1

But sadly, the result looks to still be exactly the same:

make[2]: Entering directory 'path/backscrub/build'
[  5%] Building CXX object _deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o
cd path/backscrub/build/_deps/abseil-cpp-build/absl/synchronization && /usr/bin/c++ -DTFLITE_BUILD_WITH_XNNPACK_DELEGATE -D__CLANG_SUPPORT_DYN_ANNOTATION__ -Ipath/backscrub/build/abseil-cpp -O3 -DNDEBUG -fPIC -Wall -Wextra -Wcast-qual -Wconversion-null -Wmissing-declarations -Woverlength-strings -Wpointer-arith -Wunused-local-typedefs -Wunused-result -Wvarargs -Wvla -Wwrite-strings -Wno-missing-field-initializers -Wno-sign-compare -std=c++14 -MD -MT _deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o -MF CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o.d -o CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o -c path/backscrub/build/abseil-cpp/absl/synchronization/internal/graphcycles.cc
path/backscrub/build/abseil-cpp/absl/synchronization/internal/graphcycles.cc: In member function ‘void absl::lts_2020_02_25::synchronization_internal::GraphCycles::RemoveNode(void*)’:
path/backscrub/build/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()) {
      |                          ^~~~~~~~~~~~~~
path/backscrub/build/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()) {
      |                                                 ^
path/backscrub/build/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 path/backscrub/build/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)
      |     ^~~
make[2]: *** [_deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/build.make:76: _deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o] Error 1
make[2]: Leaving directory 'path/backscrub/build'
make[1]: *** [CMakeFiles/Makefile2:2937: _deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/all] Error 2
make[1]: Leaving directory 'path/backscrub/build'
make: *** [Makefile:156: all] Error 2

@phlash
Copy link
Collaborator

phlash commented Nov 3, 2021

Thanks for digging in @thomas725, I'll pull a Manjaro docker image and try to reproduce today. It looks like Tensorflow Lite is not built or tested on Manjaro (https://www.tensorflow.org/lite/guide/build_cmake), so we may have a number of compatibility challenges ahead!

@BenBE
Copy link
Collaborator

BenBE commented Nov 3, 2021

Okay, digging into the source of abseil-cpp/absl/synchronization/internal/graphcycles.cc it looks like they are missing an #include <limits>. Just add this include after <algorithm> or <array> to the list of includes in that file and try again. You may need to repeat adding the step of adding missing headers to the files that fail compilation. Please report that list back here so it can be reported upstream …

Problem is, they are violating the rules of IWYU (include what you use) and rely on the various headers to pull in the proper dependencies for them. May work, but will easily break in unexpected ways when you least suspect it.

@phlash
Copy link
Collaborator

phlash commented Nov 3, 2021

Reproduction

1/ Create isolated, fresh manjaro image using docker:

% docker pull manjarolinux/base:latest
% docker run -it --name manjaro manjarolinux/base

2/ Install dependencies:

# pacman -Syu opencv

3/ Pull backscrub:

# cd ~
# git clone https://github.com/phlash/backscrub.git
# cd backscrub

4/ Attempt build:

# cmake -B build
# cmake --build build -v

This produces the same error as @thomas725

[  5%] Building CXX object _deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o
cd /root/backscrub/build/_deps/abseil-cpp-build/absl/synchronization && /usr/bin/c++ -DTFLITE_BUILD_WITH_XNNPACK_DELEGATE -D__CLANG_SUPPORT_DYN_ANNOTATION__ -I/root/backscrub/build/abseil-cpp -O3 -DNDEBUG -fPIC -Wall -Wextra -Wcast-qual -Wconversion-null -Wmissing-declarations -Woverlength-strings -Wpointer-arith -Wunused-local-typedefs -Wunused-result -Wvarargs -Wvla -Wwrite-strings -Wno-missing-field-initializers -Wno-sign-compare -std=c++14 -MD -MT _deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o -MF CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o.d -o CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o -c /root/backscrub/build/abseil-cpp/absl/synchronization/internal/graphcycles.cc
/root/backscrub/build/abseil-cpp/absl/synchronization/internal/graphcycles.cc: In member function ‘void absl::lts_2020_02_25::synchronization_internal::GraphCycles::RemoveNode(void*)’:
/root/backscrub/build/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()) {
      |                          ^~~~~~~~~~~~~~

Analysis

A Tensorflow Lite dependency (Abseil libraries) uses the C++11 std::numeric_limits<> template type (https://en.cppreference.com/w/cpp/types/numeric_limits), but for some reason
this isn't being located by the toolchain. The requisite header is present /usr/include/c++/11.1.0/limits, the compiler is using C++14 standards, so let's trace the pre-processor by replacing -c with -E for this compile line:

# cd /root/backscrub/build/_deps/abseil-cpp-build/absl/synchronization
# /usr/bin/c++ -DTFLITE_BUILD_WITH_XNNPACK_DELEGATE -D__CLANG_SUPPORT_DYN_ANNOTATION__ -I/root/backscrub/build/abseil-cpp -O3 -DNDEBUG -fPIC -Wall -Wextra -Wcast-qual -Wconversion-null -Wmissing-declarations -Woverlength-strings -Wpointer-arith -Wunused-local-typedefs -Wunused-result -Wvarargs -Wvla -Wwrite-strings -Wno-missing-field-initializers -Wno-sign-compare -std=c++14 -MD -MT _deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o -MF CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o.d -o CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o -E /root/backscrub/build/abseil-cpp/absl/synchronization/internal/graphcycles.cc
# vi CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o

from which we note that the required header is not included. What happens on a working system (my Debian stable) when doing the same?

% c++ --version
c++ (Debian 10.2.1-6) 10.2.1 20210110
% cmake --build build -v
[  5%] Building CXX object _deps/abseil-cpp-build/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o
cd /home/phlash/code/backscrub/build/_deps/abseil-cpp-build/absl/synchronization && /usr/bin/c++ -DTFLITE_BUILD_WITH_XNNPACK_DELEGATE -D__CLANG_SUPPORT_DYN_ANNOTATION__ -I/home/phlash/code/backscrub/build/abseil-cpp -O3 -DNDEBUG -fPIC -Wall -Wextra -Wcast-qual -Wconversion-null -Wmissing-declarations -Woverlength-strings -Wpointer-arith -Wunused-local-typedefs -Wunused-result -Wvarargs -Wvla -Wwrite-strings -Wno-missing-field-initializers -Wno-sign-compare -std=c++14 -o CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o -c /home/phlash/code/backscrub/build/abseil-cpp/absl/synchronization/internal/graphcycles.cc
% cd /home/phlash/code/backscrub/build/_deps/abseil-cpp-build/absl/synchronization
% /usr/bin/c++ -DTFLITE_BUILD_WITH_XNNPACK_DELEGATE -D__CLANG_SUPPORT_DYN_ANNOTATION__ -I/home/phlash/code/backscrub/build/abseil-cpp -O3 -DNDEBUG -fPIC -Wall -Wextra -Wcast-qual -Wconversion-null -Wmissing-declarations -Woverlength-strings -Wpointer-arith -Wunused-local-typedefs -Wunused-result -Wvarargs -Wvla -Wwrite-strings -Wno-missing-field-initializers -Wno-sign-compare -std=c++14 -o CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o -E /home/phlash/code/backscrub/build/abseil-cpp/absl/synchronization/internal/graphcycles.cc
% vi CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o

where we find:

# 37 "/home/phlash/code/backscrub/build/abseil-cpp/absl/synchronization/internal/graphcycles.cc" 2
# 1 "/usr/include/c++/10/algorithm" 1 3
...
# 62 "/usr/include/c++/10/algorithm" 2 3
# 1 "/usr/include/c++/10/stl_algo.h" 1 3
...
# 63 "/usr/include/c++/10/stl_algo.h" 2 3
# 1 "/usr/include/c++/10/bits/uniform_int_dist.h" 1 3
# 35 "/usr/include/c++/10/bits/uniform_int_dist.h" 3
# 1 "/usr/include/c++/10/limits" 1 3
...

now let's compare to the failing build:

# 37 "/root/backscrub/build/abseil-cpp/absl/synchronization/internal/graphcycles.cc" 2
# 1 "/usr/include/c++/10/algorithm" 1 3
...
# 62 "/usr/include/c++/10/algorithm" 2 3
# 1 "/usr/include/c++/10/stl_algo.h" 1 3
...
# 63 "/usr/include/c++/10/stl_algo.h" 2 3
# 1 "/usr/include/c++/10/bits/uniform_int_dist.h" 1 3
# 41 "/usr/include/c++/10/bits/uniform_int_dist.h" 3
...
# 58 "/usr/include/c++/10/bits/uniform_int_dist.h" 3

which indicates that uniform_int_dist.h has changed between compiler versions and no longer includes <limits>, so we may have to do so.. by patching the source file,
but first let's see if it works with clang instead, next test:

# pacman -Syu clang
# clang++ --version
clang version 12.0.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
# cmake -B build -DCMAKE_CXX_COMPILER=clang++
# cmake --build build

that would be a no:

/root/backscrub/build/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()) {
                    ~~~~~^
/root/backscrub/build/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()) {
                                        ^
/root/backscrub/build/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()) {

I wonder if we can downgrade g++?

# pacman -Ss gcc
...
community/gcc10 1:10.3.0-1
    The GNU Compiler Collection - C and C++ frontends (Version 10)

looks like we can, let's try it:

# pacman -Syu gcc10
# cmake --build build -t clean
# cmake -B build -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10
# cmake --build build
...
[100%] Built target backscrub

Fixed! 😄

It looks like Tensorflow and it's dependencies do not support GCC11+ nor clang 12+ at version 2.5.0 that we are using, possibly (untested) later versions
will work (https://github.com/tensorflow/tensorflow/releases) - creating a fresh ticket to try this.

@phlash phlash closed this as completed Nov 3, 2021
@phlash
Copy link
Collaborator

phlash commented Nov 3, 2021

Addendum - there are notes in #93 about GCC-11 builds, which we all should have noticed 😄

@phlash
Copy link
Collaborator

phlash commented Nov 5, 2021

For closure - this is fixed by upgrading Tensorflow to 2.6.0 (or above) - which has now been merged - please updated your build 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants