Dependencies of programs using gtk/gtk.h - linux

I have mini pc with vortex86DX processor. And today I install Ubuntu 9.04 on it. Now I want to use my program, which use gtk/gtk.h, to display some data. And I have question -
What dependencies have programs, which use GTK 3.0? It's very important for me, because I have not internet access on this small pc.

You generally build such GTK programs using pkg-config. And I am getting (on Debian/Sid/AMD64) the compile flags
% pkg-config --cflags gtk+-x11-3.0
-pthread -I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 \
-I/usr/include/at-spi2-atk/2.0 -I/usr/include/pango-1.0 \
-I/usr/include/gio-unix-2.0/ -I/usr/include/cairo \
-I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 \
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include \
-I/usr/include/harfbuzz -I/usr/include/freetype2 \
-I/usr/include/pixman-1 -I/usr/include/libpng12 \
-I/usr/include/libdrm
and the link flags
% pkg-config --libs gtk+-x11-3.0
-lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 \
-lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo \
-lgobject-2.0 -lglib-2.0
Notice that these shared libraries link some other ones (eg -lX11 or -ldbus). Try to ldd some GTK binary (e.g. your own one, or gedit)
NB: I have manually added the backslashes and newlines for readability
However, there are much more other runtime dependencies: the X11 server and related things (session and windows managers, fonts and images notably and perhaps even some "desktop" environment à la Gnome or IceWM, etc...).
I suggest installing GTK usig the package system (e.g. using aptitude install on Ubuntu) with a network connection (perhaps using a chroot-ed environment) to understand all the dependencies.

Related

threading.h:10:24: fatal error installation error

Fairly unknowledgable linux (ubuntu 14.04) user here. I'm trying to install a bioinformatics program called Bowtie2 - I get this error and not sure where it's coming from. They did quote this on their website which might have something to do with it, but didn't mention it as a dependency.
TBB is now the default threading library. We consistently found TBB to
give superior thread scaling. It is widely available and widely
installed. That said, we are also preserving a "legacy" version of
Bowtie that, like previous releases, does not use TBB. To compile
Bowtie source in legacy mode use NO_TBB=1. To use legacy binaries,
download the appropriate binary archive with "legacy" in the name.
sam#SumnerLab-Computer:~/Program_Files/bowtie-1.2$ make
g++ -w -O3 -m64 -DCOMPILER_OPTIONS="\"-O3 -m64 -Wl,--hash-style=both -DWITH_TBB -DPOPCNT_CAPABILITY -DNO_SPINLOCK -DWITH_QUEUELOCK=1 \"" -Wl,--hash-style=both -DWITH_TBB -DPOPCNT_CAPABILITY -DNO_SPINLOCK -DWITH_QUEUELOCK=1 \
-fno-strict-aliasing -DBOWTIE_VERSION="\"`cat VERSION`\"" -DBUILD_HOST="\"`hostname`\"" -DBUILD_TIME="\"`date`\"" -DCOMPILER_VERSION="\"`g++ -w -v 2>&1 | tail -1`\"" -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DPREFETCH_LOCALITY=2 -DBOWTIE_MM -DBOWTIE_SHARED_MEM -DNDEBUG -Wall \
-I SeqAn-1.1 -I third_party -I third_party \
-o bowtie-build-s ebwt_build.cpp \
ccnt_lut.cpp ref_read.cpp alphabet.cpp shmem.cpp edit.cpp ebwt.cpp bowtie_build_main.cpp \
-lpthread -ltbb -ltbbmalloc_proxy
In file included from pat.h:17:0,
from sequence_io.h:12,
from multikey_qsort.h:8,
from diff_sample.h:8,
from blockwise_sa.h:13,
from ebwt.h:27,
from ebwt_build.cpp:11:
threading.h:10:24: fatal error: tbb/mutex.h: No such file or directory
compilation terminated.
Makefile:259: recipe for target 'bowtie-build-s' failed
make: *** [bowtie-build-s] Error 1
Any ideas what the issue might be?
thanks
You'll probably need to install the package TBB development package, e.g. libtbb-dev.
On Ubuntu, run sudo apt-get install libtbb-dev
​sudo apt-get install libtbb-dev
​make

How to compile latest sources using older gcc glibc versions and run them?

I'm able to compile & run the latest "stockfish chess engine" sources using GCC 4.8 or later on Redhat EL 7.X. The latest source code (alongwith README) is available at https://github.com/mcostalba/Stockfish/tree/master
The commands to compile & build are: (goto "src" directory)
gmake build ARCH=x86-64
gmake install
However my requirement is to compile & run the same on Redhat EL 6.7 Server where the latest GCC version available is 4.4.7 (& glibc 2.12) as I can NOT upgrade GCC version without actually migrating to RHEL 7.X
Is it possible to modify the latest source to get it compliled & run on old version of gcc/glibc? if yes, would anyone be able to modify the sources (perhaps just Makefile?) for me please?
I tried changing "C ++ 11" to "C ++ 0x" in the "Makefile" but no luck. Please see the error I'm getting when I try to compile latest SF source with GCC 4.4.7:
[root#test-server src]# ldd --version
ldd (GNU libc) 2.12
Copyright (C) 2010 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.
Written by Roland McGrath and Ulrich Drepper.
[root#test-server src]# gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)
Copyright (C) 2010 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.
[root#test-server src]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.7 (Santiago)
[root#test-server src]# uname -r
2.6.32-573.12.1.el6.x86_64
[root#test-server src]# gmake build ARCH=x86-64
gmake ARCH=x86-64 COMP=gcc config-sanity
gmake[1]: Entering directory `/root/Stockfish-master/src'
Config:
debug: 'no'
optimize: 'yes'
arch: 'x86_64'
bits: '64'
prefetch: 'yes'
popcnt: 'no'
sse: 'yes'
pext: 'no'
Flags:
CXX: g++
CXXFLAGS: -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto
LDFLAGS: -Wl,--no-as-needed -lpthread -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto
Testing config sanity. If this fails, try 'make help' ...
gmake[1]: Leaving directory `/root/Stockfish-master/src'
gmake ARCH=x86-64 COMP=gcc all
gmake[1]: Entering directory `/root/Stockfish-master/src'
g++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -pedantic -Wextra -Wshadow -m64 -DNDEBUG -O3 -DIS_64BIT -msse -flto -c -o benchmark.o benchmark.cpp
cc1plus: error: unrecognized command line option "-std=c++11"
cc1plus: error: unrecognized command line option "-flto"
gmake[1]: * [benchmark.o] Error 1
gmake[1]: Leaving directory `/root/Stockfish-master/src'
gmake: * [build] Error 2
[root#test-server src]#
Many thanks in advance!
Is it possible to modify the latest source to get it compliled & run
on old version of gcc/glibc? if yes, would anyone be able to modify
the sources (perhaps just Makefile?) for me please?
Sure it's possible. It will take time and effort though.
I can NOT upgrade GCC version without actually migrating to RHEL 7.X
You can't install the GCC binary from RHEL you mean. But if you have one compiler you can have another.
You have a few options which allow you to manually compile your own GCC and install it to /opt or /usr/local without messing your system.
You can do it manually or use a tool chain like installing gentoo`s portage or bootstrapping pkgsrc which offers gcc-4.8
Although, I am an avid gentoo user, I recommend using pkgsrc on foreign architectures. It's very easy to get started with, and have a vast number of packages.

Installing the webp plugin for gimp on Ubuntu linux

I'm a linux novice and I'm trying to install the webp plugin for gimp on an Ubuntu desktop. I have downloaded the tarball from the download site of gimp and extracted it. I followed the instructions in the readme, but it doesn't work.
It says I first need to install the webp library from google. It can be found here:
http://code.google.com/speed/webp/download.html
But I have no idea how to install it. It's probably something trivial, but being a novice I have no idea what to do next.
I also went to the Ubuntu Software Center and found the same package there and clicked the install button. That seemed to have worked so I think it is installed now.
The readme tells me to issue the following commands:
export LIBS=-lwebp
gimptool-2.0 --install file-webp.c
And this gives me the following result:
gcc -pthread -I/usr/include/gtk-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/harfbuzz -I/usr/include/gimp-2.0 -o /home/pascal/.gimp-2.8/plug-ins/file-webp file-webp.c -lgimpui-2.0 -lgimpwidgets-2.0 -lgimpmodule-2.0 -lgimp-2.0 -lgimpmath-2.0 -lgimpconfig-2.0 -lgimpcolor-2.0 -lgimpbase-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfontconfig -lgobject-2.0 -lglib-2.0 -lfreetype -lwebp
/usr/bin/ld: cannot find -lwebp
collect2: error: ld returned 1 exit status
I also tried using -libwebp instead of -lwebp, but that gives me the same error message.
update
I installed libwebp-dev as well and tried the same command. It solved the error, but now gives me another error:
gcc -pthread -I/usr/include/gtk-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/libpng12 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/harfbuzz -I/usr/include/gimp-2.0 -o /home/pascal/.gimp-2.8/plug-ins/file-webp file-webp.c -lgimpui-2.0 -lgimpwidgets-2.0 -lgimpmodule-2.0 -lgimp-2.0 -lgimpmath-2.0 -lgimpconfig-2.0 -lgimpcolor-2.0 -lgimpbase-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfontconfig -lgobject-2.0 -lglib-2.0 -lfreetype -lwebp
/tmp/cchf3eQS.o: In function `run':
file-webp.c:(.text+0x1b2): undefined reference to `read_webp'
file-webp.c:(.text+0x281): undefined reference to `export_dialog'
file-webp.c:(.text+0x2b5): undefined reference to `write_webp'
collect2: error: ld returned 1 exit status
The WebP plugin is included in Gimp 2.10 as a built-in plugin.
On older scenarios:
sudo add-apt-repository ppa:george-edison55/webp
sudo apt update
sudo apt install gimp-webp
Also, in Ubuntu (since 16.04):
sudo apt install webp
Will provide you with these commands:
dwebp: decompress a WebP file to an image file
cwebp: compress an image file to a WebP file
webpmux: create animated WebP files from non-animated WebP images, extract frames from animated WebP images, and manage XMP/EXIF metadata and ICC profile.
gif2webp: Convert a GIF image to WebP
vwebp: decompress a WebP file and display it in a window
I'm guessing you installed the webp package. Instead, install the libwebp-dev package.
The webp package provides CLI binary tools. The libwebp-dev package provides the development library needed to compile programs that use libwebp.
The compiler flag -lwebp causes the compiler the look for a library called libwebp.a libwebp-dev provides this file.

g-ir-scanner fails to generate gir-file

I am trying to generate a .gir-file from a very simple library; it's basically the GObject example from the GLib documentation. When using g-ir-scanner, it fails with the follwing error:
$ g-ir-scanner -I./ --library=foo --library-path=./ --pkg=gobject-2.0 --namespace=Foo -o foo-bar.gir foo-bar.c foo-bar.h
g-ir-scanner: compile: gcc -Wall -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64- linux-gnu/glib-2.0/include -I./ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib- 2.0/include -c -o /home/roman/Documents/own_gobject/tmp-introspectEx3pzw/Foo-None.o /home/roman/Documents/own_gobject/tmp-introspectEx3pzw/Foo-None.c
g-ir-scanner: link: gcc -o /home/roman/Documents/own_gobject/tmp-introspectEx3pzw/Foo-None /home/roman/Documents/own_gobject/tmp-introspectEx3pzw/Foo-None.o -L. -Wl,-rpath=. - lfoo -L./ -Wl,--export-dynamic -pthread -lgio-2.0 -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0
ERROR: can't resolve libraries to shared libraries: foo
I have really no idea what went wrong. Any ideas?
This is a bug in g-ir-scanner (https://bugzilla.gnome.org/show_bug.cgi?id=699442). Basically foo-bar does not contain any GObject classes and it has failed. A class is detected by having a function called foo_blah_get_type().
the --library argument of g-ir-scanner needs the name of the shared object - for instance, libfoo.so, or libfoo.la if you're using libtool in your build environment.

how to force linking on linux libgpod and rhythmbox

Ok, I've added some functionality to a linux library.
However even after 'make install' the program I'm trying to confirm functionality is linking to the previous version.
So 'make install' puts my libraries here:
'/usr/local/lib'
and
'/usr/local/include'
I used the following on configure:
./configure --enable-maintainer-mode --enable-uninstalled-build 'CFLAGS=-g -O0' 'CXXFLAGS=-g -O0' 'JFLAGS=-g -O0' 'FFLAGS=-g -O0' CPPFLAGS='-L /usr/local/lib/ -I /usr/local/include/gpod-1.0/'
But when I try to execute the program I get 'Symbol not found' and 'Plugin can not load'
When I ldd the produced plugin so:
~/Development/rhythmbox/plugins/ipod/.libs$ ldd libipod.so
linux-gate.so.1 => (0x00d97000)
librhythmbox-core.so.1 => /home/gary/Development/rhythmbox/shell/.libs/librhythmbox core.so.1 (0x009ad000)
libgpod.so.4 => /usr/lib/libgpod.so.4 (0x00509000)
The emphasis being stressed because it's obviously linking to the wrong library... When I look in the make file I see the following:
IPOD_CFLAGS = -pthread -I/usr/local/include/gpod-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12
IPOD_LIBS = -pthread -L/usr/local/lib -lgpod -lgdk_pixbuf-2.0 -lm -lgobject-2.0 -lgmodule-2.0 -lpng12 -lgthread-2.0 -lrt -lglib-2.0
So the CPPFLAGS are being passed through to the plugin, and in .deps I see the proper header file being included... IE:
~/Development/rhythmbox/plugins/ipod/.deps$ less rb-ipod-source.Po | grep gpod
/usr/local/include/gpod-1.0/gpod/itdb.h ../../lib/eel-gconf-extensions.h
/usr/local/include/gpod-1.0/gpod/itdb.h:
Ubuntu 10.10
Any ideas?
You need to set LD_RUN_PATH to /usr/local/lib before running configure and make. This will embed /usr/local/lib as a shared library search path into the executable.
libgpod.so is pointing to the old version of the library.

Resources