Coin.pc file is missing in /usr/lib/pkgconfig

Asked by gpunktet on 2012-01-04

Hello,

hopefully I'm at the right corner here, but i searched the internet this day but didn't find any answer to it:

When installing the "libcoin60-dev" package in Ubuntu (mine i 64 bit Oneiric) no pkg-config file "Coin.pc" is provided under "/usr/lib/pkgconfig/". Is it possible to "install" a pkg-config file in with the package manager? This would spare me the time to install Coin manually...

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu coin3 Edit question
Assignee:
No assignee Edit question
Last query:
2012-01-05
Last reply:
2012-01-05

Can you give the output of:

lsb_release -a; uname -a; dpkg -l | grep -i coin

Thanks

mycae (mycae) said : #2

hi gpunktet,

Pkg-config are not always shipped with all libraries, such as is the case with COIN. This is unlikely to be resolved at any short notices -- you can post a bug, but its not likely that this will solve your problem within the timeframe you are interested in.

However, it sounds like you are trying to compile or develop something -- normally you can override the necessary flags using environment variables, or by modifying makefiles, or by passing the right info to configure, without the need to use pkg-config.

If you can give us more info, we may be able to provide some input.

gpunktet (kilian-grundl) said : #3

Hi there,

thank you for your fast answers. I'm always surprised how fast this works ...

@actionparsnip:
output of
lsb_release -a; uname -a; dpkg -l | grep -i coin :

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.10
Release: 11.10
Codename: oneiric
Linux grundl-Latitude-E5420 3.0.0-14-generic #23-Ubuntu SMP Mon Nov 21 20:28:43 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
ii libcoin60 3.1.3-2 high-level 3D graphics kit implementing the Open Inventor API
ii libcoin60-dev 3.1.3-2 high-level 3D graphics devkit with Open Inventor and VRML97 support
ii libcoin60-doc 3.1.3-2 high-level 3D graphics kit with Open Inventor and VRML97 support

@mycae:
Yes indeed, I modified the configure.ac-file as the project uses GNU-Autotools:

Old-Version (works fine with pkg-config...):
PKG_CHECK_MODULES(COIN, Coin)

New-version (works fine with pkg-config and if the command-line tool coin-config exists - as far as I can tell):
PKG_CHECK_MODULES(COIN, Coin,, [
test=$(coin-config --cflags --cppflags --cxxflags)
COIN_CFLAGS=$(echo $test)
test=$(coin-config --libs --ldflags)
COIN_LIBS=$(echo $test)
])
AC_SUBST(COIN_CFLAGS)
AC_SUBST(COIN_LIBS)

The problem is, that the configure-script doesn't return an error, if the command line tool coin-config doesn't exist. Well probably this isn't the right place to ask this question, but maybe one of you can give me a hint (at least to a better forum?):
Is it possible to use any Autoconf-Macros to test, whether this program is available? And is this way of doing it the "correct" way?

gpunktet (kilian-grundl) said : #4

btw: Is it possible some how to format the output of commands or a commands itself in another way as the rest of the text?

mycae (mycae) said : #5

I would recommend using pkg-config as a fallback, rather than a primary -- this is how most autotools scripts run things.

The classic way to do this is to use AC_CHECK_HEADERS and AC_CHECK_LIB, to compile a test program. You might previously set the libs to use a few common linker flags, like in this case, -lcoin60 (assuming libcoin60.so is the soname, which by convention is the same as the library filename).

eg:

 AC_CHECK_LIB(coin60,main,
                [COIN_LIBS="$COIN_LIBS"
                AC_DEFINE_UNQUOTED(HAVE_COIN,1,[Define if you have the COIN library])],
                [AC_MSG_ERROR(Error: COIN library not available - no libcoin.)])

you may also want to use AC_ARG_WITH to allow users to pass in something like

--with-coin-libs="-lsomeothernameforcoin"

Can you help with this problem?

Provide an answer of your own, or ask gpunktet for more information if necessary.

To post a message you must log in.