Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 380661 - dev-lang/swi-prolog-5.10.4 installs a faulty pkg-config file
Summary: dev-lang/swi-prolog-5.10.4 installs a faulty pkg-config file
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Prolog project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-25 16:12 UTC by Christopher Head
Modified: 2015-02-19 05:53 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Head 2011-08-25 16:12:35 UTC
The swi-prolog package puts its SWI-Prolog.h file in /usr/lib64/swipl-5.10.4/include. However, "pkg-config --cflags swipl" does *not* produce any output.

According to <http://www.swi-prolog.org/FAQ/LibAndInclude.html>, at the very bottom, there's a note that says pkg-config ought to be an acceptable way to compile against SWI-Prolog.

Reproducible: Always
Comment 1 Keri Harris gentoo-dev 2011-08-26 20:11:50 UTC
I've revbumped the following swi-prolog ebuilds to include a correct include-path in their respective pkg-config files:

swi-prolog-5.10.5 -> swi-prolog-5.10.5-r1
swi-prolog-5.11.26 -> swi-prolog-5.11.26-r1

I'll get this fix pushed upstream.

Thanks for taking the time to report this bug.
Comment 2 Christopher Head 2011-09-23 06:39:35 UTC
Thank you, this fixed the build for the program I was trying to use. However, now the program fails to run because "error while loading shared libraries: libswipl.so.5.10.5: cannot open shared object file: No such file or directory". This would presumably be because the library is in /usr/lib64/swipl-5.10.5/lib/x86_64-linux/ which isn't part of the runtime library search path.

It seems that you've tried to solve this by adding the PLLDFLAGS option in the .pc file, but I can't find any command-line parameters to pkg-config that make it actually print anything from that line, other than of course --print-variables (and as far as I can tell the PL* variables are the options with which swipl itself was built, not necessarily the options that should be used for clients thereof).

I don't know if one is *supposed* to do something fancy to link to swipl; the manual page is regrettably sparse saying only "Current Unix installations also provide datafiles for pkg-config. see pkg-config(1) for details.". However, every other package I've ever used needs only --cflags and --libs to get all the necessary flags out. I'd like to point out that "pkg-config --help" states that "--libs" should "output all linker flags", notably *not* just libraries as its name implies. Shouldn't those linker flags include the -Wl,--rpath stuff?

Or perhaps there should be symlinks in /usr/lib64; notice what dev-db/postgresql-base does for instance: it puts the actual libraries in /usr/lib64/postgresql-9.0, but makes symlinks in /usr/lib64. This is perhaps a cleaner solution?
Comment 3 Keri Harris gentoo-dev 2011-10-11 06:38:14 UTC
I've been in recent discussion with upstream about the swipl pkg-config file, and have included the eventual upstream fix [1] in pl-5.10.5-r1 and pl-5.11.28. The cflags/libs provided by the pkg-config file are now much closer to those used by swipl-ld itself.

Thanks for being patient with this bug.

[1] http://www.swi-prolog.org/git/pl-devel.git/commitdiff/655c3d5e