← Back to team overview

dolfin team mailing list archive

Re: Building DOLIFN single thread

 

Hmmm, I created a copy of /usr/lib/pkgconfig/gts.pc, changed it to look like this:
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: GTS
Description: GNU Triangulated Surface Library
Version: 0.7.6
Requires: glib-2.0
Libs: -L${libdir}  -lgts -lm
Cflags: -I${includedir}

and put it in a directory before /usr/lib/pkgconfig in the PKG_CONFIG_PATH environment variable. Now I have:
pkg-config gts --libs
-lgts -lm -lglib-2.0
gts-config --libs
-L/usr/lib -lgts -lglib-2.0 -lm

which are equivalent, as pkg-config always strips -L/usr/lib

Running scons now works fine, so do the demos. lildolfin.so is no longer linked with gthreads, the -pthreads flag is also gone.

Hope this helps.

ilmar

Dag Lindbo wrote:
Ilmar Wilbers wrote:
Hardy:
pkg-config gts --libs
-pthread -Wl,--export-dynamic -lgts -lgthread-2.0 -lrt -lgmodule-2.0 -ldl -lglib-2.0
Gutsy:
pkg-config gts --libs
-pthread -Wl,--export-dynamic -lgts -lgthread-2.0 -lrt -lgmodule-2.0 -ldl -lglib-2.0

So the change must have been before that...

https://launchpad.net/ubuntu/+source/gts
Gives the change. Maybe this introduced threads:

* Add dependency on libglib2.0-dev (closes: bug#302869)
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=302869


ilmar

Dag Lindbo wrote:
Johannes Ring wrote:
On Wed, June 25, 2008 Dag Lindbo wrote:
Hello!

I need to build DOLFIN completely single thread. Is this possible?

Let me be more precise: When building a solver that uses DOLFIN the
default pkg-config wants to link against phread, gthread etc. Why were
these link flags introduced?
On my system, the pthread flag seems to be introduced by the GTS
pkg-config file gts.pc, or actually gthread-2.0.pc that gts.pc depends on.
We don't generate the gts.pc file, so we have no control over that one.

Thanks!

It looks like GTS (on my machine) wants a lot of libs:
pkg-config --cflags --libs gts
-pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include  -pthread
-Wl,--export-dynamic -lgts -lgthread-2.0 -lrt -lgmodule-2.0 -ldl -lglib-2.0

GTS has its own 'gts-config', which gives
$ gts-config --libs
-L/usr/lib -lgts -lglib-2.0 -lm

How would I go about to build DOLFIN with this information instead of
what I get from pkg-config --libs gts

/Dag



Follow ups

References