OpenCV 2.4.6 (from ROS released tar) fails to compile on OS X 10.8 (Bug #3289)
Description
I am building all of the latest ROS hydro packages from source on OS X 10.8.5, and when I get to opencv2 I get this:
==> Processing plain cmake package: 'opencv2' ==> Building with env: '/Users/william/hydro/new_install/env.sh' Makefile exists, skipping explicit cmake invocation... ==> make cmake_check_build_system in '/Users/william/hydro/build_isolated/opencv2' ==> make -j1 in '/Users/william/hydro/build_isolated/opencv2' [ 2%] Built target zlib [ 6%] Built target libtiff [ 10%] Built target libjpeg [ 13%] Built target libjasper [ 14%] Built target libpng [ 20%] Built target IlmImf [ 22%] Built target opencv_core [ 25%] Built target opencv_imgproc [ 27%] Built target opencv_highgui [ 27%] Built target opencv_flann [ 29%] Built target opencv_features2d [ 29%] Built target opencv_ts [ 29%] Building CXX object modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_main.cpp.o /Users/william/hydro/src/opencv2/modules/core/perf/perf_main.cpp:3:1: error: multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced] CV_PERF_TEST_MAIN(core) ^~~~~~~~~~~~~~~~~~~~~~~ /Users/william/hydro/src/opencv2/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5: note: expanded from macro 'CV_PERF_TEST_MAIN' CV_PERF_TEST_MAIN_INTERNALS(modulename, plain_only, __VA_ARGS__)\ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/william/hydro/src/opencv2/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12: note: expanded from macro 'CV_PERF_TEST_MAIN_INTERNALS' while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construction is needed for VS 2005*/\ ^ ~~ 1 error generated. make[2]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_main.cpp.o] Error 1 make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2 make: *** [all] Error 2
The version of OpenCV is listed as 2.4.6-1 (where the -1 is the release increment number for the ROS packaging. This is the location of this code:
https://github.com/ros-gbp/opencv2-release/tree/release/hydro/opencv2/2.4.6-1
It looks like the `-Werror` is elevating a warning from clang to an error.
Here is a `VERBOSE=1` output of the failing build command:
[ 29%] Building CXX object modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_main.cpp.o cd /Users/william/hydro/build_isolated/opencv2/modules/core && /usr/bin/c++ -DCVAPI_EXPORTS -DHAVE_ALLOCA -DHAVE_ALLOCA_H -DHAVE_CVCONFIG_H -DHAVE_LIBPTHREAD -DHAVE_UNISTD_H -fsigned-char -W -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -O3 -DNDEBUG -DNDEBUG -I/Users/william/hydro/src/opencv2/modules/core/perf -I/Users/william/hydro/src/opencv2/modules/features2d/include -I/Users/william/hydro/src/opencv2/modules/highgui/include -I/Users/william/hydro/src/opencv2/modules/flann/include -I/Users/william/hydro/src/opencv2/modules/imgproc/include -I/Users/william/hydro/src/opencv2/modules/core/include -I/Users/william/hydro/src/opencv2/modules/ts/include -I/Users/william/hydro/build_isolated/opencv2/modules/core -I/Users/william/hydro/src/opencv2/modules/core/src -I/Users/william/hydro/src/opencv2/modules/core/test -I/Users/william/hydro/build_isolated/opencv2/3rdparty/zlib -I/Users/william/hydro/src/opencv2/3rdparty/zlib -I/Users/william/hydro/build_isolated/opencv2 -isystem /usr/local/include -isystem /usr/local/include/eigen3 -o CMakeFiles/opencv_perf_core.dir/perf/perf_main.cpp.o -c /Users/william/hydro/src/opencv2/modules/core/perf/perf_main.cpp /Users/william/hydro/src/opencv2/modules/core/perf/perf_main.cpp:3:1: error: multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced] CV_PERF_TEST_MAIN(core) ^~~~~~~~~~~~~~~~~~~~~~~ /Users/william/hydro/src/opencv2/modules/ts/include/opencv2/ts/ts_perf.hpp:501:5: note: expanded from macro 'CV_PERF_TEST_MAIN' CV_PERF_TEST_MAIN_INTERNALS(modulename, plain_only, __VA_ARGS__)\ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Users/william/hydro/src/opencv2/modules/ts/include/opencv2/ts/ts_perf.hpp:480:12: note: expanded from macro 'CV_PERF_TEST_MAIN_INTERNALS' while (++argc >= (--argc,-1)) {__VA_ARGS__; break;} /*this ugly construction is needed for VS 2005*/\ ^ ~~ 1 error generated. make[2]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_main.cpp.o] Error 1 make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2 make: *** [all] Error 2
Here is the clang version:
% c++ --version Apple LLVM version 5.0 (clang-500.2.75) (based on LLVM 3.3svn) Target: x86_64-apple-darwin12.5.0 Thread model: posix
I'll be looking into a pull request to fix this.
Related issues
duplicates Bug #3179: Error in ts_perf.hpp Prevents Compilation | Done | 2013-07-28 |
History
Updated by William Woodall over 11 years ago
Looks like the compiler is equating arguments like this: `-Werror=return-type` as just `-Werror`, which is causing the elevation. It might be that these targeted warning elevations are not supported on this version of clang?
Updated by Vladislav Vinogradov over 11 years ago
Hello William,
This bug report is a duplicate for : http://code.opencv.org/issues/3179
And the issue was fixed in : https://github.com/Itseez/opencv/pull/1244
Could you please pull the latest code from repository?
- Status changed from New to Cancelled
- Pull request set to https://github.com/Itseez/opencv/pull/1244