OpenPose Library - build release issue - linux

We are trying to install and run a demo for OpenPose Library available on Github :
https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/installation.md#manual-compilation
Done with installing Caffe and all prerequisites, but while performing install command we are getting following errror :
CXX examples/tutorial_wrapper/2_user_synchronous.cpp
AR -o .build_release/lib/libopenpose.a
LD -o .build_release/lib/libopenpose.so.1.0.0-rc3
CXX/LD -o .build_release/examples/tutorial_pose/2_extract_pose_or_heatmat_from_image.bin
.build_release/lib/libopenpose.so: undefined reference to `cv::VideoCapture::VideoCapture(cv::String const&)'
.build_release/lib/libopenpose.so: undefined reference to `cv::VideoCapture::set(int, double)'
.build_release/lib/libopenpose.so: undefined reference to `cv::VideoCapture::release()'
.build_release/lib/libopenpose.so: undefined reference to `cv::VideoCapture::operator>>(cv::Mat&)'
.build_release/lib/libopenpose.so: undefined reference to `cv::VideoWriter::VideoWriter(cv::String const&, int, double, cv::Size_<int>, bool)'
.build_release/lib/libopenpose.so: undefined reference to `cv::VideoCapture::isOpened() const'
.build_release/lib/libopenpose.so: undefined reference to `cv::VideoCapture::get(int) const'
.build_release/lib/libopenpose.so: undefined reference to `cv::VideoCapture::VideoCapture(int)'
.build_release/lib/libopenpose.so: undefined reference to `cv::VideoCapture::~VideoCapture()'
.build_release/lib/libopenpose.so: undefined reference to `vtable for cv::VideoWriter'
collect2: error: ld returned 1 exit status
Makefile:492: recipe for target '.build_release/examples/tutorial_pose/2_extract_pose_or_heatmat_from_image.bin' failed
make: *** [.build_release/examples/tutorial_pose/2_extract_pose_or_heatmat_from_image.bin] Error 1
make: *** Waiting for unfinished jobs....
------------------------- -------------------------
Errors detected. Exiting script. The software might have not been successfully installed.
------------------------- -------------------------
Please help me get rid of this.
Thanks

This could be because libopencv_video and/or libopencv_videoio has not been added to the project. If you build opencv from source, do check whether these libraries have been built.

It looks like you did not check the OpenCV3 flag in both the OpenPose and Caffe makefiles.config files.
E.g., if you are using manual compilation as you indicated, assume you have Ubuntu 16 and CUDA 8. So you need to modify both these files:
https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/Makefile.config.Ubuntu16.example
https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/3rdparty/caffe/Makefile.config.Ubuntu16.example
By uncommenting # OPENCV_VERSION := 3 in both of them.
After that simply run again the command they specify: cp Makefile.config.Ubuntu16.example Makefile.config
And make clean in both OpenPose and Caffe and re-build it again.

Related

How to successfully build jctvc part in libbpg on Linux with mingw-w64 for windows?

I know that I need zlib, libpng, libjpeg-turbo and yasm.
I've successfully built them and correctly installed (hope so), because when I try to "make" libbpg with following config in Makefile:
# Enable compilation of Javascript decoder with Emscripten
#USE_EMCC=y
# Enable x265 for the encoder
USE_X265=y
# Enable the JCTVC code (best quality but slow) for the encoder
USE_JCTVC=y
# Compile bpgview (SDL and SDL_image libraries needed)
#USE_BPGVIEW=y
# Enable it to use bit depths > 12 (need more tests to validate encoder)
USE_JCTVC_HIGH_BIT_DEPTH=y
# Enable the cross compilation for Windows
CONFIG_WIN32=y
# Enable for compilation on MacOS X
#CONFIG_APPLE=y
I didn't see any severe error in my terminal's output when building "bpgdec.exe" and H265 encoder.
However, when it comes to jctvc, I had a BIG error message (most of it is nearly repeating)
......
x86_64-w64-mingw32-g++ -g -Wl,--gc-sections -o bpgenc.exe bpgenc.o x265_glue.o x265.out/8bit/libx265.a x265.out/10bit/libx265.a x265.out/12bit/libx265.a jctvc_glue.o jctvc/libjctvc.a -lpng -ljpeg -lz
/usr/bin/x86_64-w64-mingw32-ld: jctvc/libjctvc.a(TAppEncCfg.o): in function `OptionBase':
(somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:81: undefined reference to `__gxx_personality_sj0'
/usr/bin/x86_64-w64-mingw32-ld: (somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:81: undefined reference to `_Unwind_SjLj_Register'
/usr/bin/x86_64-w64-mingw32-ld: (somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:82: undefined reference to `_Unwind_SjLj_Unregister'
/usr/bin/x86_64-w64-mingw32-ld: jctvc/libjctvc.a(TAppEncCfg.o):/usr/lib/gcc/x86_64-w64-mingw32/8.3-win32/include/c++/ext/new_allocator.h:86: undefined reference to `_Unwind_SjLj_Resume'
/usr/bin/x86_64-w64-mingw32-ld: jctvc/libjctvc.a(TAppEncCfg.o): in function `ParseFailure':
(somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:54: undefined reference to `__gxx_personality_sj0'
/usr/bin/x86_64-w64-mingw32-ld: (somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:54: undefined reference to `_Unwind_SjLj_Register'
/usr/bin/x86_64-w64-mingw32-ld: (somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:55: undefined reference to `_Unwind_SjLj_Unregister'
/usr/bin/x86_64-w64-mingw32-ld: (somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:55: undefined reference to `_Unwind_SjLj_Resume'
/usr/bin/x86_64-w64-mingw32-ld: jctvc/libjctvc.a(TAppEncCfg.o): in function `df::program_options_lite::Option<double>::parse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
(somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:118: undefined reference to `__gxx_personality_sj0'
/usr/bin/x86_64-w64-mingw32-ld: (somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:118: undefined reference to `_Unwind_SjLj_Register'
/usr/bin/x86_64-w64-mingw32-ld: (somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:120: undefined reference to `_Unwind_SjLj_Unregister'
/usr/bin/x86_64-w64-mingw32-ld: (somewhere)/libbpg-0.9.8/jctvc/program_options_lite.h:120: undefined reference to `_Unwind_SjLj_Resume'
/usr/bin/x86_64-w64-mingw32-ld: jctvc/libjctvc.a(TAppEncCfg.o): in function `df::program_options_lite::Option<bool>::parse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
......
collect2: error: ld returned 1 exit status
make: *** [Makefile:197:bpgenc.exe] errorcode 1
(To give an example)
I've noticed that Mingw-w64 on linux is using an gcc version whose Exception Handling is dw2 instead of sjlj, which is required for jctvc according to the output above.
I've tried to move libgcc_s_sjlj_1.dll to /usr/x86_64-w64-mingw32/bin and /usr/x86_64-w64-mingw32/lib, but it doesn't work.
I've known that gcc can be configured to enable sjlj, but this means that I have to modify mingw-w64, which is something I can't dare.
MY ENVIRONMENT:
Freshly installed debian 10, after "apt update&&apt upgrade".
All latest zlib, libjpeg-turbo, libpng, mingw-w64, libbpg source code.
So I'd like to know if anybody know the proper way to compile jctvc in libbpg. Thanks a lot.

ares link errors building Tensorflow from source with bazel on Ubuntu 18.04

bazel build -c opt -- //tensorflow/...
produces these errors (after running for a long while):
ERROR: /home/luke/tensorflow/tensorflow/c/eager/BUILD:125:1: Linking of rule '//tensorflow/c/eager:c_api_test_gpu' failed (Exit 1) gcc failed: error executing command /usr/bin/gcc -o bazel-out/k8-opt/bin/tensorflow/c/eager/c_api_test_gpu '-Wl,-rpath,$ORIGIN/../../../_solib_k8/' -Lbazel-out/k8-opt/bin/_solib_k8 ... (remaining 64 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_library_cleanup'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_library_init'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_inet_ntop'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_parse_srv_reply'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_free_data'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_parse_txt_reply_ext'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_query'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_search'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_gethostbyname'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_set_servers_ports'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_strerror'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_init'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_process_fd'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_cancel'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_getsock'
bazel-out/k8-opt/bin/_solib_k8/libexternal_Sgrpc_Slibgrpc_Uresolver_Udns_Uares.so: error: undefined reference to 'ares_destroy'
I tried running sudo apt-get install libc-ares-dev, which did address some of the build steps depending on c-ares, but not this one
I built c-ares from source and ran make install which places the .so libcares.so in /usr/local/lib/. I also verified that libcares does export those symbols. That didn't solve anything.
I made sure my LD_LIBRARY_PATH included /usr/local/lib/
How to I get bazel to find the library?
Thank you in advance.

Make error in OPENCV installation

I was trying to install opencv in linux mint. I run the cmake command in the opencv folder.
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
But i get the some errors related to pango while running make command in the release folder :
//usr/lib/x86_64-linux-gnu/libgtk-3.so.0: undefined reference to `pango_attr_font_features_new'
//usr/lib/x86_64-linux-gnu/libgtk-3.so.0: undefined reference to `pango_renderer_set_alpha'
//usr/lib/x86_64-linux-gnu/libgtk-3.so.0: undefined reference to `pango_layout_get_serial'
//usr/lib/x86_64-linux-gnu/libgtk-3.so.0: undefined reference to `pango_attr_background_alpha_new'
//usr/lib/x86_64-linux-gnu/libgtk-3.so.0: undefined reference to `pango_layout_get_log_attrs_readonly'
//usr/lib/x86_64-linux-gnu/libgtk-3.so.0: undefined reference to `pango_fc_font_map_config_changed'
//usr/lib/x86_64-linux-gnu/libgtk-3.so.0: undefined reference to `pango_renderer_get_alpha'
//usr/lib/x86_64-linux-gnu/libgtk-3.so.0: undefined reference to `pango_attr_foreground_alpha_new'
collect2: error: ld returned 1 exit status
modules/highgui/CMakeFiles/opencv_test_highgui.dir/build.make:129: recipe for target 'bin/opencv_test_highgui' failed
make[2]: *** [bin/opencv_test_highgui] Error 1
CMakeFiles/Makefile2:7412: recipe for target 'modules/highgui/CMakeFiles/opencv_test_highgui.dir/all' failed
make[1]: *** [modules/highgui/CMakeFiles/opencv_test_highgui.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
you need to work on virtual enviroment restart with $ mkvirtualenv cv -p python2

After I compile mrpt manually, I have a trouble with build mrpt files

I'm trying to combine every system with ros but before that I wanted to check whether it works well or not so I run file on CLion, and I got these errors.
/home/ian/Downloads/clion-2017.2.1/bin/cmake/bin/cmake --build /home/ian/CLionProjects/mrqt --target mrpt -- -j 4
[ 50%] Linking CXX executable mrpt
/usr/bin/ld: warning: libopencv_imgcodecs3.so.3.2, needed by /usr/local/lib/libmrpt-base.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_imgproc3.so.3.2, needed by /usr/local/lib/libmrpt-base.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libopencv_core3.so.3.2, needed by /usr/local/lib/libmrpt-base.so, not found (try using -rpath or -rpath-link)
/usr/local/lib/libmrpt-base.so: undefined reference to `cvLoadImage'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvConvertImage'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvReleaseImage'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvSplit'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvMatchTemplate'
/usr/local/lib/libmrpt-base.so: undefined reference to `_IplImage::_IplImage(cv::Mat const&)'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvCreateImage'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvSmooth'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvFlip'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvGetSize'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvCvtColor'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvCircle'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvGetQuadrangleSubPix'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvRemap'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvLine'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvSaveImage'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvCopy'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvCloneImage'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvSetImageROI'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvEqualizeHist'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvMinMaxLoc'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvMerge'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvResize'
/usr/local/lib/libmrpt-base.so: undefined reference to `cvUndistort2'
collect2: error: ld returned 1 exit status
CMakeFiles/mrpt.dir/build.make:94: recipe for target 'mrpt' failed
make[3]: *** [mrpt] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/mrpt.dir/all' failed
make[2]: *** [CMakeFiles/mrpt.dir/all] Error 2
CMakeFiles/Makefile2:79: recipe for target 'CMakeFiles/mrpt.dir/rule' failed
make[1]: *** [CMakeFiles/mrpt.dir/rule] Error 2
Makefile:118: recipe for target 'mrpt' failed
make: *** [mrpt] Error 2
When I first compiled it, it was fine, but later I had some issues with mrpt header files, I deleted them all and compiled it manually, and this problem happened. Can I get some advice?
You probably have a mix of different MRPT versions installed in your system.
I don't recommend doing sudo make install unless you have a strong reason to do it; just compiling the project in its own build directory will generate a MRPTConfig.cmake file, which allows CMake to find MRPT from ROS or whatever other user project.
If CMake doesn't find it automatically, just set the environment variable export MRPT_DIR=/home/xxx/path/to/mrpt/build and it will work.
Your problem right now is cleaning all the mess that may be under /usr/local/. Take a look at that directory and if the only project you have make installed is MRPT, I strongly recommend deleting it with sudo rm -fr /usr/local/*.
If you have other projects there... well... you must run sudo make uninstall from the MRPT build dir, then manually make sure there are no remaining files.
The link error against OpenCV also looks like CMake configured the project for one opencv version, then another one got installed (perhaps via ROS packages?).
After doing the clean up of /usr/local mentioned above, delete your current MRPT CMake build directory and start from scratch again.

Linking with libbluetooth.so

On Ubuntu 14.04, I'm trying to do a small example of bluetooth device listing but I'm facing a simple issue about linking with the bluetooth shared library when compiling this minimalistic demo http://people.csail.mit.edu/albert/bluez-intro/c404.html:
$ sudo apt-get install libbluetooth-dev
$ gcc -lbluetooth simplescan.c -o simplescan
/tmp/ccuwRsB5.o: In function `main':
simplescan.c:(.text+0x79): undefined reference to `hci_get_route'
simplescan.c:(.text+0x8c): undefined reference to `hci_open_dev'
simplescan.c:(.text+0x132): undefined reference to `hci_inquiry'
simplescan.c:(.text+0x18f): undefined reference to `ba2str'
simplescan.c:(.text+0x1f0): undefined reference to `hci_read_remote_name'
collect2: error: ld returned 1 exit status
$ nm -D /usr/lib/x86_64-linux-gnu/libbluetooth.so.3.13.0 | grep hci_get_route
0000000000008f00 T hci_get_route
The bluetooth shared library seems to be found and containing the required functions, but the linking phase doesn't achieve.
The solution is astonished (to me): the order of the arguments given to gcc is important. "-lbluetooth" should be put after "simplescan.c":
$ gcc simplescan.c -lbluetooth -o simplescan # Success
$ gcc -lbluetooth simplescan.c -o simplescan # Failure
/tmp/ccWhZFXs.o: In function `main':
simplescan.c:(.text+0x79): undefined reference to `hci_get_route'
simplescan.c:(.text+0x8c): undefined reference to `hci_open_dev'
simplescan.c:(.text+0x132): undefined reference to `hci_inquiry'
simplescan.c:(.text+0x18f): undefined reference to `ba2str'
simplescan.c:(.text+0x1f0): undefined reference to `hci_read_remote_name'
collect2: error: ld returned 1 exit status

Resources