Reordering of Libs

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

On Thu, Jan 22, 2009 at 11:03 AM, Daniel Macks <dmacks at> 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
>>' 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:
> that was quickly retracted:
> ?


> 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/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


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


> dan
> --
> Daniel Macks
> dmacks at

More information about the pkg-config mailing list