Subject: Re: libvorbis using wrong library
To: Johnny Lam <jlam@jgrind.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 10/03/2001 22:06:45
On Wed, 3 Oct 2001, Johnny Lam wrote:

> On Wed, Oct 03, 2001 at 07:02:35PM -0700, Jeremy C. Reed wrote:
> > Please note that I have a working libvorbis-1.0beta4 installed under
> > /usr/local/lib/.
> 
> Exactly which Ogg/Vorbis-related libraries can be found in /usr/local/lib?

I am using modified versions of libao 0.6.0, libogg 1.0beta4, libvorbis
1.0beta4, and vorbis-tools 1.0beta4. They are installed under /usr/local.
(I think this is irrelevant, because the "package" should have seen and
used the includes and/or libraries under /usr/pkg.)

rainier:~/audio$ ls -l /usr/local/lib/lib{ogg,vorbis}*
-rw-r--r--  1 root  wheel   10538 Mar 22  2001 /usr/local/lib/libogg.a
-rwxr-xr-x  1 root  wheel     644 Mar 22  2001 /usr/local/lib/libogg.la
lrwxr-xr-x  1 root  wheel      13 Mar 22  2001 /usr/local/lib/libogg.so ->
libogg.so.1.0
lrwxr-xr-x  1 root  wheel      13 Mar 22  2001 /usr/local/lib/libogg.so.1
-> libogg.so.1.0
-rwxr-xr-x  1 root  wheel   12084 Mar 22  2001
/usr/local/lib/libogg.so.1.0
-rw-r--r--  1 root  wheel  113468 Mar 22  2001 /usr/local/lib/libvorbis.a
-rwxr-xr-x  1 root  wheel     675 Mar 22  2001 /usr/local/lib/libvorbis.la
lrwxr-xr-x  1 root  wheel      16 Mar 22  2001 /usr/local/lib/libvorbis.so
-> libvorbis.so.0.1
lrwxr-xr-x  1 root  wheel      16 Mar 22  2001
/usr/local/lib/libvorbis.so.0 -> libvorbis.so.0.1
-rwxr-xr-x  1 root  wheel  101598 Mar 22  2001
/usr/local/lib/libvorbis.so.0.1
-rw-r--r--  1 root  wheel  548840 Mar 22  2001
/usr/local/lib/libvorbisenc.a
-rwxr-xr-x  1 root  wheel     696 Mar 22  2001
/usr/local/lib/libvorbisenc.la
lrwxr-xr-x  1 root  wheel      19 Mar 22  2001
/usr/local/lib/libvorbisenc.so -> libvorbisenc.so.0.1
lrwxr-xr-x  1 root  wheel      19 Mar 22  2001
/usr/local/lib/libvorbisenc.so.0 -> libvorbisenc.so.0.1
-rwxr-xr-x  1 root  wheel  550333 Mar 22  2001
/usr/local/lib/libvorbisenc.so.0.1
-rw-r--r--  1 root  wheel   13392 Mar 22  2001
/usr/local/lib/libvorbisfile.a
-rwxr-xr-x  1 root  wheel     703 Mar 22  2001
/usr/local/lib/libvorbisfile.la
lrwxr-xr-x  1 root  wheel      20 Mar 22  2001
/usr/local/lib/libvorbisfile.so -> libvorbisfile.so.0.1
lrwxr-xr-x  1 root  wheel      20 Mar 22  2001
/usr/local/lib/libvorbisfile.so.0 -> libvorbisfile.so.0.1
-rwxr-xr-x  1 root  wheel   16942 Mar 22  2001
/usr/local/lib/libvorbisfile.so.0.1

> > Today, I tried to use vorbis-tools-1.0.0.6 package (1.0rc2) which needs
> > libvorbis-1.0.0.6 package (1.0rc2).

> > ../lib/.libs/libvorbis.a -lm /usr/local/lib/libogg.a

> This is disheartening, since those packages are marked USE_BUILDLINK_ONLY.
> I'd really like to track down why this is happening.  Answering the question
> above about what's in /usr/local/lib is a start, but also the output of
> the configure process, and possible the config.log file from the libvorbis
> package would be nice.

Please note that I successfuly was able to use both the packaged
vorbis-tools (prior version that I helped package) and the special
modified versions I had installed at the same time (and they were built
with their own includes and used their own libraries). I expect that I
should still be able to have the same software installed twice and both be
usable.

Here is the configure output:
-=-=-=-=-
===> Configuring for libvorbis-1.0.0.6
Linking libogg files into /usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink.
creating cache ./config.cache
checking for a BSD compatible install... /usr/bin/install -c -o root -g
wheel
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... found
checking for gcc... cc
checking whether the C compiler (cc
-I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include -O2
-L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib
-Wl,-R/usr/pkg/lib) works... yes
checking whether the C compiler (cc
-I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include -O2
-L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib
-Wl,-R/usr/pkg/lib) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether cc accepts -g... yes
checking how to run the C preprocessor... cc -E
checking host system type... i386--netbsd
checking build system type... i386--netbsd
checking for ranlib... ranlib
checking for ld used by GCC... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
updating cache ./config.cache
loading cache ./config.cache
checking host system type... i386--netbsd
checking for memory.h... yes
checking for cos in -lm... yes
checking for pthread_create in -lpthread... no
checking for Ogg... yes
checking for working alloca.h... no
checking for alloca... yes
checking for 8-bit clean memcmp... yes
checking for sqrtf... yes
checking for logf... yes
checking for expf... yes
checking for acosf... yes
checking for atanf... yes
checking for frexpf... yes
checking for rintf... yes
updating cache ./config.cache
creating ./config.status
creating Makefile
creating lib/Makefile
creating lib/modes/Makefile
creating lib/books/Makefile
creating doc/Makefile
creating doc/vorbisfile/Makefile
creating doc/vorbisenc/Makefile
creating include/Makefile
creating include/vorbis/Makefile
creating examples/Makefile
creating win32/Makefile
creating debian/Makefile
creating vq/Makefile
 -=-=-=-=-

Here is the config.log
(pkgsrc/audio/libvorbis/work/libvorbis-1.0rc2/config.log):
-=-=-=-=-=-=-
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

configure:570: checking for a BSD compatible install
configure:623: checking whether build environment is sane
configure:680: checking whether make sets ${MAKE}
configure:726: checking for working aclocal
configure:739: checking for working autoconf
configure:752: checking for working automake
configure:765: checking for working autoheader
configure:778: checking for working makeinfo
configure:817: checking for gcc
configure:930: checking whether the C compiler (cc -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include -O2 -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib) works
configure:946: cc -o conftest -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include -O2 -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include  -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib conftest.c  1>&5
configure:972: checking whether the C compiler (cc -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include -O2 -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib) is a cross-compiler
configure:977: checking whether we are using GNU C
configure:986: cc -E conftest.c
configure:1005: checking whether cc accepts -g
configure:1037: checking how to run the C preprocessor
configure:1058: cc -E -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include  conftest.c >/dev/null 2>conftest.out
configure:1194: checking host system type
configure:1215: checking build system type
configure:1235: checking for ranlib
configure:1274: checking for ld used by GCC
configure:1336: checking if the linker (/usr/bin/ld) is GNU ld
GNU ld version 2.9.1 (with BFD 2.9.1)
configure:1352: checking for BSD-compatible nm
configure:1388: checking whether ln -s works
configure:1586: checking host system type
configure:1727: checking for memory.h
configure:1737: cc -E -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include  conftest.c >/dev/null 2>conftest.out
configure:1764: checking for cos in -lm
configure:1783: cc -o conftest -O20 -D__NO_MATH_INLINES -fsigned-char -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include -O2 -DUSE_MEMORY_H -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include  -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib conftest.c -lm   1>&5
configure:1776: warning: conflicting types for built-in function `cos'
configure:1805: checking for pthread_create in -lpthread
configure:1824: cc -o conftest -O20 -D__NO_MATH_INLINES -fsigned-char -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include -O2 -DUSE_MEMORY_H -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include  -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib conftest.c -lpthread  -lm 1>&5
/usr/bin/ld: cannot open -lpthread: No such file or directory
collect2: ld returned 1 exit status
configure: failed program was:
#line 1813 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char pthread_create();

int main() {
pthread_create()
; return 0; }
configure:1876: checking for Ogg
configure:1906: cc -o conftest -O20 -D__NO_MATH_INLINES -fsigned-char -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include -O2 -DUSE_MEMORY_H -I/include -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include  -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib conftest.c -lm -L/lib -logg 1>&5
configure:1981: checking for working alloca.h
configure:1993: cc -o conftest -O20 -D__NO_MATH_INLINES -fsigned-char -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include -O2 -DUSE_MEMORY_H -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include  -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib conftest.c -lm -L/lib -logg 1>&5
configure:1987: alloca.h: No such file or directory
configure: failed program was:
#line 1986 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
configure:2014: checking for alloca
configure:2047: cc -o conftest -O20 -D__NO_MATH_INLINES -fsigned-char -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include -O2 -DUSE_MEMORY_H -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include  -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib conftest.c -lm -L/lib -logg 1>&5
configure:2213: checking for 8-bit clean memcmp
configure:2231: cc -o conftest -O20 -D__NO_MATH_INLINES -fsigned-char -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include -O2 -DUSE_MEMORY_H -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include  -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib conftest.c -lm -L/lib -logg 1>&5
configure:2252: checking for sqrtf
configure:2280: cc -o conftest -O20 -D__NO_MATH_INLINES -fsigned-char -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include -O2 -DUSE_MEMORY_H -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include  -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib conftest.c -lm -L/lib -logg 1>&5
configure:2264: warning: conflicting types for built-in function `sqrtf'
configure:2307: checking for logf
configure:2335: cc -o conftest -O20 -D__NO_MATH_INLINES -fsigned-char -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include -O2 -DUSE_MEMORY_H -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include  -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib conftest.c -lm -L/lib -logg 1>&5
configure:2362: checking for expf
configure:2390: cc -o conftest -O20 -D__NO_MATH_INLINES -fsigned-char -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include -O2 -DUSE_MEMORY_H -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include  -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib conftest.c -lm -L/lib -logg 1>&5
configure:2417: checking for acosf
configure:2445: cc -o conftest -O20 -D__NO_MATH_INLINES -fsigned-char -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include -O2 -DUSE_MEMORY_H -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include  -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib conftest.c -lm -L/lib -logg 1>&5
configure:2472: checking for atanf
configure:2500: cc -o conftest -O20 -D__NO_MATH_INLINES -fsigned-char -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include -O2 -DUSE_MEMORY_H -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include  -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib conftest.c -lm -L/lib -logg 1>&5
configure:2527: checking for frexpf
configure:2555: cc -o conftest -O20 -D__NO_MATH_INLINES -fsigned-char -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include -O2 -DUSE_MEMORY_H -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include  -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib conftest.c -lm -L/lib -logg 1>&5
configure:2582: checking for rintf
configure:2610: cc -o conftest -O20 -D__NO_MATH_INLINES -fsigned-char -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include -O2 -DUSE_MEMORY_H -I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include  -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib  -Wl,-R/usr/pkg/lib -Wl,-R/usr/pkg/lib conftest.c -lm -L/lib -logg 1>&5
-=-=-=-=-=--=

Thanks for helping with this. (I don't know anything about buildlink; feel
free to point me at some documentation.)

   Jeremy C. Reed
   http://www.reedmedia.net/