HaroonGhawsi / naclports

Automatically exported from code.google.com/p/naclports
0 stars 0 forks source link

Unable to build OpenCV with FFmpeg enabled #144

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

S1.1. Build ffmpeg in naclports
S1.2. Set the -DWITH_FFMPEG to ON
      in ./naclports/src/ports/opencv/build.sh
S1.3. Start building OpenCV in naclports.
S1.4. FFmpeg support is still OFF when building (see O1)

    PKG_CONFIG_PATH environment variable is empty, should be (for PNaCl):
    /path/to/nacl_sdk/pepper_version/toolchain/linux_pnacl/usr/local/lib/pkgconfig
    Therefore it searches through system pkg-config instead of nacl_sdk one.
    I have set PKG_CONFIG_PATH in /path/to/naclports/src/out/build/opencv/opencv-2.4.7/cmake/OpenCVFindPkgConfig.cmake to written above just to make it compile for PNaCl.

Additionally when above problem is fixed:

S2.1. Start building opencv in naclports (see O2)

    I've managed to fix this problem by adding header guard to glibc-compat/stdlib.h
    Then it compiles correctly.

What is the expected output? What do you see instead?

O1. Expected output:

--   Video I/O:
--     DC1394 1.x:                  NO
--     DC1394 2.x:                  NO
--     FFMPEG:                      YES
--       codec:                     YES (ver 55.39.101)
--       format:                    YES (ver 55.19.104)
--       util:                      YES (ver 52.48.101)
--       swscale:                   YES (ver 2.5.101)
--       gentoo-style:              YES
--     GStreamer:                   NO
--     OpenNI:                      NO
--     OpenNI PrimeSensor Modules:  NO
--     PvAPI:                       NO
--     GigEVisionSDK:               NO
--     UniCap:                      NO
--     UniCap ucil:                 NO
--     V4L/V4L2:                    NO/NO
--     XIMEA:                       NO
--     Xine:                        NO

Actual output:

--   Video I/O:
--     DC1394 1.x:                  NO
--     DC1394 2.x:                  NO
--     FFMPEG:                      NO
--       codec:                     NO
--       format:                    NO
--       util:                      NO
--       swscale:                   NO
--       gentoo-style:              YES
--     GStreamer:                   NO
--     OpenNI:                      NO
--     OpenNI PrimeSensor Modules:  NO
--     PvAPI:                       NO
--     GigEVisionSDK:               NO
--     UniCap:                      NO
--     UniCap ucil:                 NO
--     V4L/V4L2:                    NO/NO
--     XIMEA:                       NO
--     Xine:                        NO

O2. Expected output:

Build complete 'opencv' [pnacl/newlib/release] [took 9m]
Installing 'opencv' [pnacl/newlib/release]

Actual output:

Scanning dependencies of target opencv_highgui
[ 27%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap.cpp.o
[ 27%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_images.cpp.o
[ 27%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.cpp.o
In file included from /path/to/naclports/src/out/build/opencv/opencv-2.4.7/modules/highgui/src/cap_ffmpeg.cpp:45:
In file included from /path/to/naclports/src/out/build/opencv/opencv-2.4.7/modules/highgui/src/cap_ffmpeg_impl.hpp:60:
In file included from /path/to/naclports/src/out/build/opencv/opencv-2.4.7/modules/highgui/src/ffmpeg_codecs.hpp:81:
In file included from /path/to/nacl_sdk/pepper_canary/toolchain/linux_pnacl/usr/local/include/libavformat/avformat.h:203:
In file included from /path/to/nacl_sdk/pepper_canary/toolchain/linux_pnacl/usr/local/include/libavcodec/avcodec.h:31:
In file included from /path/to/nacl_sdk/pepper_canary/toolchain/linux_pnacl/usr/local/include/libavutil/samplefmt.h:24:
In file included from /path/to/nacl_sdk/pepper_canary/toolchain/linux_pnacl/usr/local/include/libavutil/avutil.h:277:
In file included from /path/to/nacl_sdk/pepper_canary/toolchain/linux_pnacl/usr/local/include/libavutil/common.h:34:
/path/to/nacl_sdk/pepper_canary/toolchain/linux_pnacl/usr/local/include/glibc-compat/stdlib.h:3:13: error: declaration of 'qsort_r' has a different language linkage
extern void qsort_r(void *base, size_t nmemb, size_t size,
            ^
/path/to/nacl_sdk/pepper_canary/toolchain/linux_pnacl/usr/local/include/glibc-compat/stdlib.h:3:13: note: previous declaration is here
extern void qsort_r(void *base, size_t nmemb, size_t size,
            ^
1 error generated.
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.cpp.o] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make: *** [all] Error 2
naclports: Building opencv: failed.
Unable to build package: opencv
NaCl ports failed to build, aborting
What version of the product are you using? On what operating system?

- Native Client Tools Bundle versions: 35, 39
- PNaCl toolchain
- Ubuntu 14.04 LTS (GNU/Linux 3.13.0-30-generic x86_64)

Please provide any additional information below. /path/to/ used to make file localizations shorter.


Original issue reported on code.google.com by `darthven...@gmail.com` on 30 Sep 2014 at 1:04