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

cmake: thrift requires boost headers, include them as Boost_INCLUDE_DIRS #1100

Merged
merged 4 commits into from
Feb 4, 2022

Conversation

ideepika
Copy link
Contributor

Signed-off-by: Deepika Upadhyay dupadhya@redhat.com

Fixes # (issue)

Changes

Please provide a brief description of the changes here.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@codecov
Copy link

codecov bot commented Nov 25, 2021

Codecov Report

Merging #1100 (cdb5e63) into main (a320739) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1100   +/-   ##
=======================================
  Coverage   93.29%   93.29%           
=======================================
  Files         174      174           
  Lines        6404     6404           
=======================================
  Hits         5974     5974           
  Misses        430      430           

@lalitb
Copy link
Member

lalitb commented Nov 29, 2021

Why do we need to bring FindBoost.cmake? Shouldn't this be coming by default with cmake installation:

$ dpkg -L cmake-data | grep -i boost
/usr/share/cmake-3.16/Help/module/FindBoost.rst
/usr/share/cmake-3.16/Modules/FindBoost.cmake
$

@ideepika
Copy link
Contributor Author

ideepika commented Dec 1, 2021

Why do we need to bring FindBoost.cmake? Shouldn't this be coming by default with cmake installation:

$ dpkg -L cmake-data | grep -i boost
/usr/share/cmake-3.16/Help/module/FindBoost.rst
/usr/share/cmake-3.16/Modules/FindBoost.cmake
$

Indeed this should be packaged with cmake, I will test and update the PR soon, thanks for the review!

@ideepika
Copy link
Contributor Author

ideepika commented Dec 2, 2021

@lalitb amended, thanks!

CMakeLists.txt Outdated
if(NOT Thrift_FOUND)
if(Thrift_FOUND)
find_package(Boost REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ideepika - Sorry for replying late on this. Wondering why do we need to explicitly add the Boost headers? Jaeger build is successful in our CI pipeline even without this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ideepika - Do you have any updates here ? Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lalitb sorry I must have missed the notification, I will check and post update tomorrow, thanks!

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
@ideepika
Copy link
Contributor Author

In jaeger we had thrift headers which needed boost headers and since we were using external built boost, we needed to define path for Boost Headers in cmake, that should not be an issue when using system installed boost package.
Jenkins tests (in progress) will let us know if the thrift headers for opentelemetry would need the same or not:
ceph/jaeger-client-cpp@7ad60f7 ; will update soon.

@esigo
Copy link
Member

esigo commented Jan 28, 2022

In jaeger we had thrift headers which needed boost headers and since we were using external built boost, we needed to define path for Boost Headers in cmake, that should not be an issue when using system installed boost package. Jenkins tests (in progress) will let us know if the thrift headers for opentelemetry would need the same or not: ceph/jaeger-client-cpp@7ad60f7 ; will update soon.

@ideepika would it be possible to try setting CPLUS_INCLUDE_PATH to where your boost is and without changes on cmake? Thanks

@lalitb
Copy link
Member

lalitb commented Jan 28, 2022

In jaeger we had thrift headers which needed boost headers and since we were using external built boost, we needed to define path for Boost Headers in cmake, that should not be an issue when using system installed boost package.
Jenkins tests (in progress) will let us know if the thrift headers for opentelemetry would need the same or not:
ceph/jaeger-client-cpp@7ad60f7 ; will update soon.

thanks will wait for the update. I thought boost is only the build-time dependency for thrift, and not included in their API headers. Probably it's not the case.

@ideepika
Copy link
Contributor Author

I did some testing:

  • when we use self compiled boost library (in case of what we do in @ceph) there is build failure
ged1209ac/src/test/librados_test_stub/TestIoCtxImpl.cc
CMake Error at src/opentelemetry-cpp-stamp/opentelemetry-cpp-build-None.cmake:49 (message):
  Command failed: 2

   'make' 'opentelemetry_trace' 'opentelemetry_exporter_jaeger_trace'

  See also

    /build/ceph-17.0.0-10252-ged1209ac/obj-x86_64-linux-gnu/src/opentelemetry-cpp/src/opentelemetry-cpp-stamp/opentelemetry-cpp-build-*.log


/usr/bin/ranlib ../../../lib/libceph_immutable_object_cache_lib.a
make[4]: *** [src/CMakeFiles/opentelemetry-cpp.dir/build.make:116: src/opentelemetry-cpp/src/opentelemetry-cpp-stamp/opentelemetry-cpp-build] Error 1
make[4]: Leaving directory '/build/ceph-17.0.0-10252-ged1209ac/obj-x86_64-linux-gnu'
make[3]: *** [CMakeFiles/Makefile2:4594: src/CMakeFiles/opentelemetry-cpp.dir/all] Error 2

https://jenkins.ceph.com/job/ceph-dev-new-build/ARCH=x86_64,AVAILABLE_ARCH=x86_64,AVAILABLE_DIST=focal,DIST=focal,MACHINE_SIZE=gigantic/60216//consoleFull

https://shaman.ceph.com/builds/ceph/wip-test-deepika-jaeger/f7c3fcb7357b247541e5e319c7db426cada91ea0/jaeger/293825/
with boost include dirs specified compilation is successful, one thing to note is for opentelemetry CI we install boost-all-dev from package available, that's why I suppose we do face this problem

thrift has boost as their header dependency; when building with self compiled boost,
we will end up failing because of missing location for boost headers:
/usr/bin/ar qc ../../lib/liblibrados_impl.a  CMakeFiles/librados_impl.dir/IoCtxImpl.cc.o CMakeFiles/librados_impl.dir/RadosXattrIter.cc.o CMakeFiles/librados_impl.dir/RadosClient.cc.o CMakeFiles/librados_impl.dir/librados_util.cc.o CMakeFiles/librados_impl.dir/librados_tp.cc.o
In file included from /usr/include/thrift/transport/TTransport.h:24,
                 from /usr/include/thrift/protocol/TProtocol.h:28,
                 from /usr/include/thrift/TProcessor.h:24,
                 from /usr/include/thrift/TDispatchProcessor.h:22,
                 from /build/ceph-17.0.0-10478-gd6aaf1fa/src/opentelemetry-cpp/exporters/jaeger/thrift-gen/Agent.h:10,
                 from /build/ceph-17.0.0-10478-gd6aaf1fa/src/opentelemetry-cpp/exporters/jaeger/thrift-gen/Agent.cpp:7:
/usr/include/thrift/transport/TTransportException.h:23:10: fatal error: boost/numeric/conversion/cast.hpp: No such file or directory

to be more cautious, we use FindBoost.cmake variable Boost_INCLUDE_DIRS
specified so that boost installing path is available for opentelemetry
to consume.

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
Copy link
Member

@esigo esigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. LGTM

@lalitb lalitb merged commit e9127fc into open-telemetry:main Feb 4, 2022
ideepika pushed a commit to ideepika/ceph that referenced this pull request Jun 22, 2022
We were using git fetch and an unofficial remote to fetch
opentelemetry-cpp, as it needed additional patch to include boost
headers, with the merge of

open-telemetry/opentelemetry-cpp#1100
open-telemetry/opentelemetry-cpp#1020

we do not require to maintain our own patched version.

This removes compile time fetch for opentelemetry-cpp instead use
official opentelemetry-cpp lib as a submodule.

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
ideepika pushed a commit to ideepika/ceph that referenced this pull request Jun 22, 2022
We were using git fetch and an unofficial remote to fetch
opentelemetry-cpp, as it needed additional patch to include boost
headers, with the merge of

open-telemetry/opentelemetry-cpp#1100
open-telemetry/opentelemetry-cpp#1020

we do not require to maintain our own patched version. Also, we were
using git fetch as a temporary change, now that tracing is always on, it
should be right time to adapt to using opentelemetry-cpp as a submodule.

This removes compile time fetch for opentelemetry-cpp instead use
official opentelemetry-cpp lib as a submodule.

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
ideepika pushed a commit to ceph/ceph-ci that referenced this pull request Jun 27, 2022
We were using git fetch and an unofficial remote to fetch
opentelemetry-cpp, as it needed additional patch to include boost
headers, with the merge of

open-telemetry/opentelemetry-cpp#1100
open-telemetry/opentelemetry-cpp#1020

we do not require to maintain our own patched version. Also, we were
using git fetch as a temporary change, now that tracing is always on, it
should be right time to adapt to using opentelemetry-cpp as a submodule.

This removes compile time fetch for opentelemetry-cpp instead use
official opentelemetry-cpp lib as a submodule.

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
Pegonzal pushed a commit to ceph/ceph that referenced this pull request Oct 13, 2022
We were using git fetch and an unofficial remote to fetch
opentelemetry-cpp, as it needed additional patch to include boost
headers, with the merge of

open-telemetry/opentelemetry-cpp#1100
open-telemetry/opentelemetry-cpp#1020

we do not require to maintain our own patched version. Also, we were
using git fetch as a temporary change, now that tracing is always on, it
should be right time to adapt to using opentelemetry-cpp as a submodule.

This removes compile time fetch for opentelemetry-cpp instead use
official opentelemetry-cpp lib as a submodule.

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants