Bug#678222: libav: FTBFS with opencv 2.4

Reinhard Tartler siretart at gmail.com
Thu Jun 21 10:55:43 UTC 2012


reassign 678222 libopencv-dev
tags 678222 -patch
stop

On Wed, Jun 20, 2012 at 3:03 AM, Nobuhiro Iwamatsu <iwamatsu at nigauri.org> wrote:
> Source: libav
> Version: 6:0.8.3-1
> Severity: important
> Tags: patch
>
> Hi,
>
> libav FTBFS with opencv 2.4.
>
> -----
> dpkg-source: info: using source format `3.0 (quilt)'
> dpkg-source: info: building libav using existing ./libav_0.8.3.orig.tar.gz
> dpkg-source: info: building libav in libav_0.8.3-1.debian.tar.gz
> dpkg-source: info: building libav in libav_0.8.3-1.dsc
>  debian/rules build
> Building FLAVORS=static shared
> FLAVORS = static shared
> DEB_BUILD_OPTIONS =
> CFLAGS = -fstack-protector --param=ssp-buffer-size=4 -Wformat
> -Werror=format-security
> CPPFLAGS = -D_FORTIFY_SOURCE=2
> LDFLAGS = -Wl,-z,relro
> dh_testdir
> mkdir -p debian-static
> cd debian-static && CFLAGS="-fstack-protector
> --param=ssp-buffer-size=4 -Wformat -Werror=format-security"
> CPPFLAGS="-D_FORTIFY_SOURCE=2" LDFLAGS="-Wl,-z,relro"
> /tmp/buildd/libav-0.8.3/configure \
>                --extra-version='6:0.8.3-1' --arch='amd64'
> --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --enable-vdpau
> --enable-bzlib --enable-frei0r --enable-gnutls --enable-libcdio
> --enable-libgsm --enable-libopencv --enable-libschroedinger
> --enable-libspeex --enable-libtheora --enable-libvorbis
> --enable-pthreads --enable-zlib --enable-libvpx
> --enable-runtime-cpudetect --enable-libfreetype --enable-libpulse
>  --enable-vaapi  --enable-libopenjpeg     --enable-gpl
> --enable-postproc --enable-swscale --enable-x11grab
> --enable-libdirac       --enable-libmp3lame     --enable-librtmp
>  --enable-libx264        --enable-libxvid --enable-libdc1394
> ERROR: opencv not found
>
> If you think configure made a mistake, make sure you are using the latest
> version from Git.  If the latest version fails, report the problem to the
> libav-user at libav.org mailing list or IRC #libav on irc.freenode.net.
> Include the log file "config.log" produced by configure as this will help
> solving the problem.
> make: *** [configure-stamp-static] Error 1
> -----
>
> The link error of a library link to a "as-needed" option is the cause.
> We can confirm this from config.log.
>
> -----
> gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
> -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -std=c99
> -fomit-frame-pointer -pthread -I/usr/include/opencv
> /usr/lib/libopencv_calib3d.so /usr/lib/libopencv_contrib.so
> /usr/lib/libopencv_core.so /usr/lib/libopencv_features2d.so
> /usr/lib/libopencv_flann.so /usr/lib/libopencv_highgui.so
> /usr/lib/libopencv_imgproc.so /usr/lib/libopencv_legacy.so
> /usr/lib/libopencv_ml.so /usr/lib/libopencv_objdetect.so
> /usr/lib/libopencv_photo.so /usr/lib/libopencv_stitching.so
> /usr/lib/libopencv_ts.so /usr/lib/libopencv_video.so
> /usr/lib/libopencv_videostab.so -c -o /tmp/ffconf.Z0ySe9TX.o
> /tmp/ffconf.0DYRcfsK.c
> gcc: warning: /usr/lib/libopencv_calib3d.so: linker input file unused
> because linking not done
> gcc: warning: /usr/lib/libopencv_contrib.so: linker input file unused
> because linking not done
> gcc: warning: /usr/lib/libopencv_core.so: linker input file unused
> because linking not done
> gcc: warning: /usr/lib/libopencv_features2d.so: linker input file
> unused because linking not done
> gcc: warning: /usr/lib/libopencv_flann.so: linker input file unused
> because linking not done
> gcc: warning: /usr/lib/libopencv_highgui.so: linker input file unused
> because linking not done
> gcc: warning: /usr/lib/libopencv_imgproc.so: linker input file unused
> because linking not done
> gcc: warning: /usr/lib/libopencv_legacy.so: linker input file unused
> because linking not done
> gcc: warning: /usr/lib/libopencv_ml.so: linker input file unused
> because linking not done
> gcc: warning: /usr/lib/libopencv_objdetect.so: linker input file
> unused because linking not done
> gcc: warning: /usr/lib/libopencv_photo.so: linker input file unused
> because linking not done
> gcc: warning: /usr/lib/libopencv_stitching.so: linker input file
> unused because linking not done
> gcc: warning: /usr/lib/libopencv_ts.so: linker input file unused
> because linking not done
> gcc: warning: /usr/lib/libopencv_video.so: linker input file unused
> because linking not done
> gcc: warning: /usr/lib/libopencv_videostab.so: linker input file
> unused because linking not done
> gcc -Wl,--as-needed -I/usr/include/opencv
> /usr/lib/libopencv_calib3d.so /usr/lib/libopencv_contrib.so
> /usr/lib/libopencv_core.so /usr/lib/libopencv_features2d.so
> /usr/lib/libopencv_flann.so /usr/lib/libopencv_highgui.so
> /usr/lib/libopencv_imgproc.so /usr/lib/libopencv_legacy.so
> /usr/lib/libopencv_ml.so /usr/lib/libopencv_objdetect.so
> /usr/lib/libopencv_photo.so /usr/lib/libopencv_stitching.so
> /usr/lib/libopencv_ts.so /usr/lib/libopencv_video.so
> /usr/lib/libopencv_videostab.so -o /tmp/ffconf.XeRtr2AC
> /tmp/ffconf.Z0ySe9TX.o -lm -pthread -lbz2 -lz
> /tmp/ffconf.Z0ySe9TX.o: In function `cvDecRefData':
> ffconf.0DYRcfsK.c:(.text+0xba0): undefined reference to `cvFree_'
> ffconf.0DYRcfsK.c:(.text+0xc37): undefined reference to `cvFree_'
> /tmp/ffconf.Z0ySe9TX.o: In function `cvGetRow':
> ffconf.0DYRcfsK.c:(.text+0xd66): undefined reference to `cvGetRows'
> /tmp/ffconf.Z0ySe9TX.o: In function `cvGetCol':
> ffconf.0DYRcfsK.c:(.text+0xd9a): undefined reference to `cvGetCols'
> /tmp/ffconf.Z0ySe9TX.o: In function `cvReleaseMatND':
> ffconf.0DYRcfsK.c:(.text+0xdb5): undefined reference to `cvReleaseMat'
> /tmp/ffconf.Z0ySe9TX.o: In function `cvSubS':
> ffconf.0DYRcfsK.c:(.text+0xf38): undefined reference to `cvAddS'
> /tmp/ffconf.Z0ySe9TX.o: In function `cvCloneSeq':
> ffconf.0DYRcfsK.c:(.text+0xf72): undefined reference to `cvSeqSlice'
> /tmp/ffconf.Z0ySe9TX.o: In function `cvSetNew':
> ffconf.0DYRcfsK.c:(.text+0xfea): undefined reference to `cvSetAdd'
> /tmp/ffconf.Z0ySe9TX.o: In function `cvGetSetElem':
> ffconf.0DYRcfsK.c:(.text+0x10a1): undefined reference to `cvGetSeqElem'
> /tmp/ffconf.Z0ySe9TX.o: In function `cvEllipseBox':
> ffconf.0DYRcfsK.c:(.text+0x11a7): undefined reference to `cvEllipse'
> /tmp/ffconf.Z0ySe9TX.o: In function `cvFont':
> ffconf.0DYRcfsK.c:(.text+0x11ed): undefined reference to `cvInitFont'
> /tmp/ffconf.Z0ySe9TX.o: In function `cvReadIntByName':
> ffconf.0DYRcfsK.c:(.text+0x12f9): undefined reference to `cvGetFileNodeByName'
> /tmp/ffconf.Z0ySe9TX.o: In function `cvReadRealByName':
> ffconf.0DYRcfsK.c:(.text+0x13bb): undefined reference to `cvGetFileNodeByName'
> /tmp/ffconf.Z0ySe9TX.o: In function `cvReadStringByName':
> ffconf.0DYRcfsK.c:(.text+0x1437): undefined reference to `cvGetFileNodeByName'
> /tmp/ffconf.Z0ySe9TX.o: In function `cvReadByName':
> ffconf.0DYRcfsK.c:(.text+0x147c): undefined reference to `cvGetFileNodeByName'
> ffconf.0DYRcfsK.c:(.text+0x1493): undefined reference to `cvRead'
> /tmp/ffconf.Z0ySe9TX.o: In function `cvContourPerimeter':
> ffconf.0DYRcfsK.c:(.text+0x14c8): undefined reference to `cvArcLength'
> /tmp/ffconf.Z0ySe9TX.o: In function `cvCalcHist':
> ffconf.0DYRcfsK.c:(.text+0x14fd): undefined reference to `cvCalcArrHist'
> /tmp/ffconf.Z0ySe9TX.o: In function `check_cvCreateImageHeader':
> ffconf.0DYRcfsK.c:(.text+0x1623): undefined reference to `cvCreateImageHeader'
> collect2: ld returned 1 exit status
> ERROR: opencv not found
> -----
>
> This problem is corrected when we change the turn of an option.
>
> -----
> gcc -o /tmp/ffconf.koGTUK5J /tmp/ffconf.0BOLaAvA.o
> -I/usr/include/opencv /usr/lib/libopencv_calib3d.so
> /usr/lib/libopencv_contrib.so /usr/lib/libopencv_core.so
> /usr/lib/libopencv_features2d.so /usr/lib/libopencv_flann.so
> /usr/lib/libopencv_highgui.so /usr/lib/libopencv_imgproc.so
> /usr/lib/libopencv_legacy.so /usr/lib/libopencv_ml.so
> /usr/lib/libopencv_objdetect.so /usr/lib/libopencv_photo.so
> /usr/lib/libopencv_stitching.so /usr/lib/libopencv_ts.so
> /usr/lib/libopencv_video.so /usr/lib/libopencv_videostab.so
> -Wl,-z,relro -Wl,--as-needed   -lva -lm -pthread -lbz2 -lz
> -----
>
> I attached a patch which revise this problem.
> Could you check this patch?

The patch is hardly a solution but more a hack to workaround the problem.

The libav configure script uses pkg-config to find the necessary
compiler and linker flags. It seems that the opencv package fails to
pass the correct flags that are necessary to link correctly in this
case. In order to not have to repeat this fix in numerous further
packages, I'm reassigning this bug to the libopencv-dev, which
provides the problematic .pc file that should be fixed instead.

-- 
regards,
    Reinhard





More information about the pkg-multimedia-maintainers mailing list