View Single Post
  #1   (View Single Post)  
Old 29th April 2013
bsdnotbdsm bsdnotbdsm is offline
Port Guard
 
Join Date: Jan 2013
Posts: 30
Default Fail to upgrade opencv on FreeBSD 8.3-RELEASE

Hello,
My system details:
Code:
[root@fbsd8-laptop ~]# uname -a
FreeBSD fbsd8-laptop 8.3-RELEASE-p3 FreeBSD 8.3-RELEASE-p3 #0: Tue Jun 12 00:39:29 UTC 2012     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
[root@fbsd8-laptop ~]# which gcc
/usr/bin/gcc
[root@fbsd8-laptop ~]# which ld
/usr/bin/ld
[root@fbsd8-laptop ~]# gcc --version
gcc (GCC) 4.2.2 20070831 prerelease [FreeBSD]
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@fbsd8-laptop ~]# ld --version
GNU ld version 2.15 [FreeBSD] 2004-05-23
Copyright 2002 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.

When I try to upgrade opencv (either using portmaster or cd /path/to/port && make build && make install), I get this error:

Code:
Scanning dependencies of target opencv_test_highgui
[ 28%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_main.o
[ 29%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_video_io.o
/usr/local/portswrkdir/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/highgui/test/test_video_io.cpp: In member function 'void CV_HighGuiTest::VideoTest(const string&, int)':
/usr/local/portswrkdir/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/highgui/test/test_video_io.cpp:173:9: warning: variable 'counter' set but not used [-Wunused-but-set-variable]
[ 29%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_gui.o
[ 29%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_precomp.o
[ 29%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_drawing.o
[ 30%] Building CXX object modules/highgui/CMakeFiles/opencv_test_highgui.dir/test/test_ffmpeg.o
/usr/local/portswrkdir/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/highgui/test/test_ffmpeg.cpp: In member function 'virtual void CV_FFmpegWriteSequenceImageTest::run(int)':
/usr/local/portswrkdir/usr/ports/graphics/opencv/work/OpenCV-2.3.1/modules/highgui/test/test_ffmpeg.cpp:125:10: warning: variable 'frame_s' set but not used [-Wunused-but-set-variable]
Linking CXX executable ../../bin/opencv_test_highgui
/usr/local/bin/ld: CMakeFiles/opencv_test_highgui.dir/test/test_drawing.o: undefined reference to symbol 'cv::rectangle(cv::Mat&, cv::Point_<int>, cv::Point_<int>, cv::Scalar_<double> const&, int, int, int)'
/usr/local/bin/ld: note: 'cv::rectangle(cv::Mat&, cv::Point_<int>, cv::Point_<int>, cv::Scalar_<double> const&, int, int, int)' is defined in DSO /usr/local/lib/libopencv_core.so.2 so try adding it to the linker command line
/usr/local/lib/libopencv_core.so.2: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
*** Error code 1

Stop in /usr/local/portswrkdir/usr/ports/graphics/opencv/work/OpenCV-2.3.1.
*** Error code 1

Stop in /usr/local/portswrkdir/usr/ports/graphics/opencv/work/OpenCV-2.3.1.
*** Error code 1

Stop in /usr/local/portswrkdir/usr/ports/graphics/opencv/work/OpenCV-2.3.1.
*** Error code 1

Stop in /usr/ports/graphics/opencv.
*** Error code 1

Stop in /usr/ports/graphics/opencv.

I read several posts which recommended to re-build opencv-core port, I get this when I try to do it:
Code:
[root@fbsd8-laptop /usr/ports/graphics/opencv-core]# make clean
===>  Cleaning for opencv-core-2.3.1_7
[root@fbsd8-laptop /usr/ports/graphics/opencv-core]# make build
===> No options to configure
===>  License BSD accepted by the user
===> Fetching all distfiles required by opencv-core-2.3.1_7 for building
===>  Extracting for opencv-core-2.3.1_7
=> SHA256 Checksum OK for OpenCV-2.3.1a.tar.bz2.
===>  Patching for opencv-core-2.3.1_7
===>  Applying extra patch /usr/ports/graphics/opencv-core/../opencv/files/extra-patch-opencv-core
===>  Applying FreeBSD patches for opencv-core-2.3.1_7
===>   opencv-core-2.3.1_7 depends on file: /usr/local/bin/cmake - found
===>   opencv-core-2.3.1_7 depends on executable: pkgconf - found
===>  Configuring for opencv-core-2.3.1_7
===>  Performing in-source build
/bin/mkdir -p /usr/local/portswrkdir/usr/ports/graphics/opencv-core/work/OpenCV-2.3.1
/libexec/ld-elf.so.1: /usr/lib/libstdc++.so.6: version GLIBCXX_3.4.11 required by /usr/local/bin/cmake not found
*** Error code 1

Stop in /usr/ports/graphics/opencv-core.
*** Error code 1

Stop in /usr/ports/graphics/opencv-core.

IMPORTANT NOTE: I also have gcc4.6 installed from ports:
Code:
[root@fbsd8-laptop /usr/ports/graphics/opencv-core]# /usr/local/bin/gcc46 --version
gcc46 (FreeBSD Ports Collection) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
With gcc46 in place (after I apply http://www.freebsd.org/doc/en/articl...c/article.html), the opencv-core builds OK, but opencv fails to build, with the same error as the one posted here (using gcc 4.2.2).

Currently I'm using gcc 4.2.2.

I can't find recent information in UPDATING file:
Code:
[root@fbsd8-laptop ~]# cat /usr/ports/UPDATING |grep -i -B 1 opencv |head -5
20110822:
  AFFECTS: users of graphics/opencv
--

  OpenCV python module was moved to own port: graphics/py-opencv
This build error annoys me for several days, I updated ports tree at least three times since problem started, last time I updated it about 3 hours ago. Nothing changes as far as opencv is concerned.

Does anyone have similar problems building opencv / opencv-core 2.3.1_7 ?

Any advice on solving this problem is more than welcomed.
Thank you in advance.
Reply With Quote