[GRASS-dev] grass not building against new ffmpeg

Hi there,

I'm having problems building grass against the new ffmpeg 0.11.1.
configure stops with the error message:
****************************************************************
checking for location of FFMPEG includes... /usr/include/libavcodec /usr/include/libavdevice /usr/include/libavformat /usr/include/libavutil /usr/include/libpostproc /usr/include/libswscale
checking for avcodec.h... yes
checking for avformat.h... yes
checking for swscale.h... yes
checking for location of FFMPEG library...
checking for av_free in -lavutil... yes
checking for avcodec_init in -lavcodec... no
configure: error: *** Unable to locate FFMPEG library.
****************************************************************

When trying to call autoreconf first, I am getting:
****************************************************************
+ autoreconf -fi
autoheader: warning: missing template: CURSES_MAXY
autoheader: Use AC_DEFINE([CURSES_MAXY], , [Description])
autoheader: warning: missing template: HAVE_FFMPEG
autoheader: warning: missing template: HAVE_GDAL
autoheader: warning: missing template: HAVE_GEOS
autoheader: warning: missing template: HAVE_KEYPAD
autoheader: warning: missing template: HAVE_LARGEFILES
autoheader: warning: missing template: HAVE_LIBATLAS
autoheader: warning: missing template: HAVE_LIBBLAS
autoheader: warning: missing template: HAVE_LIBLAPACK
autoheader: warning: missing template: HAVE_LONG_LONG_INT
autoheader: warning: missing template: HAVE_OGR
autoheader: warning: missing template: HAVE_PBUFFERS
autoheader: warning: missing template: HAVE_PIXMAPS
autoheader: warning: missing template: HAVE_POSTGRES
autoheader: warning: missing template: HAVE_PQCMDTUPLES
autoheader: warning: missing template: HAVE_SOCKET
autoheader: warning: missing template: HAVE_SQLITE
autoheader: warning: missing template: HAVE_TCLTK
autoheader: warning: missing template: OPENGL_AQUA
autoheader: warning: missing template: OPENGL_WINDOWS
autoheader: warning: missing template: OPENGL_X11
autoheader: warning: missing template: PEEK_XCLOSEIM
autoheader: warning: missing template: STATIC_BUILD
autoheader: warning: missing template: USE_DELTA_FOR_TZ
autoheader: warning: missing template: USE_NLS
autoheader: warning: missing template: _OE_SOCKETS
autoheader: warning: missing template: _POSIX_PTHREAD_SEMANTICS
autoheader: warning: missing template: _REENTRANT
autoheader: warning: missing template: _XOPEN_SOURCE
autoheader: warning: missing template: _XOPEN_SOURCE_EXTENDED
autoreconf: /usr/bin/autoheader failed with exit status: 1
error: Bad exit status from /home/rpmbuild/grass/BUILDROOT/rpm-tmp.uyyNPI (%build)
****************************************************************

FYI: configure is called with the following options:
****************************************************************
+ ./configure --build=x86_64-mageia-linux-gnu --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/lib64 --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --x-includes=/usr/include --x-libraries=/usr/lib64 --host=x86_64-mageia-linux-gnu --enable-64bit --with-dbm-includes=/usr/include/gdbm/ --with-postgres --with-postgres-includes=/usr/include/ --with-freetype --with-freetype-includes=/usr/include/freetype2 --with-motif --with-cairo --with-opengl-libs=/usr/lib64 --with-motif-libs=/usr/lib64 --with-motif-libs=/usr/lib64 --with-motif-includes=/usr/include --with-gdal --with-mysql --with-mysql-includes=/usr/include/mysql --with-odbc --enable-largefile --with-ffmpeg '--with-ffmpeg-includes=/usr/include/libavcodec /usr/include/libavdevice /usr/include/libavformat /usr/include/libavutil /usr/include/libpostproc /usr/include/libswscale' --with-curses --with-python --with-wxwidgets=/usr/bin/wx-config --with-sqlite --with-cxx --with-proj-share=/usr/share/proj --with-nls --with-readline
****************************************************************

Thanks for any hints you might give me...

Oliver

On Wed, Jul 18, 2012 at 3:08 PM, Oliver Burger <obgr_seneca@mageia.org> wrote:

Hi there,

I'm having problems building grass against the new ffmpeg 0.11.1.
configure stops with the error message:
****************************************************************
checking for location of FFMPEG includes... /usr/include/libavcodec
/usr/include/libavdevice /usr/include/libavformat
/usr/include/libavutil /usr/include/libpostproc /usr/include/libswscale
checking for avcodec.h... yes
checking for avformat.h... yes
checking for swscale.h... yes
checking for location of FFMPEG library...
checking for av_free in -lavutil... yes
checking for avcodec_init in -lavcodec... no
checking for avcodec_init in -lavcodec... no
configure: error: *** Unable to locate FFMPEG library.

Could you please check (at the end) of config,log for related
errors? In the past we had similar problems due to the
regular changes in the FFMPEG structure. The error
message(s) in config,log might help.

thanks,
Markus

Am 18.07.2012 18:57, schrieb Markus Neteler:

Could you please check (at the end) of config,log for related
errors? In the past we had similar problems due to the
regular changes in the FFMPEG structure. The error
message(s) in config,log might help.

Here you are:

****************************************************************
configure:10717: checking for avcodec_init in -lavcodec
configure:10734: gcc -o conftest -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -Wl,--export-dynamic conftest.c -lavcodec -lavutil 1>&5
/tmp/ccZlG3Jx.o: In function `main':
/home/rpmbuild/grass/BUILD/grass-6.4.2/configure:10730: undefined reference to `avcodec_init'
collect2: error: ld returned 1 exit status
configure: failed program was:
#line 10723 "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 avcodec_init();

int main() {
avcodec_init()
; return 0; }
configure:10753: checking for avcodec_init in -lavcodec
configure:10770: gcc -o conftest -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -Wl,--export-dynamic conftest.c -lavcodec -lavutil -lm 1>&5
/tmp/cca4csZE.o: In function `main':
/home/rpmbuild/grass/BUILD/grass-6.4.2/configure:10766: undefined reference to `avcodec_init'
collect2: error: ld returned 1 exit status
configure: failed program was:
#line 10759 "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 avcodec_init();
****************************************************************

Thanks,

Oliver

P.S.: Resent to list, sorry Markus...

On Thu, Jul 19, 2012 at 8:56 AM, Oliver Burger <obgr_seneca@mageia.org> wrote:

Am 18.07.2012 18:57, schrieb Markus Neteler:

Could you please check (at the end) of config,log for related

errors? In the past we had similar problems due to the
regular changes in the FFMPEG structure. The error
message(s) in config,log might help.

Here you are:

****************************************************************
configure:10717: checking for avcodec_init in -lavcodec
configure:10734: gcc -o conftest -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2
-fstack-protector --param=ssp-buffer-size=4 -Wl,--as-needed
-Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -Wl,--build-id
-Wl,--enable-new-dtags -Wl,--export-dynamic conftest.c -lavcodec -lavutil
1>&5
/tmp/ccZlG3Jx.o: In function `main':
/home/rpmbuild/grass/BUILD/grass-6.4.2/configure:10730: undefined reference
to `avcodec_init'
collect2: error: ld returned 1 exit status
configure: failed program was:
#line 10723 "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 avcodec_init();

int main() {
avcodec_init()
; return 0; }
configure:10753: checking for avcodec_init in -lavcodec
configure:10770: gcc -o conftest -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2
-fstack-protector --param=ssp-buffer-size=4 -Wl,--as-needed
-Wl,--no-undefined -Wl,-z,relro -Wl,-O1 -Wl,--build-id
-Wl,--enable-new-dtags -Wl,--export-dynamic conftest.c -lavcodec -lavutil
-lm 1>&5
/tmp/cca4csZE.o: In function `main':
/home/rpmbuild/grass/BUILD/grass-6.4.2/configure:10766: undefined reference
to `avcodec_init'
collect2: error: ld returned 1 exit status
configure: failed program was:
#line 10759 "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 avcodec_init();
****************************************************************

With a lot of try-and-error I figured it out for FFMPEG 0.10:

  --with-ffmpeg --with-ffmpeg-includes="/usr/include/ffmpeg
/usr/include/ffmpeg/libav* /usr/include/ffmpeg/libpostproc
/usr/include/ffmpeg/libswscale" \

Note that I have additionally /usr/include/ffmpeg inside.

Please let us know if this helps for 0.11,
Markus

Am 19.07.2012 10:22, schrieb Markus Neteler:

With a lot of try-and-error I figured it out for FFMPEG 0.10:

   --with-ffmpeg --with-ffmpeg-includes="/usr/include/ffmpeg
/usr/include/ffmpeg/libav* /usr/include/ffmpeg/libpostproc
/usr/include/ffmpeg/libswscale" \

Note that I have additionally /usr/include/ffmpeg inside.

I tried it using
--with-ffmpeg --with-ffmpeg-includes="/usr/include /usr/include/libav* /usr/include/libpostproc /usr/include/libswscale"
We don't have the ffmpeg headers in a directory of its own, but directly in /usr/include/, that's why I added /usr/include itself.
No change, I still get the same error message.

Oliver

Markus Neteler wrote:

  --with-ffmpeg --with-ffmpeg-includes="/usr/include/ffmpeg
/usr/include/ffmpeg/libav* /usr/include/ffmpeg/libpostproc
/usr/include/ffmpeg/libswscale" \

Note that wildcard expansion is not performed inside quoted strings.

Also, for recent versions of FFMPEG, the #include directive in
gsd_img_mpeg.c:

  #include <avformat.h>

is incorrect. The directories are now part of the header name, so it
should be:

  #include <libavformat/avformat.h>

The directory containing the libav* subdirectories must be in the
include path.

--
Glynn Clements <glynn@gclements.plus.com>

Hi there,

I just found the following on the ffmpeg ml:
http://permalink.gmane.org/gmane.comp.video.ffmpeg.devel/143601

But there seem to be more changes, I'm trying to investigate further...

Oliver