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
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.
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?
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