Building current 3.0 dev branch Ubuntu 14.04
I tried building OpenCV 3.0 current master branch on Ubuntu 14.04 which still yields a problem after fixing this pull request which gave a CMAKE error. All CMAKE errors are gone now. However during the make a new error comes up.
cmake -D CMAKE_BUILD_TYPE=DEBUG -D CMAKE_INSTALL_PREFIX=/usr/local
-D WITH_CUBLAS=ON -D WITH_CUFFT=ON -D WITH_EIGEN=ON -D WITH_OPENGL=ON
-D WITH_QT=ON -D WITH_TBB=ON -D BUILD_DOCS=ON -D BUILD_EXAMPLES=ON
-D BUILD_TESTS=ON -D CUDA_ARCH_BIN="3.0" ../opencv_3.0/
And after making this error occurs.
/home/spu/opencv_3.0/modules/cudabgsegm/test/test_bgsegm.cpp:46:36: fatal error: opencv2/cudalegacy.hpp: No such file or directory
# include "opencv2/cudalegacy.hpp"
^
compilation terminated.
This is kind of weird since the original legacy.hpp was replaced by cudalegacy.hpp. This seems to work for most files but still generates an error here. The file exists, so have no clue on what to try now. If we fix this I shall submit a PR.
UPDATE:
There is also a now pending fix for the cudabgsm module here. Applying that fix also.
Only error that remains now at 88% of the built is the following
In file included from /data/builds/opencv3.0/modules/cudev/include/opencv2/cudev/warp/warp.hpp:49:0,
from /data/builds/opencv3.0/modules/python/pyopencv_generated_include.h:1,
from /data/builds/opencv3.0/modules/python/src2/cv2.cpp:12:
/data/builds/opencv3.0/modules/cudev/include/opencv2/cudev/warp/../common.hpp:49:26: fatal error: cuda_runtime.h: No such file or directory
#include <cuda_runtime.h>
^
compilation terminated.
It seems that OpenCV is at a certain moment not able to find my cuda runtime environment, however several other cuda cores build perfectly...
UPDATE 2:
A bash output of the building process can be found here. Still weird that building works for several cuda kernels but then fails with a message that it doesn't find the cuda runtime...
UPDATE 3:
Tried adding compiler flags to the make option linking explicitly my CUDA install
sudo make CFLAGS='-I /usr/local/cuda/include -L /usr/local/cuda/bin'
But still same problems. Anyone?
UPDATE4:
I have implemented the suggested fix, seems there is still an error.
/usr/bin/ld: ../../lib/libopencv_ts.a(ts_gtest.cpp.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
../../lib/libopencv_ts.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [lib/cv2.so] Error 1
make[1]: *** [modules/python/CMakeFiles/opencv_python.dir/all] Error 2
make: *** [all] Error 2
Is this specific to my system?
I submitted a fix for the issue PR.
Thank you for the effort! Will see if it gets my system going!
@Vladislav Vinogradov : Seems this is not fixed yet, see updated question after adapting the files suggested in your pull request on the latest 3.0 branch (cloned just now)