essentia icon indicating copy to clipboard operation
essentia copied to clipboard

Only link against libessentia in the pc file. Fixes #340

Open alastair opened this issue 8 years ago • 4 comments

When we want to link libessentia.so into a program we only need to specify -lessentia. Other dependencies of essentia are already correctly linked against the .so. If a user wants to also link their program against the same dependency (e.g. libav) then they should explicitly link against that themselves.

alastair avatar Jul 20 '17 14:07 alastair

Those dependencies are required for the static version of the library. Probably two different .pc files can be generated depending on whether the shared or static libessentia was built.

dbogdanov avatar Aug 21 '17 14:08 dbogdanov

One thing to think about is the location of the.pc files. On Ubuntu, to the best of my understanding, /usr/local/share/pkgconfig is automatically searched. /usr/local/lib/pkgconfig may be on the automatic search path in many other flavours of linux but requires PKG_CONFIG_PATH to be set to it on Ubuntu.

sildeag avatar Jun 21 '18 02:06 sildeag

The correct way would be to specify Essentia's dependencies in Libs.private when generating the pc file.

@sildeag Here is some related info: /usr/share is for architecture-independent data, for that reason using /usr/local/lib/pkgconfig is more appropriate.

dbogdanov avatar Jun 21 '18 10:06 dbogdanov

@dbogdanov thanks for the info. I was just pointing out that /usr/local/lib/pkgconfig wasn't in the automatic search path for Ubuntu. This impacts build scripts which use .pc files - since on Ubuntu not everyone has PKG_CONFIG_PATH set and/or has some out-dated .pc file on their system that is in the automatic search path.

sildeag avatar Jun 21 '18 16:06 sildeag