Open RomanAndronov opened 8 months ago
There are many things here.
1)
These options no longer exists:
-DWITH_JAEGER=OFF \
-DWITH_LOGS_PREVIEW=OFF \
2)
About the path to protobuf
:
-DProtobuf_DIR=/usr/lib64 \
-DProtobuf_INCLUDE_DIR=/usr/include \
-DProtobuf_LIBRARY=/usr/lib64/libprotobuf.so \
-DProtobuf_LIBRARIES=/usr/lib64 \
-DProtobuf_PROTOC_LIBRARY=/usr/lib64/libprotoc.so \
-DPROTOBUF_PROTOC_EXECUTABLE=/usr/bin/protoc \
If protobuf is installed in /usr/lib64, I would expect CMake to find it naturally, without the need to set all this.
Somehow CMake is inconsistent about the protobuf location, this should be the first item to resolve.
Also, please note that the protobuf version has some impact on abseil, per this logic:
if(WITH_OTLP_GRPC OR WITH_OTLP_HTTP)
find_package(Protobuf)
if(Protobuf_VERSION AND Protobuf_VERSION VERSION_GREATER_EQUAL "3.22.0")
if(NOT WITH_ABSEIL)
message(
FATAL_ERROR
"Protobuf 3.22 or upper require abseil-cpp(Recommended version: 20230125 or upper)"
)
endif()
endif()
3)
This is suspicious:
-Dabsl_DIR=/usr/lib64 \
For abseil, the option is WITH_ABSEIL, and CMake will need to find header files as well.
Overall, the build failures looks like the compiler finds multiple abseil implementations, one found externally, and one found in opentelemetry-cpp/api/include/opentelemetry/nostd/internal/absl
, which is meant to be used only when there is no external abseil.
This issue was marked as stale due to lack of activity.
It looks like this issue breaks nixpkgs import as well.
It is no longer possible to build protobuf with abseil, but opentelemetry-cpp without, as the check from above breaks incapsulation.
Describe your environment: the OpenTelemetry C++ client library cmake build on Amazon Linux 2023 fails when the option
WITH_OTLP_GRPC
is set toON
, as in-DWITH_OTLP_GRPC=ON
, see below. The build runs under the native AL23 g++ v11.4.1 compiler with the protobuf and the grpc binaries also provided by AL23 via thesudo yum install -y protobuf-devel grpc-cpp grpc-devel grpc-plugins
command that installs the header files and the libraries into/usr/incude
and/usr/lib64
directories. The otel repo was cloned as described in the installation instructions, via thegit clone --recurse-submodules https://github.com/open-telemetry/opentelemetry-cpp
command. All the other code that depends on the protobuf and the grpc libraries builds perfectly fine.Steps to reproduce Do the git clone command as shown above on AL23 machine. Then, do
and execute the cmake as follows:
What is the expected behavior? The build is expected to work and complete successfully, producing the needed shared libraries and headers.
What is the actual behavior? The build fails. First, cmake produces the following:
saying, on the one hand, that it "Found Protobuf" and, on the other hand, saying twice that it "Could NOT find Protobuf (missing: Protobuf_DIR)".
Hence, the question: if I specified
-DProtobuf_DIR=/usr/lib64
then why does the cmake say that it "Could NOT find Protobuf (missing: Protobuf_DIR)" when Protobuf_DIR was defined?Then, running the
cmake --build . --target all
command, the build proceeds, compiles 61% of the project and at 62% completion fails with errors in the absl land:There are more errors like the ones shown above but fixing these few errors should be a good start.
Any ideas how to fix this and make it work?
Thank you in advance.