Reordering of Libs

Christopher Hulbert cchgroupmail at gmail.com
Thu Jan 22 08:13:47 PST 2009


On Thu, Jan 22, 2009 at 11:03 AM, Daniel Macks <dmacks at netspace.org> wrote:
> On Thu, Jan 22, 2009 at 10:09:57AM -0500, Christopher Hulbert wrote:
>> I searched the archive and found a few messages by 'bora.sahin at
>> ttnet.net.tr' on this topic, but never a response. I have a .pc file
>> that has a library requiring linking in the fortran compiler's
>> libraries. These are added with appropriate '-Bstatic' and -Bdynamic'
>> flags to link in static versions of the compiler libraries. Running
>> pkg-config --libs obviously reorders that line and messes that up. Is
>> there an intentional reason for this, or just an implementation
>> artifact?
>
> This message:
>  http://lists.freedesktop.org/archives/pkg-config/2006-February/000088.html
> that was quickly retracted:
>  http://lists.freedesktop.org/archives/pkg-config/2006-February/000089.html
> ?

Yes

>
> Could you give us a sample .pc and what you expect vs what happens?


The .pc file is below. When I run pkg-config --libs, the -Bstatic and
-Bdynamic flags get moved up front presumably treated as other libs.
What I would like, is the -Bstatic to stay ordered with the libs (just
like the Libs line).

[chulbert at fourier pkgconfig]$ PKG_CONFIG_PATH=. pkg-config --libs scats
-Bstatic -Bdynamic
-L/home/chulbert/isl-scrd/x86_64-unknown-linux-gnu/lib64
-L/opt/matio/linux86-64/1.5.0/pgi-8.0/lib
-L/opt/hdf5/linux86-64/1.8.2/pgi-8.0/lib
-L/opt/pgi/linux86-64/8.0-3/libso -L/opt/pgi/linux86-64/8.0-3/lib
-L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -lscats -lseke -lvsip
-lscatsio -lmatio -lhdf5 -lz -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl
-lpgftnrtl -lnspgc -lpgc -lrt -lpthread -lm
[chulbert at fourier pkgconfig]$ pkg-config --version
0.21


prefix=/home/chulbert/isl-scrd/x86_64-unknown-linux-gnu
exec_prefix=${prefix}
libdir=${exec_prefix}/lib64
includedir=${prefix}/include
fcflags=-I${includedir}

Name: SCATS
Description: SCATS Library
Version: 1.1-vc
Libs: -L${libdir} -lscats -lseke
-L/home/chulbert/isl-scrd/x86_64-unknown-linux-gnu/lib64 -lvsip
-lscatsio -L/opt/matio/linux86-64/1.5.0/pgi-8.0/lib
-L/opt/hdf5/linux86-64/1.8.2/pgi-8.0/lib -lmatio -lhdf5 -lz
-L/usr/lib64 -lz  -L/opt/pgi/linux86-64/8.0-3/libso
-L/opt/pgi/linux86-64/8.0-3/lib -L/usr/lib64
-L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -Bstatic -lpgf90 -lpgf90_rpm1
-lpgf902 -lpgf90rtl -lpgftnrtl -lnspgc -lpgc -Bdynamic -lrt -lpthread
-lm -Bstatic -Bdynamic
Cflags: -I${includedir} -I/opt/matio/linux86-64/1.5.0/pgi-8.0/include
-I/home/chulbert/isl-scrd/x86_64-unknown-linux-gnu/include -I/include
   -I/usr/include


Chris

>
> dan
>
> --
> Daniel Macks
> dmacks at netspace.org
> http://www.netspace.org/~dmacks
>
>


More information about the pkg-config mailing list