[GRASS-user] error building recent grass-svn versions

Hi,

for some weeks now, when compiling grass64_release on my debian 64 bit
Squeeze, make encounters errors :

        Errors in:
        /usr/local/src/grass64_release/lib/ogsf
        /usr/local/src/grass64_release/lib/nviz
        /usr/local/src/grass64_release/misc/m.nviz.image
        /usr/local/src/grass64_release/visualization/nviz

Making little use of nviz, it is not an emergency but I'd like to fix it
now. I fear the problem has something to do with avformat libs.
I tried to cd to lib/ogsf, then make clean, then make. The following
error occurs :
        
        In file included from gsd_img_mpeg.c:28:
        /usr/include/libavformat/avformat.h:158: warning: ‘AVMetadata’
        is deprecated
        gsd_img_mpeg.c: In function ‘add_video_stream’:
        gsd_img_mpeg.c:64: warning: assignment makes pointer from
        integer without a cast
        gsd_img_mpeg.c: In function ‘gsd_init_mpeg’:
        gsd_img_mpeg.c:375: error: ‘AVIO_FLAG_WRITE’ undeclared (first
        use in this function)
        gsd_img_mpeg.c:375: error: (Each undeclared identifier is
        reported only once
        gsd_img_mpeg.c:375: error: for each function it appears in.)
        make: *** [OBJ.x86_64-unknown-linux-gnu/gsd_img_mpeg.o] Erreur 1

The current version of libavformat-dev is 5:0.7.15-dmo1

Can anyone help me with this issue ? should I try to force a more recent
version of the lib, or is the problem somewhere else ?

Thank you,
Vincent

Vincent Bain wrote:

        gsd_img_mpeg.c:375: error: ‘AVIO_FLAG_WRITE’ undeclared (first
        use in this function)
        gsd_img_mpeg.c:375: error: (Each undeclared identifier is
        reported only once
        gsd_img_mpeg.c:375: error: for each function it appears in.)
        make: *** [OBJ.x86_64-unknown-linux-gnu/gsd_img_mpeg.o] Erreur 1

The current version of libavformat-dev is 5:0.7.15-dmo1

Can anyone help me with this issue ? should I try to force a more recent
version of the lib, or is the problem somewhere else ?

If you don't need the ability to write video files, don't use
--with-ffmpeg.

Otherwise, you'll need a more recent version of the libraries.

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

Thank you Glynn for your answer, I'll trim my configure command.
If I ever need to output video, what is the minimum version of avcodec
to build against ?

Vincent

Le lundi 04 mars 2013 à 21:20 +0000, Glynn Clements a écrit :

Vincent Bain wrote:

> gsd_img_mpeg.c:375: error: ‘AVIO_FLAG_WRITE’ undeclared (first
> use in this function)
> gsd_img_mpeg.c:375: error: (Each undeclared identifier is
> reported only once
> gsd_img_mpeg.c:375: error: for each function it appears in.)
> make: *** [OBJ.x86_64-unknown-linux-gnu/gsd_img_mpeg.o] Erreur 1
>
> The current version of libavformat-dev is 5:0.7.15-dmo1
>
> Can anyone help me with this issue ? should I try to force a more recent
> version of the lib, or is the problem somewhere else ?

If you don't need the ability to write video files, don't use
--with-ffmpeg.

Otherwise, you'll need a more recent version of the libraries.

Vincent Bain wrote:

Thank you Glynn for your answer, I'll trim my configure command.
If I ever need to output video, what is the minimum version of avcodec
to build against ?

I don't know.

Actually, the OSGF library attempts to support older versions:

  #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 100, 0)
          if (url_fopen(&oc->pb, filename, URL_WRONLY) < 0) {
  #else
    if (avio_open(&oc->pb, filename, AVIO_FLAG_WRITE) < 0) {
  #endif

So it will use the old API for versions of libavformat prior to
52.100.0.

Presumably that version number should be higher; your error message
suggest that you're using a newer version but which doesn't define the
newer macro.

I have no idea how the package versions (e.g. 5:0.7.15-dmo1)
correspond to ffmpeg's internal version numbers. E.g. here I have
ffmpeg-0.10.3, which has:

  Library Version Defined in header

  libavutil 51.35.100 libavutil/avutil.h
  libavformat 53.32.100 libavformat/version.h
  libavcodec 53.61.100 libavcodec/version.h
  libavdevice 53.4.100 libavdevice/avdevice.h
  libavfilter 2.61.100 libavfilter/version.h

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

Perhaps I should downgrade (force older version) ffmpeg, to get in the
first case of the if loop.
Here's the result of ffmpeg --version on my box:

        ffmpeg version 0.7.15, Copyright (c) 2000-2013 the FFmpeg
        developers
          built on Feb 22 2013 07:18:58 with gcc 4.4.5
          configuration: --enable-libdc1394 --prefix=/usr
        --extra-cflags='-Wall -g ' --cc='ccache cc' --enable-shared
        --enable-libmp3lame --enable-gpl --enable-libvorbis
        --enable-pthreads --enable-libfaac --enable-libxvid
        --enable-postproc --enable-x11grab --enable-libgsm
        --enable-libtheora --enable-libopencore-amrnb
        --enable-libopencore-amrwb --enable-libx264 --enable-libspeex
        --enable-nonfree --disable-stripping --enable-avfilter
        --enable-libdirac --disable-decoder=libdirac
        --enable-libfreetype --enable-libschroedinger
        --disable-encoder=libschroedinger --enable-version3
        --enable-libopenjpeg --enable-libvpx --enable-librtmp
        --extra-libs=-lgcrypt --disable-altivec --disable-armv5te
        --disable-armv6 --disable-vis
          libavutil 50. 43. 0 / 50. 43. 0
          libavcodec 52.123. 0 / 52.123. 0
          libavformat 52.111. 0 / 52.111. 0
          libavdevice 52. 5. 0 / 52. 5. 0
          libavfilter 1. 80. 0 / 1. 80. 0
          libswscale 0. 14. 1 / 0. 14. 1
          libpostproc 51. 2. 0 / 51. 2. 0

Vincent.

Le mardi 05 mars 2013 à 13:38 +0000, Glynn Clements a écrit :

Vincent Bain wrote:

> Thank you Glynn for your answer, I'll trim my configure command.
> If I ever need to output video, what is the minimum version of avcodec
> to build against ?

I don't know.

Actually, the OSGF library attempts to support older versions:

  #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 100, 0)
          if (url_fopen(&oc->pb, filename, URL_WRONLY) < 0) {
  #else
    if (avio_open(&oc->pb, filename, AVIO_FLAG_WRITE) < 0) {
  #endif

So it will use the old API for versions of libavformat prior to
52.100.0.

Presumably that version number should be higher; your error message
suggest that you're using a newer version but which doesn't define the
newer macro.

I have no idea how the package versions (e.g. 5:0.7.15-dmo1)
correspond to ffmpeg's internal version numbers. E.g. here I have
ffmpeg-0.10.3, which has:

  Library Version Defined in header

  libavutil 51.35.100 libavutil/avutil.h
  libavformat 53.32.100 libavformat/version.h
  libavcodec 53.61.100 libavcodec/version.h
  libavdevice 53.4.100 libavdevice/avdevice.h
  libavfilter 2.61.100 libavfilter/version.h

[previous discussion deleted]

Just adding to that (old) thread (but still valid):

Recently, the same "osgf" error showed-up in Ubuntu, in both attempts
compiling G64 and G7.

The current

  ffmpeg --version

  ffmpeg version 0.8.6-6:0.8.6-1ubuntu2, Copyright (c) 2000-2013 the Libav
developers built on Mar 30 2013 22:20:06 with gcc 4.7.2
  *** THIS PROGRAM IS DEPRECATED ***
  This program is only provided for compatibility and will be removed in a
future release. Please use avconv instead.
  Missing argument for option '-version'

and

  avconv --version

  avconv version 0.8.6-6:0.8.6-1ubuntu2, Copyright (c) 2000-2013 the Libav
developers built on Mar 30 2013 22:20:06 with gcc 4.7.2
  Missing argument for option '-version'

Nikos