Closed kkiningh closed 4 years ago
Please share /usr/lib/pkgconfig/protobuf.pc (if it's not there we have a problem).
We suspect it lacks the line includedir=${prefix}/include
What is pkg-config --cflags-only-I protobuf
output?
This also happens for me on Debian 9.0 when I'm using a protobuf package I've built myself and installed in my own location rather than system wide (where it could clobber the distro managed stuff). This appears to fix it:
pkg-config --cflags-only-I protobuf
is empty. But if I set PKG_CONFIG_PATH
to point to the location where I installed protobuf properly, it works.
~/oss/clif$ export PKG_CONFIG_PATH=/home/greg/oss/tool_env/lib/pkgconfig
~/oss/clif$ pkg-config --cflags-only-I protobuf
-I/home/greg/oss/tool_env/include
But cmake
doesn't appear to be picking that up from the environment and still fails the same way. Perhaps it needs another flag?
Ah... nevermind. Solved for me: The ../clif_backend/build_matcher/CMakeConfig.txt
file was caching the old empty value so cmake wasn't re-running pkg-config protobuf. Delete that before re-running INSTALL.sh
(or rerunning cmake if done manually) and it found everything via the PKG_CONFIG_PATH
environment variable and is happily on its way to building.
Context from an in person discussion: We found that pkg-config is being too smart for our own good vs our current cmake setup... When you have protobuf installed in /usr on the system, pkg-config reads the protobuf.pc file and determines that the necessary -I flag is -I/usr/include which it then removes (thus the empty output) as that is already an implied default include path. Triggering the "empty-string" error.
We should be able to fix that by modifying tools/clif/backend/CMakeLists.txt
or something related.
@gpshead Gotcha - thanks for looking into it for me. I think your assessment is correct. For completeness, here's the output @mrovner asked for:
kkiningh@mew:~$ pkg-config --cflags-only-I protobuf
kkiningh@mew:~$ cat /usr/lib/pkgconfig/protobuf.pc
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: Protocol Buffers
Description: Google's Data Interchange Format
Version: 3.3.0
Libs: -L${libdir} -lprotobuf -pthread -lpthread
Libs.private: -lz
Cflags: -I${includedir} -pthread
Conflicts: protobuf-lite
Also, for anyone who comes across this thread later, I was able to workaround this by commenting out lines containing "{GOOGLE_PROTOBUF_INCLUDE_DIRS}" in the relevant CMakeLists.txt (specifically, lines 33 and 37 in tools/clif/backend/CMakeLists.txt).
I'm facing the same problem on F25, with a fresh clone of clif. Here are my outputs for what @mrovner asked for:
$ cat /usr/lib64/pkgconfig/protobuf.pc
prefix=/usr
exec_prefix=/usr
libdir=/usr/lib64
includedir=/usr/include
Name: Protocol Buffers
Description: Google's Data Interchange Format
Version: 2.6.1
Libs: -L${libdir} -lprotobuf -lpthread
Libs.private: -lz
Cflags: -I${includedir}
# Commented out because it crashes pkg-config *sigh*:
# http://bugs.freedesktop.org/show_bug.cgi?id=13265
# Conflicts: protobuf-lite
The output of pkg-config --cflags-only-I protobuf
is empty, understandably so since the headers are in /usr/include
.
Sorry about the breakage. This will be fixed in the next "release" this month. Was busy at PyCon. Meanwhile "workaround this by commenting out lines containing "{GOOGLE_PROTOBUF_INCLUDE_DIRS}" in the relevant CMakeLists.txt (specifically, lines 33 and 37 in tools/clif/backend/CMakeLists.txt)."
@mrovner Thanks! Took me a while to find the right CMakeLists.txt
file. I tend to get very confused with cmake :-p; and now I'm noticing the previous comment linked to the appropriate lines in the source!
Sorry about the noise.
I suggest opening a new issue against the current version if build issues are still happening. I run into a few myself depending on what platform I am on, I'm still trying to sort through them to find things that are my own errors vs things we could improve in INSTALL.sh
.
This repo was unmaintained from December 2017 to September 2019.
It was recently updated, see https://github.com/google/clif/discussions/36#discussioncomment-85120 for some background.
If this issue is still relevant please repopen it or ask questions at https://github.com/google/clif/discussions/.
I tried building on Ubuntu 16.04 using ninja and it failed with the following error:
I installed protobuf from source following the directions here.
Here's the output from the full run: