librdkafka icon indicating copy to clipboard operation
librdkafka copied to clipboard

rdkafka-static.pc is ignoring install path

Open hanickadot opened this issue 3 years ago • 2 comments

Description

generated rdkafka-static.pc is having wrong prefix:

prefix=/usr/local
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${prefix}/lib

Name: librdkafka++-static
Description: The Apache Kafka C/C++ library (static)
Version: 1.9.2
Requires: 
Cflags: -I${includedir} -DLIBRDKAFKA_STATICLIB
Libs: -L${libdir} ${libdir}/librdkafka++.a
Libs.private: 

even when libdir is suffixed with 64 and prefix is set with cmake to /usr ...

list of installed files with cmake --install build_dir --prefix=/usr

/usr/lib64/cmake/RdKafka/RdKafkaConfig.cmake
/usr/lib64/cmake/RdKafka/RdKafkaConfigVersion.cmake
/usr/lib64/cmake/RdKafka/FindLZ4.cmake
/usr/lib64/cmake/RdKafka/RdKafkaTargets.cmake
/usr/lib64/cmake/RdKafka/RdKafkaTargets-release.cmake
/usr/share/licenses/librdkafka/LICENSES.txt
/usr/lib64/pkgconfig/rdkafka-static.pc
/usr/lib64/librdkafka.a
/usr/include/librdkafka/rdkafka.h
/usr/include/librdkafka/rdkafka_mock.h
/usr/lib64/pkgconfig/rdkafka++-static.pc
/usr/lib64/librdkafka++.a
/usr/include/librdkafka/rdkafkacpp.h

so when I'm using pkgconfig to find rdkafka++-static it won't find the static library as it's looking for it in /usr/local/lib/ which is wrong

Checklist

IMPORTANT: We will close issues where the checklist has not been completed.

Please provide the following information:

  • [x] librdkafka version (release number or git tag): 1.9.2
  • [x] Apache Kafka version: irrelevant
  • [x] librdkafka client configuration: irrelevant>
  • [x] Operating system: centos 7
  • [x] Provide logs (with debug=.. as necessary) from librdkafka (irelevant)
  • [x] Provide broker log excerpts (irelevant)
  • [ ] Critical issue

hanickadot avatar Sep 05 '22 09:09 hanickadot

The .pc prefix= is taken from the ./configure --prefix=... argument, which defaults to /usr/local.

Did you build librdkafka with configure or cmake? Cmake is not officially supported but provided by community members in a best-effort fashion, if you find a problem with the Cmake build process please submit a PR for a fix.

edenhill avatar Oct 03 '22 12:10 edenhill

yes, it is cmake ... ok I will try to look at it :) thanks!

hanickadot avatar Oct 03 '22 12:10 hanickadot

If issue persists please open a new issue. thanks

nhaq-confluent avatar Feb 27 '24 13:02 nhaq-confluent