Building ffmpeg - pkgconfig, again

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Building ffmpeg - pkgconfig, again

darkmoon-2
Hi list,

I’ve read questions in the list archives about ffmpeg's build system
reporting that pkg-config could not find this or that external library.
I'm having the same issue: it can't find Opus, Vorbis, Theora,
mp3lame... I've tried prepending 'lib' to ".pc" file names that didn't
have that and other such tricks, but pkg-config isn't having any of it.
I've seen advice to add extra cflags and ldflags that point to the
desired libraries, but they have to be called with an '--enable-'
statement (and pkg-config has to recognize them) or they do not get
built in.

Here is the relevant portion of 'ffbuild/config.log' for Opus. Please
can some experienced person help out with this?

Jeff

require_pkg_config libopus opus opus_multistream.h
opus_multistream_decoder_create
check_pkg_config libopus opus opus_multistream.h
opus_multistream_decoder_create
test_pkg_config libopus opus opus_multistream.h
opus_multistream_decoder_create
pkg-config --exists --print-errors opus
check_func_headers opus_multistream.h opus_multistream_decoder_create
-I/usr/local/include/opus -L/usr/local/lib -lopus
test_ld cc -I/usr/local/include/opus -L/usr/local/lib -lopus
test_cc -I/usr/local/include/opus -L/usr/local/lib
BEGIN /tmp/ffconf.9RG9c4YU/test.c
     1   #include <opus_multistream.h>
     2   #include <stdint.h>
     3   long check_opus_multistream_decoder_create(void) { return
(long) opus_multistream_decoder_create; }
     4   int main(void) { int ret = 0;
     5    ret |= ((intptr_t)check_opus_multistream_decoder_create) & 0xFFFF;
     6   return ret; }
END /tmp/ffconf.9RG9c4YU/test.c
gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -g -O3
-feliminate-unused-debug-types -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fstack-protector --param=ssp-buffer-size=32 -Wformat
-Wformat-security -Wl,--copy-dt-needed-entries -m64
-fasynchronous-unwind-tables -Wp,-D_REENTRANT
-ftree-loop-distribute-patterns -Wl,-z -Wl,now -Wl,-z -Wl,relro
-fno-semantic-interposition -ffat-lto-objects -fno-signed-zeros
-fno-trapping-math -fassociative-math -Wl,-sort-common
-Wl,--enable-new-dtags -std=c11 -fomit-frame-pointer -pthread
-I/usr/include/p11-kit-1 -I/usr/local/include/opus -L/usr/local/lib -c
-o /tmp/ffconf.9RG9c4YU/test.o /tmp/ffconf.9RG9c4YU/test.c
gcc -Wl,--as-needed -Wl,-z,noexecstack -I/usr/local/include/opus
-L/usr/local/lib -o /tmp/ffconf.9RG9c4YU/test
/tmp/ffconf.9RG9c4YU/test.o -lopus
/usr/bin/ld: /usr/local/lib/libopus.a(opus_decoder.o): in function
`opus_decode_frame':
/root/opus/../opus-1.3/src/opus_decoder.c:598: undefined reference to `exp'
/usr/bin/ld: /usr/local/lib/libopus.a(celt_decoder.o): in function
`celt_decode_lost':
/root/opus/../opus-1.3/celt/celt_decoder.c:774: undefined reference to
`sqrtf'
/usr/bin/ld: /root/opus/../opus-1.3/celt/celt_decoder.c:700: undefined
reference to `sqrtf'
/usr/bin/ld: /usr/local/lib/libopus.a(mdct.o): in function `clt_mdct_init':
/root/opus/../opus-1.3/celt/mdct.c:98: undefined reference to `cos'
/usr/bin/ld: /usr/local/lib/libopus.a(modes.o): in function
`opus_custom_mode_create':
/root/opus/../opus-1.3/celt/modes.c:376: undefined reference to `sin'
/usr/bin/ld: /root/opus/../opus-1.3/celt/modes.c:376: undefined
reference to `sin'
/usr/bin/ld: /usr/local/lib/libopus.a(pitch.o): in function
`compute_pitch_gain':
/root/opus/../opus-1.3/celt/pitch.c:426: undefined reference to `sqrtf'
/usr/bin/ld: /root/opus/../opus-1.3/celt/pitch.c:426: undefined
reference to `sqrtf'
/usr/bin/ld: /usr/local/lib/libopus.a(quant_bands.o): in function
`amp2Log2':
/root/opus/../opus-1.3/celt/quant_bands.c:553: undefined reference to `log'
/usr/bin/ld: /usr/local/lib/libopus.a(vq.o): in function `exp_rotation':
/root/opus/../opus-1.3/celt/vq.c:86: undefined reference to `cos'
/usr/bin/ld: /root/opus/../opus-1.3/celt/vq.c:87: undefined reference to
`cos'
/usr/bin/ld: /root/opus/../opus-1.3/celt/vq.c:86: undefined reference to
`cos'
/usr/bin/ld: /root/opus/../opus-1.3/celt/vq.c:87: undefined reference to
`cos'
/usr/bin/ld: /root/opus/../opus-1.3/celt/vq.c:86: undefined reference to
`cos'
/usr/bin/ld:
/usr/local/lib/libopus.a(vq.o):/root/opus/../opus-1.3/celt/vq.c:87: more
undefined references to `cos' follow
/usr/bin/ld: /usr/local/lib/libopus.a(vq.o): in function
`normalise_residual':
/root/opus/../opus-1.3/celt/vq.c:131: undefined reference to `sqrtf'
/usr/bin/ld: /root/opus/../opus-1.3/celt/vq.c:131: undefined reference
to `sqrtf'
/usr/bin/ld: /usr/local/lib/libopus.a(vq.o): in function
`renormalise_vector':
/root/opus/../opus-1.3/celt/vq.c:394: undefined reference to `sqrtf'
/usr/bin/ld: /usr/local/lib/libopus.a(vq.o): in function `stereo_itheta':
/root/opus/../opus-1.3/celt/vq.c:429: undefined reference to `sqrtf'
/usr/bin/ld: /root/opus/../opus-1.3/celt/vq.c:428: undefined reference
to `sqrtf'
/usr/bin/ld:
/usr/local/lib/libopus.a(bands.o):/root/opus/../opus-1.3/celt/bands.c:400:
more undefined references to `sqrtf' follow
/usr/bin/ld: /usr/local/lib/libopus.a(bands.o): in function `quant_band':
/root/opus/../opus-1.3/celt/bands.c:1225: undefined reference to `sqrt'
/usr/bin/ld: /usr/local/lib/libopus.a(bands.o): in function `stereo_merge':
/root/opus/../opus-1.3/celt/bands.c:458: undefined reference to `sqrtf'
/usr/bin/ld: /root/opus/../opus-1.3/celt/bands.c:456: undefined
reference to `sqrtf'
/usr/bin/ld: /usr/local/lib/libopus.a(bands.o): in function
`compute_band_energies':
/root/opus/../opus-1.3/celt/bands.c:169: undefined reference to `sqrtf'
/usr/bin/ld: /usr/local/lib/libopus.a(bands.o): in function
`denormalise_bands':
/root/opus/../opus-1.3/celt/bands.c:230: undefined reference to `exp'
/usr/bin/ld: /usr/local/lib/libopus.a(bands.o): in function `anti_collapse':
/root/opus/../opus-1.3/celt/bands.c:299: undefined reference to `exp'
/usr/bin/ld: /root/opus/../opus-1.3/celt/bands.c:336: undefined
reference to `exp'
/usr/bin/ld: /root/opus/../opus-1.3/celt/bands.c:300: undefined
reference to `sqrt'
/usr/bin/ld: /usr/local/lib/libopus.a(kiss_fft.o): in function
`compute_twiddles':
/root/opus/../opus-1.3/celt/kiss_fft.c:420: undefined reference to `sincos'
/usr/bin/ld: /root/opus/../opus-1.3/celt/kiss_fft.c:420: undefined
reference to `sincos'
collect2: error: ld returned 1 exit status
ERROR: opus not found using pkg-config

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Building ffmpeg - pkgconfig, again

Moritz Barsnick
On Sat, Dec 01, 2018 at 00:01:38 -0800, Jeff wrote:
> Here is the relevant portion of 'ffbuild/config.log' for Opus. Please
> can some experienced person help out with this?

I can tell that the linker flag "-lm" seems to be missing.

You information is a bit sparse. Can you show us your complete
configure command line as well please? And also the content of opus.pc
(I hope you didn't rename it).

Possibly, you only built a static libopus, but pkg-config is being
called for synamic linking (and thereby omits Libs.private).

(A quick workaround may be to add "--extra-ldflags=-lm".)

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Building ffmpeg - pkgconfig, again

darkmoon-2
On Sat, 1 Dec 2018 12:08:36 +0100, Moritz Barsnick <[hidden email]> wrote:

> On Sat, Dec 01, 2018 at 00:01:38 -0800, Jeff wrote:
>> Here is the relevant portion of 'ffbuild/config.log' for Opus. Please
>> can some experienced person help out with this?
> I can tell that the linker flag "-lm" seems to be missing.
>
> You information is a bit sparse. Can you show us your complete
> configure command line as well please?

../ffmpeg/configure --enable-gpl --enable-version3 --disable-podpages
--enable-gnutls
--enable-libx264 --enable-gmp --enable-libopus --enable-libmp3lame
--enable-libtheora
--enable-libvorbis

> And also the content of opus.pc

# Opus codec reference implementation pkg-config file

prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: opus
Description: Opus IETF audio codec (floating-point, custom modes build)
URL: https://opus-codec.org/
Version: 1.3
Requires:
Conflicts:
Libs: -L${libdir} -lopus
Libs.private: -lm
Cflags: -I${includedir}/opus

> (I hope you didn't rename it).

The log I posted was generated on my initial attempt to build, before I
decided to start renaming things. Since I only prepended 'lib', it is
easy enough to restore the original names.

> Possibly, you only built a static libopus,

Yes. I built all libs static only, because I am building only the static
version of ffmpeg. No problem for me to go back and rebuild the libs,
enabling the dynamic builds also.

>   but pkg-config is being
> called for synamic linking (and thereby omits Libs.private).
>
> (A quick workaround may be to add "--extra-ldflags=-lm".)

I can try that. Thank you, Moritz, I seriously appreciate your help.

Jeff
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Building ffmpeg - pkgconfig, again (libmp3lame, this time)

darkmoon-2
On Sat, 1 Dec 2018 04:53:56 -0800, Darkmoon <[hidden email]> wrote:

> On Sat, 1 Dec 2018 12:08:36 +0100, Moritz Barsnick
> <[hidden email]> wrote:
> Possibly, you only built a static libopus,
>
> Yes. I built all libs static only, because I am building only the
> static version of ffmpeg. No problem for me to go back and rebuild the
> libs, enabling the dynamic builds also.
>
>>   but pkg-config is being
>> called for synamic linking (and thereby omits Libs.private).
>>
>> (A quick workaround may be to add "--extra-ldflags=-lm".)
>
> I can try that. Thank you, Moritz, I seriously appreciate your help.
>
> Jeff

Building both the shared and static libraries seemed to do the trick.
Now the challenge is libmp3lame, because that package does not generate
a '.pc' file. I tried creating one by hand, using some of the others as
models, but pkg-config doesn't recognize it. I built both the static and
shared versions of the library, but no such luck. Anyone who has managed
to build libmp3lame into ffmpeg and remembers what worked? I would sure
appreciate it!

Thanks again,

Jeff
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Building ffmpeg - pkgconfig, again

Reino Wijnsma
In reply to this post by darkmoon-2
On 1-12-2018 13:53, [hidden email] wrote:

> On Sat, 1 Dec 2018 12:08:36 +0100, Moritz Barsnick <[hidden email]> wrote:
>> I can tell that the linker flag "-lm" seems to be missing.
>>
>> You information is a bit sparse. Can you show us your complete
>> configure command line as well please?
>
> ../ffmpeg/configure --enable-gpl --enable-version3 --disable-podpages --enable-gnutls
> --enable-libx264 --enable-gmp --enable-libopus --enable-libmp3lame --enable-libtheora
> --enable-libvorbis
>
> [...]
>> Possibly, you only built a static libopus,
>
> Yes. I built all libs static only, because I am building only the static version of ffmpeg.
$ pkg-config --libs opus
-L/cygdrive/[...]/i686-w64-mingw32/lib -lopus

$ pkg-config *--static* --libs opus
-L/cygdrive/[...]/i686-w64-mingw32/lib -lopus *-lm*

That's why I would recommend:
../ffmpeg/configure *--pkg-config-flags=--static* --enable-gpl --enable-version3
--disable-podpages --enable-gnutls --enable-libx264 --enable-gmp --enable-libopus
--enable-libmp3lame --enable-libtheora --enable-libvorbis

-- Reino
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Building ffmpeg - pkgconfig, again (libmp3lame, this time)

Karim SLIMANI-2
In reply to this post by darkmoon-2
Le dim. 2 déc. 2018 à 00:37, <[hidden email]> a écrit :


> Building both the shared and static libraries seemed to do the trick.
> Now the challenge is libmp3lame, because that package does not generate
> a '.pc' file. I tried creating one by hand, using some of the others as
> models, but pkg-config doesn't recognize it. I built both the static and
> shared versions of the library, but no such luck. Anyone who has managed
> to build libmp3lame into ffmpeg and remembers what worked? I would sure
> appreciate it!
>
>
i am not sure it can help you, but take a look at this simple scripts set :
https://github.com/kslimani/ffmpeg-static
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Building ffmpeg - pkgconfig, again (libmp3lame, this time)

Carl Eugen Hoyos-2
In reply to this post by darkmoon-2
2018-12-02 0:37 GMT+01:00, [hidden email] <[hidden email]>:

> Now the challenge is libmp3lame

lame still works without pkgconfig.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Building ffmpeg - pkgconfig, again (libmp3lame, this time)

darkmoon-2
Hi Carl,

On Sun, 2 Dec 2018 03:28:40 +0100, Carl Eugen Hoyos
<[hidden email]> wrote:

> 2018-12-02 0:37 GMT+01:00, [hidden email] <[hidden email]>:
>
>> Now the challenge is libmp3lame
> lame still works without pkgconfig.
>
> Carl Eugen

How to configure it into ffmpeg? I wasn't able to find an answer in the
list archives nor the Trac articles. Please help me out? Thanks,

Jeff
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".