← Back to team overview

dolfin team mailing list archive

Re: Building DOLIFN single thread

 

Ok, now I build a dolfin that does not load thread libs:

$ ldd libdolfin.so
	linux-gate.so.1 =>  (0xb7f18000)
	libxml2.so.2 => /usr/lib/libxml2.so.2 (0xb7ba9000)
	libblas.so.3gf => /usr/lib/libblas.so.3gf (0xb7b2b000)
	libumfpack.so.3.1.0 => /usr/lib/libumfpack.so.3.1.0 (0xb7a83000)
	libamd.so.3.1.0 => /usr/lib/libamd.so.3.1.0 (0xb7a7b000)
	libgts-0.7.so.5 => /usr/lib/libgts-0.7.so.5 (0xb7a30000)
	libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb797f000)
	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb788c000)
	libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7867000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb785b000)
	libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb770c000)
	libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7708000)
	libz.so.1 => /usr/lib/libz.so.1 (0xb76f3000)
	libgfortran.so.2 => /usr/lib/libgfortran.so.2 (0xb765c000)
	libpcre.so.3 => /usr/lib/libpcre.so.3 (0xb7634000)
	libselinux.so.1 => /lib/libselinux.so.1 (0xb761b000)
	/lib/ld-linux.so.2 (0xb7f19000)

This is nice. Thanks for the help!

/Dag


Ilmar Wilbers wrote:
> 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
>>
>>   

Attachment: signature.asc
Description: OpenPGP digital signature


References