Skip to content

[BUILD] Compile WITH_OTLP failed #2095

Closed

Description

@ivgotcrazy

Describe your environment
Linux CentOS7 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
gcc 12.2.0

Steps to reproduce

  1. git clone master
  2. cmake3 -DBUILD_TESTING=OFF -DCMAKE_CXX_STANDARD=17 -DWITH_OTLP=ON ..

-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building for architecture ARCH=x64
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
CMake Warning at /usr/share/cmake3/Modules/FindProtobuf.cmake:500 (message):
Protobuf compiler version 22.2 doesn't match library version 4.22.2
Call Stack (most recent call first):
CMakeLists.txt:333 (find_package)

-- Found Protobuf: /usr/local/lib64/libprotobuf.a;-lpthread (found version "4.22.2")
-- PROTOBUF_PROTOC_EXECUTABLE=/usr/local/bin/protoc
-- opentelemetry-proto dependency satisfied by: git submodule
-- Performing Test check_cxx_compiler_flag_-Wno-type-limits
-- Performing Test check_cxx_compiler_flag_-Wno-type-limits - Success
-- Performing Test check_cxx_compiler_flag_-Wno-deprecated-declarations
-- Performing Test check_cxx_compiler_flag_-Wno-deprecated-declarations - Success
-- Performing Test check_cxx_compiler_flag_-Wno-unused-parameter
-- Performing Test check_cxx_compiler_flag_-Wno-unused-parameter - Success
-- gRPC_CPP_PLUGIN_EXECUTABLE=/usr/local/bin/grpc_cpp_plugin
Building with nostd types...
PATH:/root/opentelemetry-cpp/examples/grpc/protos:/root/opentelemetry-cpp/examples/grpc/protos/messages.proto
-- Configuring done
-- Generating done
-- Build files have been written to: /root/opentelemetry-cpp/build

  1. make

What is the expected behavior?
success

What is the actual behavior?
failed

Additional context
error.txt

Activity

  1. marcalff commented on Apr 13, 2023

    @marcalff
    Member

    I suspect that -DCMAKE_CXX_STANDARD=17 in fact requires -DWITH_STL in practice, which should be documented and/or enforced in the makefile.

    Here, the compiler which supports C++17 compiles with replacement headers in the nostd namespace, which are meant to provide C++11 features to pre-C++11 compilers ... causing the errors reported.

    See related options:

    • WITH_GSL
    • WITH_ABSEIL
  2. ivgotcrazy commented on May 2, 2023

    @ivgotcrazy
    Author

    thanks a lot, it seems to work.

  3. added
    help wantedGood for taking. Extra help will be provided by maintainers
    on May 17, 2023
  4. lidavidm commented on May 25, 2023

    @lidavidm
    Contributor

    We ran into this on the conda-forge package when Protobuf got bumped. WITH_STL mostly fixes things, but it seems Protobuf 4.23 also removed google/protobuf/stubs/stringpiece.h and google/protobuf/stubs/strutil.h which causes issues for otlp_http_client.cc. (And removing the includes isn't enough, since that file calls google::protobuf::Base64Escape; that appears to no longer be in the Protobuf API.)

  5. h-vetinari commented on May 26, 2023

    @h-vetinari

    but it seems Protobuf 4.23 also removed google/protobuf/stubs/stringpiece.h and google/protobuf/stubs/strutil.h which causes issues for otlp_http_client.cc

    The commit for this is protocolbuffers/protobuf@a3c8e2d, and it seems to be due to the switch to abseil, e.g.:

       static const char kSuffix[] = "_FIELD_NUMBER";
       if (PyString_AsStringAndSize(name, &attr, &attr_size) >= 0 &&
    -      HasSuffixString(StringPiece(attr, attr_size), kSuffix)) {
    +      HasSuffixString(absl::string_view(attr, attr_size), kSuffix)) {
         std::string field_name(attr, attr_size - sizeof(kSuffix) + 1);
         LowerString(&field_name);
  6. self-assigned this
    on May 27, 2023
  7. changed the title [-]compile WITH_OTLP failed[/-] [+][BUILD] Compile WITH_OTLP failed[/+] on Jun 1, 2023
  8. github-actions commented on Aug 1, 2023

    @github-actions

    This issue was marked as stale due to lack of activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedGood for taking. Extra help will be provided by maintainers

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions