[GRASS-dev] G7 compile error:

Hi,

I just tried to compile the recent G7 SVN but several error appeared:

GRASS GIS 7.0.svn 56779M compilation log

Started compilation: Tue Jun 18 16:23:06 CEST 2013

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

In case of errors please change into the directory with error and run ‘make’.
If you get multiple errors, you need to deal with them in the order they
appear in the error log. If you get an error building a library, you will
also get errors from anything which uses the library.

Finished compilation: Tue Jun 18 16:34:38 CEST 2013
make: *** [default] Error 1

radinger@grassgis:/usr/local/src/grass7_trunk$ cd /usr/local/src/grass7_trunk/lib/ogsf
radinger@grassgis:/usr/local/src/grass7_trunk/lib/ogsf$ make
gcc -g -fPIC -I/usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/include -I/usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdal -I/usr/include -DPACKAGE="“grasslibs”" -I/usr/include/libavcodec -I/usr/include/libavformat -I/usr/include/libswscale -I/usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/include -I/usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/include -o OBJ.i686-pc-linux-gnu/gsd_img_mpeg.o -c gsd_img_mpeg.c
gsd_img_mpeg.c:33:25: fatal error: mathematics.h: No such file or directory
compilation terminated.
make: *** [OBJ.i686-pc-linux-gnu/gsd_img_mpeg.o] Error 1

radinger@grassgis:/usr/local/src/grass7_trunk/lib/ogsf$ cd /usr/local/src/grass7_trunk/lib/nviz/
radinger@grassgis:/usr/local/src/grass7_trunk/lib/nviz$ make
gcc -shared -o /usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/lib/libgrass_nviz.7.0.svn.so -L/usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/lib -L/usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/lib -Wl,–export-dynamic -L/usr/lib -Wl,-rpath-link,/usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/lib OBJ.i686-pc-linux-gnu/change_view.o OBJ.i686-pc-linux-gnu/cplanes_obj.o OBJ.i686-pc-linux-gnu/draw.o OBJ.i686-pc-linux-gnu/exag.o OBJ.i686-pc-linux-gnu/lights.o OBJ.i686-pc-linux-gnu/map_obj.o OBJ.i686-pc-linux-gnu/nviz.o OBJ.i686-pc-linux-gnu/position.o OBJ.i686-pc-linux-gnu/render.o -lgrass_ogsf.7.0.svn -lgrass_gis.7.0.svn -L/usr/include/GL -lGL -lSM -lICE -lX11 -lm
/usr/bin/ld: cannot find -lgrass_ogsf.7.0.svn
collect2: ld returned 1 exit status
make: *** [/usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/lib/libgrass_nviz.7.0.svn.so] Error 1

radinger@grassgis:/usr/local/src/grass7_trunk/lib/nviz$ cd /usr/local/src/grass7_trunk/misc/m.nviz.image/
radinger@grassgis:/usr/local/src/grass7_trunk/misc/m.nviz.image$ make
make: *** No rule to make target /usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/lib/[libgrass_ogsf.7.0.svn.so](http://libgrass_ogsf.7.0.svn.so)', needed by /usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/bin/m.nviz.image’. Stop.

So how do I have to deal with that problems?

/Johannes

On Tue, Jun 18, 2013 at 4:40 PM, Johannes Radinger
<johannesradinger@gmail.com> wrote:

Hi,

I just tried to compile the recent G7 SVN but several error appeared:

GRASS GIS 7.0.svn 56779M compilation log
--------------------------------------------------
Started compilation: Tue Jun 18 16:23:06 CEST 2013
--
Errors in:
/usr/local/src/grass7_trunk/lib/ogsf

...

radinger@grassgis:/usr/local/src/grass7_trunk$ cd
/usr/local/src/grass7_trunk/lib/ogsf
radinger@grassgis:/usr/local/src/grass7_trunk/lib/ogsf$ make
gcc -g -fPIC -I/usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/include
-I/usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdal
-I/usr/include -DPACKAGE=\""grasslibs"\" -I/usr/include/libavcodec
-I/usr/include/libavformat -I/usr/include/libswscale
-I/usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/include
-I/usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/include -o
OBJ.i686-pc-linux-gnu/gsd_img_mpeg.o -c gsd_img_mpeg.c
gsd_img_mpeg.c:33:25: fatal error: mathematics.h: No such file or directory
compilation terminated.

I have that on Fedora 18 in
rpm -qf /usr/include/ffmpeg/libavutil/mathematics.h
ffmpeg-devel-1.0.7-1.fc18.x86_64

Perhaps you need to install a similar package for your distro?
(just guessing)

On F18 it compiles.

Markus

Interestingly the compilation was working some days (maybe already weeks) ago.
I checked ffmpeg and there is a package installed:

ffmpeg version 0.8.6-4:0.8.6-0ubuntu0.12.04.1, Copyright (c) 2000-2013 the Libav developers
built on Apr 2 2013 17:00:59 with gcc 4.6.3
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.

So probably I also need to get the ffmpeg-devel installed. Will check that tomorrow.

BTW: Can GRASS be configured without ffmpeg support? What is it needed for?

/johannes

···

On Tue, Jun 18, 2013 at 5:07 PM, Markus Neteler <neteler@osgeo.org> wrote:

On Tue, Jun 18, 2013 at 4:40 PM, Johannes Radinger
<johannesradinger@gmail.com> wrote:

Hi,

I just tried to compile the recent G7 SVN but several error appeared:

GRASS GIS 7.0.svn 56779M compilation log

Started compilation: Tue Jun 18 16:23:06 CEST 2013

Errors in:
/usr/local/src/grass7_trunk/lib/ogsf

radinger@grassgis:/usr/local/src/grass7_trunk$ cd
/usr/local/src/grass7_trunk/lib/ogsf
radinger@grassgis:/usr/local/src/grass7_trunk/lib/ogsf$ make
gcc -g -fPIC -I/usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/include
-I/usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdal
-I/usr/include -DPACKAGE="“grasslibs”" -I/usr/include/libavcodec
-I/usr/include/libavformat -I/usr/include/libswscale
-I/usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/include
-I/usr/local/src/grass7_trunk/dist.i686-pc-linux-gnu/include -o
OBJ.i686-pc-linux-gnu/gsd_img_mpeg.o -c gsd_img_mpeg.c
gsd_img_mpeg.c:33:25: fatal error: mathematics.h: No such file or directory
compilation terminated.

I have that on Fedora 18 in
rpm -qf /usr/include/ffmpeg/libavutil/mathematics.h
ffmpeg-devel-1.0.7-1.fc18.x86_64

Perhaps you need to install a similar package for your distro?
(just guessing)

On F18 it compiles.

Markus

Johannes Radinger wrote:

I just tried to compile the recent G7 SVN but several error appeared:

GRASS GIS 7.0.svn 56779M compilation log
--------------------------------------------------
Started compilation: Tue Jun 18 16:23:06 CEST 2013
--
Errors in:
/usr/local/src/grass7_trunk/lib/ogsf
/usr/local/src/grass7_trunk/lib/nviz
/usr/local/src/grass7_trunk/misc/m.nviz.image

..

So how do I have to deal with that problems?

Same errors here *before* removing the "--with-ffmpeg" option for the
configuration process. No errors currently (==yesterday). See also ticket
#1423:

<https://trac.osgeo.org/grass/ticket/1423#comment:19&gt;
<https://trac.osgeo.org/grass/ticket/1423#comment:18&gt;

Nikos

Johannes Radinger wrote:

BTW: Can GRASS be configured without ffmpeg support?

FFMPEG support should be disabled by default (i.e. only enabled if you
use --with-ffmpeg).

What is it needed for?

AFAIK, its only use was to allow NVIZ to save fly-throughs as video
files. I don't think that this feature is available in the wxGUI's
NVIZ component, and the original Tcl/Tk NVIZ is no longer present in
7.0. In which case, there's not much point in enabling it.

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

Johannes wrote:

I just tried to compile the recent G7 SVN but several error appeared:

..,

--
Errors in:
/usr/local/src/grass7_trunk/lib/ogsf

...

OBJ.i686-pc-linux-gnu/gsd_img_mpeg.o -c gsd_img_mpeg.c
gsd_img_mpeg.c:33:25: fatal error: mathematics.h: No such file or directory
compilation terminated.

MarkusN:

I have that on Fedora 18 in
rpm -qf /usr/include/ffmpeg/libavutil/mathematics.h
ffmpeg-devel-1.0.7-1.fc18.x86_64

Perhaps you need to install a similar package for your distro?
(just guessing)

Hi,

fwiw the reason ./configure doesn't catch this one is that avutil.h
should be including mathematics.h internally, but for newer versions
(libavutil 51.22.1) it seems to forget that. Since we need av_rescale_q()
from it we conditionally depend on mathematics.h depending on the
libavutil version. I'm hoping it's their bug and that the libavutil
people will fix it before too long.

Hamish

Johannes wrote:

Interestingly the compilation was working some days (maybe already weeks) ago.

Right, the code had been changed by a few people to work
with their local version of libav at the expense of people
using other versions. So in the last week or so I put in a
bunch of conditionals to try and make it work for everyone
using versions from the last year or three. In some cases
that makes it stricter. The reason that distros are abandoning
ffmpeg is that the API changes all the time and it is hard
for the packagers to keep up, so they seem to be transitioning
to a more stable but-compatible fork, and hopefully these
troubles become less.

And yes, for the grass7 code just leave off --with-ffmpeg
since it isn't used in the wxNVIZ currently/yet.

regards,
Hamish

Thanks Hamish for your clarification.

I skipped now the ffmeg support in my compilation and now
the make process runs smoothly. :slight_smile:

cheers,

/johannes

···

On Tue, Jun 18, 2013 at 11:56 PM, Hamish <hamish_b@yahoo.com> wrote:

Johannes wrote:

Interestingly the compilation was working some days (maybe already weeks) ago.

Right, the code had been changed by a few people to work
with their local version of libav at the expense of people
using other versions. So in the last week or so I put in a
bunch of conditionals to try and make it work for everyone
using versions from the last year or three. In some cases
that makes it stricter. The reason that distros are abandoning
ffmpeg is that the API changes all the time and it is hard
for the packagers to keep up, so they seem to be transitioning
to a more stable but-compatible fork, and hopefully these
troubles become less.

And yes, for the grass7 code just leave off --with-ffmpeg
since it isn’t used in the wxNVIZ currently/yet.

regards,
Hamish