Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-11023

[C++][CMake] gRPC doesn't respect CMAKE_CXX_COMPILER

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0
    • C++

    Description

      I have both gcc and clang installed. gcc is the default compiler, /usr/bin/c++ points to g++.
      When build flight with clang, it failed with below message.

      $ cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DARROW_FLIGHT=ON -DARROW_WITH_ZLIB=ON -DCMAKE_CXX_COMPILER=/usr/bin/clang++-9 -DCMAKE_C_COMPILER=/usr/bin/clang-9 ..
      
      $ ninja
      
          /usr/bin/c++    -Qunused-arguments -fcolor-diagnostics -O3 -DNDEBUG -O3 -DNDEBUG -fPIC -o CMakeFiles/cmTC_0ad35.dir/testCXXCompiler.cxx.o -c testCXXCompiler.cxx
          c++: error: unrecognized command line option ‘-Qunused-arguments’; did you mean ‘-Wunused-parameter’?
          c++: error: unrecognized command line option ‘-fcolor-diagnostics’
      

      The reason is grpc/absl/cares building steps don't respect CMAKE_CXX_COMPILER and CMAKE_C_COMPILER.
      They're always built with system default compiler.

      Attachments

        Issue Links

          Activity

            People

              yibocai Yibo Cai
              yibocai Yibo Cai
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m