libSGM
libSGM copied to clipboard
Error when "make"ing
When I want to make files in /sample/image/ or /sample/movie/, I get the following errors in order. I use CUDA 10 and CMake 3.14.
CMakeFiles/stereo_test.dir/build.make:62: recipe for target 'CMakeFiles/stereo_test.dir/stereosgm_image.cpp.o' failed
make[2]: *** [CMakeFiles/stereo_test.dir/stereosgm_image.cpp.o] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/stereo_test.dir/all' failed
make[1]: *** [CMakeFiles/stereo_test.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
CMakeFiles/stereo_movie.dir/build.make:62: recipe for target 'CMakeFiles/stereo_movie.dir/stereosgm_movie.cpp.o' failed
make[2]: *** [CMakeFiles/stereo_movie.dir/stereosgm_movie.cpp.o] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/stereo_movie.dir/all' failed
make[1]: *** [CMakeFiles/stereo_movie.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Are the errors related to the version of cuda or CMake?
Hi
I tried build with Ubuntu 18.04, CUDA 10.0 CMake-3.14.0-rc2, and I succeeded. Following code is tried dockerfile:
FROM nvidia/cuda:10.0-devel-ubuntu18.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get install -y build-essential git sudo wget \
&& apt-get install -y cmake libopencv-dev \
&& apt-get install -y libxinerama-dev libxcursor-dev libxi-dev \
&& apt-get install -y libglew-dev libglfw3-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
# Build CMake 3.14
RUN wget https://github.com/Kitware/CMake/releases/download/v3.14.0-rc2/cmake-3.14.0-rc2.tar.gz \
&& tar zxvf cmake-3.14.0-rc2.tar.gz \
&& cd cmake-3.14.0-rc2 \
&& ./bootstrap && make && sudo make install \
&& cmake --version
WORKDIR /tmp
# Build libSGM
RUN git clone https://github.com/fixstars/libSGM.git \
&& cd libSGM \
&& cmake . -DENABLE_SAMPLES=ON -DLIBSGM_SHARED=ON \
&& sudo make install
So, it doesn't seem cause of CUDA or CMake versions. What are you using environment?
Hi and thank you for your reply. I am using Ubuntu 16.04.
I ran the commands per your suggestion. Again, I am having error in sudo make install
.
make[2]: *** [src/CMakeFiles/sgm.dir/sgm_generated_winner_takes_all.cu.o] Error 2
CMakeFiles/Makefile2:90: recipe for target 'src/CMakeFiles/sgm.dir/all' failed
make[1]: *** [src/CMakeFiles/sgm.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
I would be very happy if you could help me with the issue.
Cheers
Build log is omitted, so I can't know what causes the error. Can you paste build log without omitting?
Do you mean like this?
$ sudo make install
[sudo] password for usrname:
Building NVCC (Device) object src/CMakeFiles/sgm.dir/sgm_generated_winner_takes_all.cu.o
/bin/sh: 1: cd: can't cd to /rahome/usrname/codes/libSGM/src/CMakeFiles/sgm.dir
src/CMakeFiles/sgm.dir/build.make:126: recipe for target 'src/CMakeFiles/sgm.dir/sgm_generated_winner_takes_all.cu.o' failed
make[2]: *** [src/CMakeFiles/sgm.dir/sgm_generated_winner_takes_all.cu.o] Error 2
CMakeFiles/Makefile2:90: recipe for target 'src/CMakeFiles/sgm.dir/all' failed
make[1]: *** [src/CMakeFiles/sgm.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
Thank you for showing build log. I haven't encountered this problem.
make
seems to fail making directory src/CMakeFiles/sgm.dir
.
The example that I showed is a bit worse in that runs make
as super user.
These could be related permission.
So try it again. (Modify following procedure as needed)
$ cd /rahome/usrname/codes
$ rm -rf libSGM # Maybe need to sudo
$ git clone https://github.com/fixstars/libSGM.git
$ cd libSGM
$ make # without `sudo`
Thank you very much for your help. It proceeds more with only make
!
Now, it stops here:
[ 66%] Building CXX object sample/image/CMakeFiles/stereo_test.dir/stereosgm_image.cpp.o
[ 71%] Linking CXX executable stereo_test
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFReadRGBAStrip@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFIsTiled@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFWriteScanline@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFGetField@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFScanlineSize@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libSM.so.6: undefined reference to `uuid_generate@UUID_1.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFReadEncodedTile@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFReadRGBATile@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFClose@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFRGBAImageOK@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFOpen@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFReadEncodedStrip@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFSetField@LIBTIFF_4.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFSetWarningHandler@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libSM.so.6: undefined reference to `uuid_unparse_lower@UUID_1.0'
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9: undefined reference to `TIFFSetErrorHandler@LIBTIFF_4.0'
collect2: error: ld returned 1 exit status
sample/image/CMakeFiles/stereo_test.dir/build.make:100: recipe for target 'sample/image/stereo_test' failed
make[2]: *** [sample/image/stereo_test] Error 1
CMakeFiles/Makefile2:145: recipe for target 'sample/image/CMakeFiles/stereo_test.dir/all' failed
make[1]: *** [sample/image/CMakeFiles/stereo_test.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
Is this the type of the previous problem? Thanks again.
I'm sorry that I didn't write at README. (I wrote the issue two years ago... #7) Use OpenCV version 3.x (I checked OpenCV 3.2.0.)
But I haven't encounter that problem. I'll check too.
Is in your environment exists libtiff.so?
In my environment (I check with Ubuntu 16.04 + OpenCV 2.4.9 via apt now), libopencv_highgui.so.2.4.9
needs libtiff.so.5.
libtiff.so doesn't exist so that make
caused link error.
Try to check library dependencies by following:
root@421bf0ccaa21:/tmp/libSGM/build# ldd /usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4.9 | grep tiff
libtiff.so.5 => /usr/lib/x86_64-linux-gnu/libtiff.so.5 (0x00007fc7c2db4000)
root@421bf0ccaa21:/tmp/libSGM/build# ls /usr/lib/x86_64-linux-gnu/libtiff*
/usr/lib/x86_64-linux-gnu/libtiff.a /usr/lib/x86_64-linux-gnu/libtiff.so.5 /usr/lib/x86_64-linux-gnu/libtiffxx.a /usr/lib/x86_64-linux-gnu/libtiffxx.so.5
/usr/lib/x86_64-linux-gnu/libtiff.so /usr/lib/x86_64-linux-gnu/libtiff.so.5.2.4 /usr/lib/x86_64-linux-gnu/libtiffxx.so /usr/lib/x86_64-linux-gnu/libtiffxx.so.5.2.4
I guessed from TIFFReadRGBAStrip@LIBTIFF_4.0
, libtiff.so.4 is needed, isn't it?
Thank you for your reply. Yes, I think the problem is with my default and old OpenCV lib. I am trying to update the OpenCV. Now, it has some error when making the files of OpenCV. I will try making libSGM again after I make the new OpenCV.
Thanks again.