ROS Roboearth Ubuntu 12.04 vision_opencv linking error - opencv

I have tried asking this question on ROS answers with no luck so I am going to try here.
I am trying to compile the ROS Roboearth package and there seem to be some linking errors with vision_opencv.
When I first tried compiling via the instructions provided I was not able to do build because I had old compiler and I did not have Fuerte. So, I upgraded my Ubuntu to 12.04 and updated to ROS Fuerte.
I then realized that 12.04 does not have the required ros-fuerte-vision-opencv2 dependency. So, I compiled and built OpenCV 2.4.3 from source, that went great. I then realized that I am also not able to pull ros-fuerte-vision-opencv which I again got from here, checked out the "fuerte" branch and compiled in /opt/ros/fuerte/stacks/vision_opencv.
Now, when I try to make roboearth via
rosmake roboearth
I get the following linking errors.
Thank you for your help. It may be just my lack of knowledge of C++ but I tried everything from checking dependencies to re-setting the order of compiler flags and dependencies and I just can't seem to get this to work.
[rosmake-1] Starting >>> ar_pose [ make ]
[ rosmake ] Last 40 lines_vision: 30.7 sec ] [ ar_pose: 4.2 sec ] [ 2 Active 47/103 Complete ]
{-------------------------------------------------------------------------------
make[3]: Leaving directory `/home/sasha/ros/stacks/ccny_vision/ar_pose/build'
[ 70%] Built target rosbuild_precompile
make[3]: Entering directory `/home/sasha/ros/stacks/ccny_vision/ar_pose/build'
make[3]: Leaving directory `/home/sasha/ros/stacks/ccny_vision/ar_pose/build'
make[3]: Entering directory `/home/sasha/ros/stacks/ccny_vision/ar_pose/build'
Linking CXX executable ../bin/ar_multi
CMakeFiles/ar_multi.dir/src/ar_multi.o: In function `ar_pose::ARSinglePublisher::arInit()':
/home/sasha/ros/stacks/ccny_vision/ar_pose/src/ar_multi.cpp:140: undefined reference to `cvCreateImage'
CMakeFiles/ar_multi.dir/src/ar_multi.o: In function `CvBridge':
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:67: undefined reference to `cvCreateImageHeader'
CMakeFiles/ar_multi.dir/src/ar_multi.o: In function `~CvBridge':
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:73: undefined reference to `cvReleaseImageHeader'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:78: undefined reference to `cvReleaseImage'
CMakeFiles/ar_multi.dir/src/ar_multi.o: In function `sensor_msgs::CvBridge::reallocIfNeeded_(_IplImage**, CvSize, int, int)':
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:91: undefined reference to `cvReleaseImage'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:97: undefined reference to `cvCreateImage'
CMakeFiles/ar_multi.dir/src/ar_multi.o: In function `sensor_msgs::CvBridge::reallocIfNeeded(_IplImage**, int, int)':
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:109: undefined reference to `cvGetSize'
CMakeFiles/ar_multi.dir/src/ar_multi.o: In function `sensor_msgs::CvBridge::fromImage(sensor_msgs::Image_<std::allocator<void> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:199: undefined reference to `cvInitMatHeader'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:200: undefined reference to `cvGetImage'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:229: undefined reference to `cvCreateMat'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:230: undefined reference to `cvConvertScale'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:236: undefined reference to `cvConvertScale'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:243: undefined reference to `cvCvtColor'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:245: undefined reference to `cvCvtColor'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:247: undefined reference to `cvCvtColor'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:249: undefined reference to `cvCvtColor'
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:253: undefined reference to `cvCvtColor'
CMakeFiles/ar_multi.dir/src/ar_multi.o:/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:255: more undefined references to `cvCvtColor' follow
CMakeFiles/ar_multi.dir/src/ar_multi.o: In function `sensor_msgs::CvBridge::fromImage(sensor_msgs::Image_<std::allocator<void> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
/opt/ros/fuerte/stacks/vision_opencv/cv_bridge/include/cv_bridge/CvBridge.h:293: undefined reference to `cvReleaseMat'
collect2: ld returned 1 exit status
make[3]: *** [../bin/ar_multi] Error 1
make[3]: Leaving directory `/home/sasha/ros/stacks/ccny_vision/ar_pose/build'
make[2]: *** [CMakeFiles/ar_multi.dir/all] Error 2
make[2]: Leaving directory `/home/sasha/ros/stacks/ccny_vision/ar_pose/build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/sasha/ros/stacks/ccny_vision/ar_pose/build'
-------------------------------------------------------------------------------}
[ rosmake ] Output from build of package ar_pose written to:
[ rosmake ] /home/sasha/.ros/rosmake/rosmake_output-20130212-145046/ar_pose/build_output.log
[rosmake-1] Finished <<< ar_pose [FAIL] [ 4.31 seconds ]
[ rosmake ] Halting due to failure in package ar_pose.
[ rosmake ] Waiting for other threads to complete.
[ rosmake ] Last 40 lines_vision: 182.3 sec ] [ 1 Active 47/103 Complete ]
{-------------------------------------------------------------------------------
../lib/libObjectDetectorFunctions.so: undefined reference to `cvReleaseMat'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::Mat::reshape(int, int, int const*) const'
../lib/libObjectDetectorFunctions.so: undefined reference to `cvSetZero'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::warpPerspective(cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&, cv::Size_<int>, int, int, cv::Scalar_<double> const&)'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::getTextSize(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, double, int, int*)'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::Mat::zeros(int, int, int)'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::_InputArray::_InputArray(cv::MatExpr const&)'
../lib/libDVision.so: undefined reference to `cv::read(cv::FileNode const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&)'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::DescriptorMatcher::DescriptorCollection::~DescriptorCollection()'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::FlannBasedMatcher::train()'
../lib/libObjectDetectorFunctions.so: undefined reference to `cvCvtColor'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::MatConstIterator::seek(int const*, bool)'
../lib/libDVision.so: undefined reference to `cv::FeatureDetector::~FeatureDetector()'
../lib/libDUtilsCV.so: undefined reference to `cv::line(cv::Mat&, cv::Point_<int>, cv::Point_<int>, cv::Scalar_<double> const&, int, int, int)'
../lib/libDVision.so: undefined reference to `cv::Exception::Exception(int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::initUndistortRectifyMap(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::Size_<int>, int, cv::_OutputArray const&, cv::_OutputArray const&)'
../lib/libDVision.so: undefined reference to `cv::WriteStructContext::~WriteStructContext()'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::Mat::copySize(cv::Mat const&)'
../lib/libObjectDetectorFunctions.so: undefined reference to `cvCreateImageHeader'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::Mat::inv(int) const'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::Mat::copyTo(cv::_OutputArray const&) const'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::Mat::Mat(cv::Mat const&, cv::Range const&, cv::Range const&)'
../lib/libDVision.so: undefined reference to `cv::operator<<(cv::FileStorage&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::flann::IndexParams::~IndexParams()'
../lib/libObjectDetectorFunctions.so: undefined reference to `cvGetSize'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::Mat::deallocate()'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::_InputArray::_InputArray(double const&)'
../lib/libObjectDetectorFunctions.so: undefined reference to `cvCreateImage'
../lib/libDUtilsCV.so: undefined reference to `cv::namedWindow(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::Algorithm::~Algorithm()'
../lib/libObjectDetectorFunctions.so: undefined reference to `cv::FlannBasedMatcher::FlannBasedMatcher(cv::Ptr<cv::flann::IndexParams> const&, cv::Ptr<cv::flann::SearchParams> const&)'
../lib/libDVision.so: undefined reference to `cv::Algorithm::set(char const*, bool)'
collect2: ld returned 1 exit status
make[3]: *** [../bin/ObjectDetector] Error 1
make[3]: Leaving directory `/home/sasha/ros/stacks/roboearth/re_vision/build'
make[2]: *** [CMakeFiles/ObjectDetector.dir/all] Error 2
make[2]: Leaving directory `/home/sasha/ros/stacks/roboearth/re_vision/build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/sasha/ros/stacks/roboearth/re_vision/build'
-------------------------------------------------------------------------------}
[ rosmake ] Output from build of package re_vision written to:
[ rosmake ] /home/sasha/.ros/rosmake/rosmake_output-20130212-145046/re_vision/build_output.log
[rosmake-0] Finished <<< re_vision [FAIL] [ 182.31 seconds ]
[ rosmake ] Halting due to failure in package re_vision.

Ok so I was able to solve the problem.
First I did sudo apt-get update and I saw that I was getting the following message:
W: Duplicate sources.list entry http://archive.canonical.com/ubuntu/ precise/partner i386 Packages (/var/lib/apt/lists/archive.canonical.com_ubuntu_dists_precise_partner_binary-i386_Packages)
To resolve this I went to `Synaptic Package Manager-> Settings -> Repositories -> Other Software' and unchecked "Canonical Partners - Added by software center".
Then did sudo apt-get update again. This solved the above problem.
Then, I went to the following file /etc/apt/sources.list.d/ros-latest.list and saw that the url was commented out. I uncommented the following line deb http://packages.ros.org/ros/ubuntu precise main and ran sudo apt-get update again.
After this point I was able to install all of the dependencies which are needed for roboearth and via apt-get and was able to successfully make roboearth with rosmake roboearth

Related

Building python bindings - linking of rule failed

When I try to run make -j from https://drake.mit.edu/python_bindings.html#python-bindings-binary, I get this error:
# make -j
[ 12%] Performing build step for 'drake_cxx_python'
INFO: Analyzed target //:install (1 packages loaded, 3 targets configured).
INFO: Found 1 target...
ERROR: /home/dxy/manipulation/drake/examples/kuka_iiwa_arm/BUILD.bazel:125:16: Linking of rule '//examples/kuka_iiwa_arm:kuka_plan_runner' failed (Exit 1): cc failed: error executing command /usr/bin/cc #bazel-out/k8-opt/bin/examples/kuka_iiwa_arm/kuka_plan_runner-2.params
Use --sandbox_debug to see verbose messages from the sandbox cc failed: error executing command /usr/bin/cc #bazel-out/k8-opt/bin/examples/kuka_iiwa_arm/kuka_plan_runner-2.params
Use --sandbox_debug to see verbose messages from the sandbox
bazel-out/k8-opt/bin/multibody/parsing/_objs/parser/parser.pic.o:parser.cc:function drake::multibody::(anonymous namespace)::DetermineFileType(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&): error: undefined reference to 'std::filesystem::__cxx11::path::_M_split_cmpts()'
bazel-out/k8-opt/bin/multibody/parsing/_objs/parser/parser.pic.o:parser.cc:function drake::multibody::(anonymous namespace)::DetermineFileType(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&): error: undefined reference to 'std::filesystem::__cxx11::path::_M_find_extension() const'
bazel-out/k8-opt/bin/multibody/parsing/_objs/parser/parser.pic.o:parser.cc:function drake::multibody::(anonymous namespace)::DetermineFileType(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&): error: undefined reference to 'std::filesystem::__cxx11::path::_M_split_cmpts()'
bazel-out/k8-opt/bin/multibody/parsing/_objs/detail_misc/detail_path_utils.pic.o:detail_path_utils.cc:function std::filesystem::__cxx11::path::operator=(std::filesystem::__cxx11::path&&) [clone .part.222]: error: undefined reference to 'std::filesystem::__cxx11::path::_M_split_cmpts()'
bazel-out/k8-opt/bin/multibody/parsing/_objs/detail_misc/detail_path_utils.pic.o:detail_path_utils.cc:function std::filesystem::__cxx11::path::path<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::filesystem::__cxx11::path>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::filesystem::__cxx11::path::format): error: undefined reference to 'std::filesystem::__cxx11::path::_M_split_cmpts()'
bazel-out/k8-opt/bin/multibody/parsing/_objs/detail_misc/detail_path_utils.pic.o:detail_path_utils.cc:function std::filesystem::__cxx11::path::operator/=(std::filesystem::__cxx11::path const&): error: undefined reference to 'std::filesystem::__cxx11::path::has_root_directory() const'
bazel-out/k8-opt/bin/multibody/parsing/_objs/detail_misc/detail_path_utils.pic.o:detail_path_utils.cc:function std::filesystem::__cxx11::path::operator/=(std::filesystem::__cxx11::path const&): error: undefined reference to 'std::filesystem::__cxx11::path::has_filename() const'
bazel-out/k8-opt/bin/multibody/parsing/_objs/detail_misc/detail_path_utils.pic.o:detail_path_utils.cc:function drake::multibody::internal::GetFullPath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&): error: undefined reference to 'std::filesystem::current_path[abi:cxx11]()'
bazel-out/k8-opt/bin/multibody/parsing/_objs/detail_misc/detail_path_utils.pic.o:detail_path_utils.cc:function drake::multibody::internal::GetFullPath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&): error: undefined reference to 'std::filesystem::__cxx11::path::lexically_normal() const'
bazel-out/k8-opt/bin/multibody/parsing/_objs/detail_misc/detail_path_utils.pic.o:detail_path_utils.cc:function drake::multibody::internal::GetFullPath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&): error: undefined reference to 'std::filesystem::status(std::filesystem::__cxx11::path const&)'
bazel-out/k8-opt/bin/multibody/parsing/_objs/detail_misc/detail_path_utils.pic.o:detail_path_utils.cc:function drake::multibody::internal::GetFullPath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&): error: undefined reference to 'std::filesystem::status(std::filesystem::__cxx11::path const&)'
bazel-out/k8-opt/bin/multibody/parsing/_objs/detail_misc/detail_path_utils.pic.o:detail_path_utils.cc:function drake::multibody::internal::ResolveUri(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, drake::multibody::PackageMap const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&): error: undefined reference to 'std::filesystem::__cxx11::path::lexically_normal() const'
bazel-out/k8-opt/bin/multibody/parsing/_objs/detail_misc/detail_path_utils.pic.o:detail_path_utils.cc:function drake::multibody::internal::ResolveUri(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, drake::multibody::PackageMap const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&): error: undefined reference to 'std::filesystem::status(std::filesystem::__cxx11::path const&)'
bazel-out/k8-opt/bin/multibody/parsing/_objs/detail_misc/detail_path_utils.pic.o:detail_path_utils.cc:function drake::multibody::internal::ResolveUri(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, drake::multibody::PackageMap const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&): error: undefined reference to 'std::filesystem::__cxx11::path::has_root_directory() const'
bazel-out/k8-opt/bin/multibody/parsing/_objs/detail_misc/detail_path_utils.pic.o:detail_path_utils.cc:function drake::multibody::internal::ResolveUri(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, drake::multibody::PackageMap const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&): error: undefined reference to 'std::filesystem::current_path[abi:cxx11]()'
bazel-out/k8-opt/bin/multibody/parsing/_objs/package_map/package_map.pic.o:package_map.cc:function drake::multibody::PackageMap::Add(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&): error: undefined reference to 'std::filesystem::status(std::filesystem::__cxx11::path const&)'
bazel-out/k8-opt/bin/multibody/parsing/_objs/package_map/package_map.pic.o:package_map.cc:function drake::multibody::(anonymous namespace)::GetParentDirectory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&): error: undefined reference to 'std::filesystem::__cxx11::path::parent_path() const'
bazel-out/k8-opt/bin/multibody/parsing/_objs/package_map/package_map.pic.o:package_map.cc:function drake::multibody::PackageMap::PopulateUpstreamToDrakeHelper(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) [clone .localalias.363]: error: undefined reference to 'std::filesystem::__cxx11::path::has_root_directory() const'
bazel-out/k8-opt/bin/multibody/parsing/_objs/package_map/package_map.pic.o:package_map.cc:function drake::multibody::PackageMap::PopulateUpstreamToDrakeHelper(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) [clone .localalias.363]: error: undefined reference to 'std::filesystem::__cxx11::path::has_filename() const'
bazel-out/k8-opt/bin/multibody/parsing/_objs/package_map/package_map.pic.o:package_map.cc:function drake::multibody::PackageMap::PopulateUpstreamToDrake(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&): error: undefined reference to 'std::filesystem::__cxx11::path::_M_find_extension() const'
bazel-out/k8-opt/bin/multibody/parsing/_objs/package_map/package_map.pic.o:package_map.cc:function drake::multibody::PackageMap::PopulateUpstreamToDrake(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&): error: undefined reference to 'std::filesystem::__cxx11::path::parent_path() const'
bazel-out/k8-opt/bin/common/_objs/drake_path/drake_path.pic.o:drake_path.cc:function drake::MaybeGetDrakePath[abi:cxx11](): error: undefined reference to 'std::filesystem::__cxx11::path::parent_path() const'
bazel-out/k8-opt/bin/common/_objs/find_resource/find_loaded_library.pic.o:find_loaded_library.cc:function drake::LoadedLibraryPath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&): error: undefined reference to 'std::filesystem::read_symlink(std::filesystem::__cxx11::path const&)'
bazel-out/k8-opt/bin/common/_objs/find_runfiles/find_runfiles.pic.o:find_runfiles.cc:function drake::(anonymous namespace)::Create(): error: undefined reference to 'std::filesystem::__cxx11::path::lexically_normal() const'
bazel-out/k8-opt/bin/common/_objs/find_runfiles/find_runfiles.pic.o:find_runfiles.cc:function drake::(anonymous namespace)::Create(): error: undefined reference to 'std::filesystem::read_symlink(std::filesystem::__cxx11::path const&)'
collect2: error: ld returned 1 exit status
Target //:install failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 801.493s, Critical Path: 69.97s
INFO: 1333 processes: 20 internal, 1306 linux-sandbox, 7 worker.
FAILED: Build did NOT complete successfully
CMakeFiles/drake_cxx_python.dir/build.make:110: recipe for target 'drake_cxx_python-prefix/src/drake_cxx_python-stamp/drake_cxx_python-build' failed
make[2]: *** [drake_cxx_python-prefix/src/drake_cxx_python-stamp/drake_cxx_python-build] Error 1
CMakeFiles/Makefile2:931: recipe for target 'CMakeFiles/drake_cxx_python.dir/all' failed
make[1]: *** [CMakeFiles/drake_cxx_python.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2
Any suggestions for how to debug would be appreciated. Here is the system information -
Operating system Ubuntu 18.04
Language Python bindings building
C++ compiler GCC 8.4.0
Python version Python 3.6.9
Python distribution pyenv
If building from source:
Build system (Bazel, CMake)
Bazel version:
# which bazel; bazel version
/usr/local/bin/bazel
Bazelisk version: v1.4.0
Build label: 3.7.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Oct 20 13:29:16 2020 (1603200556)
Build timestamp: 1603200556
Build timestamp as int: 1603200556
Bazel C++ compiler:
# bazel run #drake//common:print_host_settings
Starting local Bazel server and connecting to it...
WARNING: ignoring LD_PRELOAD in environment.
INFO: Analyzed target //common:print_host_settings (22 packages loaded, 91 targets configured).
INFO: Found 1 target...
Target //tools/cc_toolchain:print_host_settings up-to-date:
bazel-bin/tools/cc_toolchain/print_host_settings
INFO: Elapsed time: 3.664s, Critical Path: 0.05s
INFO: 5 processes: 4 internal, 1 linux-sandbox.
INFO: Build completed successfully, 5 total actions
INFO: Running command line: bazel-bin/tools/cc_toolchain/print_host_settings tooINFO: Build completed successfully, 5 total actions
++ uname -s
+ [[ Linux == Darwin ]]
+ capture_cc_env=tools/cc_toolchain/capture_cc.env
+ source tools/cc_toolchain/capture_cc.env
++ BAZEL_CC=/usr/bin/gcc
++ BAZEL_CC_FLAGS=
+ [[ ! -z /usr/bin/gcc ]]
++ python3 -c 'import os; print(os.path.realpath("/usr/bin/gcc"))'
+ BAZEL_CC=/usr/bin/x86_64-linux-gnu-gcc-8
+ /usr/bin/x86_64-linux-gnu-gcc-8 --version
x86_64-linux-gnu-gcc-8 (Ubuntu 8.4.0-1ubuntu1~18.04) 8.4.0
Copyright (C) 2018 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.
CMake version:
# which cmake; cmake --version
/usr/bin/cmake
cmake version 3.10.2
CMake C++ compiler
# cmake -LA ./ | grep 'CMAKE_.*_COMPILER'
-- The C compiler identification is GNU 8.4.0
-- The CXX compiler identification is GNU 8.4.0
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Bazel: /usr/local/bin/bazel (found suitable version "3.7.0", minimum required is "2.0")
-- Found PythonInterp: /usr/bin/python3 (found suitable exact version "3.6.9")
-- Found Git: /usr/bin/git (found version "2.17.1")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dxy/manipulation/tmp/drake
-- Cache values
BUILD_TESTING:BOOL=ON
BZRCOMMAND:FILEPATH=BZRCOMMAND-NOTFOUND
Bazel_EXECUTABLE:FILEPATH=/usr/local/bin/bazel
CMAKE_AR:FILEPATH=/usr/bin/ar
CMAKE_BUILD_TYPE:STRING=Release
CMAKE_COLOR_MAKEFILE:BOOL=ON
CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++
CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-8
CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-8
CMAKE_CXX_FLAGS:STRING=
CMAKE_CXX_FLAGS_DEBUG:STRING=-g
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
CMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc
CMAKE_C_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-8
CMAKE_C_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-8
CMAKE_C_FLAGS:STRING=
CMAKE_C_FLAGS_DEBUG:STRING=-g
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF
CMAKE_INSTALL_PREFIX:STRING=/home/dxy/manipulation/tmp/drake/install
CMAKE_LINKER:FILEPATH=/usr/bin/ld
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_NM:FILEPATH=/usr/bin/nm
CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy
CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump
CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib
CMAKE_SHARED_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
CMAKE_SKIP_RPATH:BOOL=NO
CMAKE_STATIC_LINKER_FLAGS:STRING=
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_STRIP:FILEPATH=/usr/bin/strip
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
COVERAGE_COMMAND:FILEPATH=/usr/bin/gcov
COVERAGE_EXTRA_FLAGS:STRING=-l
CPACK_SOURCE_RPM:BOOL=OFF
CPACK_SOURCE_TBZ2:BOOL=ON
CPACK_SOURCE_TGZ:BOOL=ON
CPACK_SOURCE_TXZ:BOOL=ON
CPACK_SOURCE_TZ:BOOL=ON
CPACK_SOURCE_ZIP:BOOL=OFF
CTEST_SUBMIT_RETRY_COUNT:STRING=3
CTEST_SUBMIT_RETRY_DELAY:STRING=5
CVSCOMMAND:FILEPATH=CVSCOMMAND-NOTFOUND
CVS_UPDATE_OPTIONS:STRING=-d -A -P
DART_TESTING_TIMEOUT:STRING=1500
GITCOMMAND:FILEPATH=/usr/bin/git
GIT_EXECUTABLE:FILEPATH=/usr/bin/git
HGCOMMAND:FILEPATH=HGCOMMAND-NOTFOUND
LSB_RELEASE_EXECUTABLE:FILEPATH=/usr/bin/lsb_release
MAKECOMMAND:STRING=/usr/bin/cmake --build . --config "${CTEST_CONFIGURATION_TYPE}"
MEMORYCHECK_COMMAND:FILEPATH=/usr/bin/valgrind
MEMORYCHECK_SUPPRESSIONS_FILE:FILEPATH=
P4COMMAND:FILEPATH=P4COMMAND-NOTFOUND
PYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3
SCPCOMMAND:FILEPATH=/usr/bin/scp
SITE:STRING=dxy-ubuntu
SLURM_SBATCH_COMMAND:FILEPATH=SLURM_SBATCH_COMMAND-NOTFOUND
SLURM_SRUN_COMMAND:FILEPATH=SLURM_SRUN_COMMAND-NOTFOUND
SVNCOMMAND:FILEPATH=SVNCOMMAND-NOTFOUND
WITH_GUROBI:BOOL=OFF
WITH_MOSEK:BOOL=OFF
WITH_ROBOTLOCOMOTION_SNOPT:BOOL=OFF
WITH_SNOPT:BOOL=OFF
Git revision 53d57507e
Looking at https://drake.mit.edu/developers.html#supported-configurations, GCC 7.5 is the supported version for Ubuntu 18.04.
Seeing /usr/bin/gcc show up as "GCC 8.4.0" in the bug report above is unusual. On my system, I have:
$ file /usr/bin/gcc
/usr/bin/gcc: symbolic link to gcc-7
$ gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Per https://github.com/RobotLocomotion/drake/blob/e4209905da25dd54b5e45daf0dc19d3cdad31250/common/filesystem.h#L13 it looks like Drake uses <filesystem> if available, so perhaps GCC 8 is providing that header, but not in a way that Drake is able to correctly link to.
Are you able to use GCC 7.5, instead? That should work fine.

Caffe build fails repeatedly

I am trying to compile the software OpenPose on an Ubuntu 14 machine. The installation script installs Caffe. While installing Caffe, I get the following error message:
CXX tools/upgrade_net_proto_text.cpp
CXX/LD -o .build_release/tools/upgrade_net_proto_text.bin
.build_release/lib/libcaffe.so: undefined reference to `cv::imread(cv::String const&, int)'
.build_release/lib/libcaffe.so: undefined reference to `cv::imencode(cv::String const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)'
.build_release/lib/libcaffe.so: undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/upgrade_net_proto_text.bin] Error 1
From here, I have tried running ldconfig, I use OpenCV 3.2.0, so I have uncommented that in the makefile. I have also tried updating the OpenCV path in ~/.bashrc but I am not sure if I did it correctly. I did:
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
After each of these steps, I ran the install script again but it fails with the same error message (shown above) every time.
I haven't seen anyone so far who successfully installed caffe with openCV 3.2.0,i faced the same problem and what i did was to downgrade to OpenCV 3.1.Another problem that came along was missing modules that are in open_contrib that you should install along opencv,i d refer you to this answer also related to OpenPose here

Linking Issue In opencv_createsamples

I'm setting up opencv 2.4.10 in an NVidia/Cuda:7.5-cudnn4-devel-centos7 Docker container. Running make install works almost to completion, then I get this error:
[ 99%] Built target opencv_haartraining_engine
Linking CXX executable ../../bin/opencv_createsamples
CMakeFiles/opencv_createsamples.dir/createsamples.cpp.o: In function `main':
createsamples.cpp:(.text.startup.main+0x2cb): undefined reference to `JpgDatasetGenerator::JpgDatasetGenerator(char const*)'
createsamples.cpp:(.text.startup.main+0x31f): undefined reference to `DatasetGenerator::create(char const*, int, int, char const*, int, int, int, double, double, double, bool, int, int)'
createsamples.cpp:(.text.startup.main+0x773): undefined reference to `PngDatasetGenerator::PngDatasetGenerator(char const*)'
createsamples.cpp:(.text.startup.main+0x7af): undefined reference to `cvCreateTrainingSamplesFromInfo(char const*, char const*, int, int, int, int)'
createsamples.cpp:(.text.startup.main+0x814): undefined reference to `cvCreateTrainingSamples(char const*, char const*, int, int, char const*, int, int, int, double, double, double, bool, int, int)'
createsamples.cpp:(.text.startup.main+0x857): undefined reference to `cvShowVecSamples(char const*, int, int, double)'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/opencv_createsamples] Error 1
make[1]: *** [apps/haartraining/CMakeFiles/opencv_createsamples.dir/all] Error 2
make: *** [all] Error 2
I am able to get opencv 2.4.10 to work with CUDA 7.0 in CentOS 6, but this issue appears in CentOS 7 with CUDA 7.5.
I'm still unsure why this step was necessary here and not in my CentOS 6/CUDA 7.0 setup; I also find it surprising that this fix was not necessary until so far into the make install process, but the solution was simply
make clean
then
make install

opencv2.4.0 program run with the code g++ `pkg-config --cflags --libs opencv` facedetect.cpp -o opencv

I am very new to OpenCV and I have installed it on Ubuntu. When I try to run the example program facedetect.cpp stored in opencv-2.4.0/samples/c I could not get it to work.
I tried to run it via the following command:
g++ \`pkg-config --cflags --libs opencv\` facedetect.cpp -o opencv
But encountered the following errors:
/tmp/ccKQ8N39.o: In function `main':
facedetect.cpp:(.text+0x1b9): undefined reference to `cv::CascadeClassifier::CascadeClassifier()'
facedetect.cpp:(.text+0x1c7): undefined reference to `cv::CascadeClassifier::CascadeClassifier()'
facedetect.cpp:(.text+0x3ac): undefined reference to `cv::CascadeClassifier::load(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
facedetect.cpp:(.text+0x589): undefined reference to `cv::CascadeClassifier::load(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
facedetect.cpp:(.text+0x674): undefined reference to `cvCreateCameraCapture'
facedetect.cpp:(.text+0x744): undefined reference to `cv::imread(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
facedetect.cpp:(.text+0x799): undefined reference to `cvCreateFileCapture'
facedetect.cpp:(.text+0x824): undefined reference to `cv::imread(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
facedetect.cpp:(.text+0x8b3): undefined reference to `cvNamedWindow'
facedetect.cpp:(.text+0x8f6): undefined reference to `cvQueryFrame'
facedetect.cpp:(.text+0x91c): undefined reference to `cv::Mat::Mat(_IplImage const*, bool)'
facedetect.cpp:(.text+0x97d): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
facedetect.cpp:(.text+0x995): undefined reference to `cv::Mat::copyTo(cv::_OutputArray const&) const'
facedetect.cpp:(.text+0x9af): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
facedetect.cpp:(.text+0x9c7): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
facedetect.cpp:(.text+0x9e7): undefined reference to `cv::flip(cv::_InputArray const&, cv::_OutputArray const&, int)'
facedetect.cpp:(.text+0xa1f): undefined reference to `cv::waitKey(int)'
facedetect.cpp:(.text+0xa3b): undefined reference to `cv::waitKey(int)'
facedetect.cpp:(.text+0xa49): undefined reference to `cvReleaseCapture'
facedetect.cpp:(.text+0xabf): undefined reference to `cv::waitKey(int)'
facedetect.cpp:(.text+0xbfe): undefined reference to `cv::imread(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
facedetect.cpp:(.text+0xc90): undefined reference to `cv::waitKey(int)'
facedetect.cpp:(.text+0xd33): undefined reference to `cvDestroyWindow'
facedetect.cpp:(.text+0xd46): undefined reference to `cv::CascadeClassifier::~CascadeClassifier()'
facedetect.cpp:(.text+0xd54): undefined reference to `cv::CascadeClassifier::~CascadeClassifier()'
facedetect.cpp:(.text+0xeaf): undefined reference to `cv::CascadeClassifier::~CascadeClassifier()'
facedetect.cpp:(.text+0xec1): undefined reference to `cv::CascadeClassifier::~CascadeClassifier()'
/tmp/ccKQ8N39.o: In function `detectAndDraw(cv::Mat&, cv::CascadeClassifier&, cv::CascadeClassifier&, double)':
facedetect.cpp:(.text+0x1278): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
facedetect.cpp:(.text+0x128d): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
facedetect.cpp:(.text+0x12b5): undefined reference to `cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
facedetect.cpp:(.text+0x12e8): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
facedetect.cpp:(.text+0x1300): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
facedetect.cpp:(.text+0x1333): undefined reference to `cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)'
facedetect.cpp:(.text+0x134b): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
facedetect.cpp:(.text+0x1363): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
facedetect.cpp:(.text+0x137b): undefined reference to `cv::equalizeHist(cv::_InputArray const&, cv::_OutputArray const&)'
facedetect.cpp:(.text+0x1380): undefined reference to `cvGetTickCount'
facedetect.cpp:(.text+0x140e): undefined reference to `cvGetTickCount'
facedetect.cpp:(.text+0x142b): undefined reference to `cvGetTickFrequency'
facedetect.cpp:(.text+0x160b): undefined reference to `cv::circle(cv::Mat&, cv::Point_<int>, int, cv::Scalar_<double> const&, int, int, int)'
facedetect.cpp:(.text+0x187e): undefined reference to `cv::circle(cv::Mat&, cv::Point_<int>, int, cv::Scalar_<double> const&, int, int, int)'
facedetect.cpp:(.text+0x1959): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
facedetect.cpp:(.text+0x1993): undefined reference to `cv::imshow(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&)'
/tmp/ccKQ8N39.o: In function `cv::Mat::~Mat()':
facedetect.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x2b): undefined reference to `cv::fastFree(void*)'
/tmp/ccKQ8N39.o: In function `cv::Mat::operator=(cv::Mat const&)':
facedetect.cpp:(.text._ZN2cv3MataSERKS0_[cv::Mat::operator=(cv::Mat const&)]+0xf2): undefined reference to `cv::Mat::copySize(cv::Mat const&)'
/tmp/ccKQ8N39.o: In function `cv::Mat::create(int, int, int)':
facedetect.cpp:(.text._ZN2cv3Mat6createEiii[cv::Mat::create(int, int, int)]+0x81): undefined reference to `cv::Mat::create(int, int const*, int)'
/tmp/ccKQ8N39.o: In function `cv::Mat::release()':
facedetect.cpp:(.text._ZN2cv3Mat7releaseEv[cv::Mat::release()]+0x3b): undefined reference to `cv::Mat::deallocate()'
/tmp/ccKQ8N39.o: In function `cv::Mat::operator()(cv::Rect_<int> const&) const':
facedetect.cpp:(.text._ZNK2cv3MatclERKNS_5Rect_IiEE[cv::Mat::operator()(cv::Rect_<int> const&) const]+0x1b): undefined reference to `cv::Mat::Mat(cv::Mat const&, cv::Rect_<int> const&)'
collect2: ld returned 1 exit status
How can I fix this?
g++ facedetect.cpp -o opencv `pkg-config --cflags --libs opencv`

Sample Program From Terminal Could Not Run

I'm new to opencv in ubuntu. I've follow the tutorial from here for setting up the opencv in linux. However, I have failed to make the sample program runs. After I type the following,
$ g++ DisplayImage.cpp
These error appears,
/tmp/cc3GTOtQ.o: In function `main':
DisplayImage.cpp:(.text+0x53): undefined reference to `cv::imread(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
DisplayImage.cpp:(.text+0xe5): undefined reference to `cv::namedWindow(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
DisplayImage.cpp:(.text+0x113): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
DisplayImage.cpp:(.text+0x147): undefined reference to `cv::imshow(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&)'
DisplayImage.cpp:(.text+0x169): undefined reference to `cv::waitKey(int)'
/tmp/cc3GTOtQ.o: In function `cv::Mat::~Mat()':
DisplayImage.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x39): undefined reference to `cv::fastFree(void*)'
/tmp/cc3GTOtQ.o: In function `cv::Mat::operator=(cv::Mat const&)':
DisplayImage.cpp:(.text._ZN2cv3MataSERKS0_[cv::Mat::operator=(cv::Mat const&)]+0x111): undefined reference to `cv::Mat::copySize(cv::Mat const&)'
/tmp/cc3GTOtQ.o: In function `cv::Mat::release()':
DisplayImage.cpp:(.text._ZN2cv3Mat7releaseEv[cv::Mat::release()]+0x47): undefined reference to `cv::Mat::deallocate()'
collect2: ld returned 1 exit status
Here is the full command line build C++ program with OpenCV Libraries.
g++ -I/usr/local/include/opencv -I/usr/local/include/opencv2 -L/usr/local/lib/ -g -o binaryName main.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_calib3d -lopencv_objdetect -lopencv_contrib -lopencv_legacy
If you installed OpenCV in different location, you should change the path of 'include' and lib 'directory' to appropriate location.
Edit:-
Instead of running this command every time just create a file build.sh in your project directory, change it's permission to executable by running chmod 777 build.sh and for building the project just run this file.
You need to link with the opencv libraries: probably you'll need to add at least -lcv and maybe -lcxcore and -lhighgui to your command line. See this similar question.

Resources