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

nlohmann_json not found when used opentelemetry-cpp as external project #3190

Open
chuandew opened this issue Dec 5, 2024 · 6 comments
Open
Labels
bug Something isn't working needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@chuandew
Copy link

chuandew commented Dec 5, 2024

Describe your environment

chuande@dingo11 ~ » gcc --version
gcc (GCC) 13.1.1 20230614 (Red Hat 13.1.1-4)
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

chuande@dingo11 ~ » uname -a
Linux dingo11.com 4.18.0-513.9.1.el8_9.x86_64 #1 SMP Wed Nov 29 18:55:19 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
chuande@dingo11 ~ » cat /etc/redhat-release 
Rocky Linux release 8.9 (Green Obsidian)

opentelemetry-cpp v1.18.0

Steps to reproduce

git clone https://github.com/chuandew/dingofs.git

git checkout add_opentele

git submodule update --init --recursive

cd third-party

mkdir build

cd build 

cmake ..

make -j 64 VERBOSE=1

What is the expected behavior?
cmake configue success
What is the actual behavior?
error message

CMake Error at /home/chuande/workspace/dingofs/third-party/installed/lib/cmake/opentelemetry-cpp/opentelemetry-cpp-target.cmake:142 (set_target_properties):                                                                         
  The link interface of target "opentelemetry-cpp::otlp_http_client"
  contains:

    nlohmann_json::nlohmann_json

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /home/chuande/workspace/dingofs/third-party/installed/lib/cmake/opentelemetry-cpp/opentelemetry-cpp-config.cmake:131 (include)                                                                                                     
  cmake/external_dependencies.cmake:114 (find_package)
  CMakeLists.txt:199 (include)

Additional context

@chuandew chuandew added the bug Something isn't working label Dec 5, 2024
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Dec 5, 2024
@zurex
Copy link
Contributor

zurex commented Dec 5, 2024

Hi @chuandew, would you mind double check the command that you provide? It failed in my side when compile target: rocksdb

@chuandew
Copy link
Author

chuandew commented Dec 6, 2024

Hi @zurex , sorry for wrong step for produce, the right step, and make sure in the right branch : add_opentele

git clone https://github.com/chuandew/dingofs.git

git checkout add_opentele

git submodule update --init --recursive

cd third-party

mkdir build

cd build 

cmake ..

make -j 64 VERBOSE=1

or you can use our dev docker images, first download dinogfs and it's third party, then

docker run -ti --rm -v $(pwd)/dingofs:/dingofs  dingodatabase/dingofs-base:rocky9 /bin/bash

cd /dingofs

cd third-party

mkdir build

cd build 

cmake ..

make -j 64 VERBOSE=1

dingodatabase/dingofs-base:rocky9 docker file is https://github.com/chuandew/dingofs/blob/add_opentele/docker/base/Dockerfile

@chuandew
Copy link
Author

chuandew commented Dec 9, 2024

I found it's configure ok if I call find_package(nlohmann_json REQUIRED) in project.

@chuandew
Copy link
Author

chuandew commented Dec 9, 2024

Maybe aws sdk should call find_package(nlohmann_json REQUIRED)
Related issue: aws/aws-sdk-cpp#3213

@zurex
Copy link
Contributor

zurex commented Dec 10, 2024

@chuandew good to hear that, feel free to close this issue.

@chuandew
Copy link
Author

@chuandew good to hear that, feel free to close this issue.

Aws has no plan to call find_package(nlohmann_json REQUIRED)
aws/aws-sdk-cpp#3213 (comment)

Maybe in opentelemetry-cpp cmake should trigger this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

2 participants