I’m trying to compile kernelshark on a openSUSE 11.4 (64 bit) machine.
The problem is explained best in the shell:
trace-cmd> make gui
Package gtk±2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk±2.0.pc’
to the PKG_CONFIG_PATH environment variable
No package ‘gtk±2.0’ found
…
trace-cmd> ls /usr/lib64/pkgconfig/gtk*
/usr/lib64/pkgconfig/gtk±2.0.pc /usr/lib64/pkgconfig/gtkmm-2.4.pc /usr/lib64/pkgconfig/gtk±x11-2.0.pc
/usr/lib64/pkgconfig/gtk-engines-2.pc /usr/lib64/pkgconfig/gtk±unix-print-2.0.pc
trace-cmd> setenv PKG_CONFIG_PATH /usr/lib64/pkgconfig
trace-cmd> make gui
Package gtk±2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk±2.0.pc’
to the PKG_CONFIG_PATH environment variable
No package ‘gtk±2.0’ found
…
trace-cmd> rpm -q libgtk-2_0-0 gtk2-devel
libgtk-2_0-0-2.22.1-13.15.1.x86_64
gtk2-devel-2.22.1-13.15.1.x86_64
Why doesn’t pkgconfig find the library? What am I missing here?
This is what the “setenv” command was for. Is the environment being ignored?
And, why is it necessary in the first place? I would have expected pkgconfig to have that directory already. /usr/lib64/pkgconfig seems to be the place where all the .pc files reside, so why doesn’t it look there first?
trace-cmd> pkg-config --list-all
libssl OpenSSL - Secure Sockets Layer and cryptography libraries
gmodule-export-2.0 GModule - Dynamic module loader for GLib
libpcre libpcre - PCRE - Perl compatible regular expressions C library with 8 bit character support
libdaemon libdaemon - a lightweight C library that eases the writing of UNIX daemons
libpcrecpp libpcrecpp - PCRECPP - C++ wrapper for PCRE
gmodule-2.0 GModule - Dynamic module loader for GLib
gio-unix-2.0 GIO unix specific APIs - unix specific headers for glib I/O library
openssl OpenSSL - Secure Sockets Layer and cryptography libraries and tools
usbutils usbutils - USB device database
libffi libffi - Library supporting Foreign Function Interfaces
glib-2.0 GLib - C Utility Library
zlib zlib - zlib compression library
libpcreposix libpcreposix - PCREPosix - Posix compatible interface to libpcre
gthread-2.0 GThread - Thread support for GLib
gobject-2.0 GObject - GLib Type, Object, Parameter and Signal Library
uuid uuid - Universally unique id library
gmodule-no-export-2.0 GModule - Dynamic module loader for GLib
libcrypto OpenSSL-libcrypto - OpenSSL cryptography library
gio-2.0 GIO - glib I/O library
libcurl libcurl - Library to transfer files with ftp, http, etc.
libusb libusb - USB access library
libusb-1.0 libusb-1.0 - C API for USB device access from Linux userspace
blkid blkid - Block device id library
mount mount - mount library
Am 19.04.2012 13:16, schrieb AKS42:
> No gtk in there…
>
That is strange you have the gtk2-devel and if I am not mislead this is
the one which installs the correct pc file, so it should list gtk-2.0
here (it does it for me both on 11.4 and 12.1).
Another question, why did you use
setenv PKG_CONFIG_PATH /usr/lib64/pkgconfig
are you not using the bash shell? If not what else, because it is a
c-shell command.
–
PC: oS 11.4 x86_64 | Intel Core i7-2600@3.40GHz | 16GB | KDE 4.8.2 |
GeForce GT 420
Eee PC 1201n: oS 12.1 x86_64 | Intel Atom 330@1.60GHz | 3GB | KDE 4.8.2
| nVidia ION
eCAFE 800: oS 12.1 i586 | AMD Geode LX 800@500MHz | 512MB | KDE 3.5.10 |
xf86-video-geode
Should I try reinstalling the gtk packages to trigger some pre/postinstall scripts (if there are any)?
Or is there a way to tell pkg-config to rescan the .pc files?
Am 19.04.2012 13:46, schrieb AKS42:
> Yes, I’m a tcsh user.
Just to narrow down the problem, can you try the make command from a
bash to see if there is the same problem or not?
What command is exactly executed in the makefile which does throw this
error message?
>
> Should I try reinstalling the gtk packages to trigger some
> pre/postinstall scripts (if there are any)?
Difficult to say, since it does not do any harm I would just try it.
> Or is there a way to tell pkg-config to rescan the .pc files?
>
That I do not know I cannot see an option for that.
–
PC: oS 11.4 x86_64 | Intel Core i7-2600@3.40GHz | 16GB | KDE 4.8.2 |
GeForce GT 420
Eee PC 1201n: oS 12.1 x86_64 | Intel Atom 330@1.60GHz | 3GB | KDE 4.8.2
| nVidia ION
eCAFE 800: oS 12.1 i586 | AMD Geode LX 800@500MHz | 512MB | KDE 3.5.10 |
xf86-video-geode
trace-cmd> remake gui
Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml-2.0' found
GUI COMPILE trace-graph-main.o
/media/5-home/aschallenberg/tmp/3wm-arm/util/trace-cmd/trace-graph-main.c:22:21: fatal error: gtk/gtk.h: Datei oder Verzeichnis nicht gefunden
compilation terminated.
/media/5-home/aschallenberg/tmp/3wm-arm/util/trace-cmd/Makefile:460: *** [trace-graph-main.o] Fehler 1
#0 trace-graph-main.o at /media/5-home/aschallenberg/tmp/3wm-arm/util/trace-cmd/Makefile:460
#1 trace-graph at /media/5-home/aschallenberg/tmp/3wm-arm/util/trace-cmd/Makefile:360
#2 all_gui at /media/5-home/aschallenberg/tmp/3wm-arm/util/trace-cmd/Makefile:345
Command-line invocation:
"remake -f /media/5-home/aschallenberg/tmp/3wm-arm/util/trace-cmd/Makefile BUILDGUI=1 all_gui"
Makefile:342: *** [gui] Fehler 2
#0 gui at /media/5-home/aschallenberg/tmp/3wm-arm/util/trace-cmd/Makefile:342
Command-line invocation:
"remake gui"
But this failure in line 460 is certainly caused due to the pkg-config problem. If gtk+ devel is not found, the include path is not available and then such an error is the consequence. So line 460 is the symptom, not the root cause.
This did not help. I even tried reinstalling pkg-config itself.
Where is PKG_CONFIG_PATH defined in the system? If I grep for that variable, there are no hits in /etc.
Perhaps there is a mistake in the pkg-config configuration…
Things are getting even more weird. I used strace to look over pkg-config’s shoulder and found that it was looking for some .pc files that were reachable via $PATH ! When I remove that directory (a cross-compile toolchain) from PATH it finds the .pc files on my system and “make gui” succeeds.
Why is pkg-config looking into the PATH to find the files and not into PKG_CONFIG_PATH !?!
Am 19.04.2012 15:26, schrieb AKS42:
>
> Things are getting even more weird. I used strace to look over
> pkg-config’s shoulder and found that it was looking for some .pc files
> that were reachable via $PATH ! When I remove that directory (a
> cross-compile toolchain) from PATH it finds the .pc files on my system
> and “make gui” succeeds.
>
> Why is pkg-config looking into the PATH to find the files and not into
> PKG_CONFIG_PATH !?!
>
>
You can ask pkg-config itself to show you where it searches
pkg-config --variable pc_path pkg-config
(it is described in the man page)
–
PC: oS 11.4 x86_64 | Intel Core i7-2600@3.40GHz | 16GB | KDE 4.8.2 |
GeForce GT 420
Eee PC 1201n: oS 12.1 x86_64 | Intel Atom 330@1.60GHz | 3GB | KDE 4.8.2
| nVidia ION
eCAFE 800: oS 12.1 i586 | AMD Geode LX 800@500MHz | 512MB | KDE 3.5.10 |
xf86-video-geode
The reason for the shell dependency was due to my .tcshrc having an statement expanding my $PATH to include the crosscompiler toolchain. When I called bash, the environment was kept, therefore I had the same problem. When I manually removed the crosscompiler toolchain from $PATH, pkg-config listed the gtk2 packages and I was able to build kernelshark.
Update: To be precise: I built using tcsh. The very same shell instance that failed before.
It is my belief that pkgconfig information is NOT being provided as it should for a while with opensuse (maybe since 11.4), thus these issues! it truly sucks when you’re trying to install something that uses pkgconfig to find library information. opensuse need more QA in this regard.
All pkgconfile meta info is located in /usr/lib/pkgconfig.