Can not compile opencv3 with cuda7.5
hi there I am trying to compile opencv3 (latest) with CUDA 7.5 but it gives the following error
[ 86%] Built target opencv_python2
[ 86%] Built target opencv_python3 [ 86%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/mergevec.cpp.o In file included from /home/unnirajendran/opencv/apps/traincascade/_cvcommon.h:45:0, from /home/unnirajendran/opencv/apps/traincascade/_cvhaartraining.h:51, from /home/unnirajendran/opencv/apps/traincascade/mergevec.cpp:8: /home/unnirajendran/opencv/modules/core/include/opencv2/core/core.hpp:45:2: error: #error this is a compatibility header which should not be used inside the OpenCV library #error this is a compatibility header which should not be used inside the OpenCV library ^ In file included from /usr/include/opencv2/core/internal.hpp:53:0, from /home/unnirajendran/opencv/apps/traincascade/_cvcommon.h:46, from /home/unnirajendran/opencv/apps/traincascade/_cvhaartraining.h:51, from /home/unnirajendran/opencv/apps/traincascade/mergevec.cpp:8: /home/unnirajendran/opencv/modules/core/include/opencv2/core/core.hpp:45:2: error: #error this is a compatibility header which should not be used inside the OpenCV library #error this is a compatibility header which should not be used inside the OpenCV library ^ /home/unnirajendran/opencv/apps/traincascade/mergevec.cpp: In function ‘void icvMergeVecs(char, const char, int, int, int)’: /home/unnirajendran/opencv/apps/traincascade/mergevec.cpp:102:73: warning: ignoring return value of ‘size_t fread(void, size_t, size_t, FILE)’, declared with attribute warn_unused_result [-Wunused-result] fread( &invec.count, sizeof( invec.count ) , 1, invec.input ); ^ /home/unnirajendran/opencv/apps/traincascade/mergevec.cpp:103:73: warning: ignoring return value of ‘size_t fread(void, size_t, size_t, FILE)’, declared with attribute warn_unused_result [-Wunused-result] fread( &invec.vecsize, sizeof( invec.vecsize ), 1, invec.input ); ^ /home/unnirajendran/opencv/apps/traincascade/mergevec.cpp:104:53: warning: ignoring return value of ‘size_t fread(void, size_t, size_t, FILE)’, declared with attribute warn_unused_result [-Wunused-result] fread( &tmp, sizeof( tmp ), 1, invec.input ); ^ /home/unnirajendran/opencv/apps/traincascade/mergevec.cpp:105:53: warning: ignoring return value of ‘size_t fread(void, size_t, size_t, FILE)’, declared with attribute warn_unused_result [-Wunused-result] fread( &tmp, sizeof( tmp ), 1, invec.input ); ^ /home/unnirajendran/opencv/apps/traincascade/mergevec.cpp:128:73: warning: ignoring return value of ‘size_t fread(void, size_t, size_t, FILE)’, declared with attribute warn_unused_result [-Wunused-result] fread( &invec.count, sizeof( invec.count ) , 1, invec.input ); ^ /home/unnirajendran/opencv/apps/traincascade/mergevec.cpp:129:73: warning: ignoring return value of ‘size_t fread(void, size_t, size_t, FILE)’, declared with attribute warn_unused_result [-Wunused-result] fread( &invec.vecsize, sizeof( invec.vecsize ), 1, invec.input ); ^ /home/unnirajendran/opencv/apps/traincascade/mergevec.cpp:130:53: warning: ignoring return value of ‘size_t fread(void, size_t, size_t, FILE)’, declared with attribute warn_unused_result [-Wunused-result] fread( &tmp, sizeof( tmp ), 1, invec.input ); ^ /home/unnirajendran/opencv/apps/traincascade/mergevec.cpp:131:53: warning: ignoring return value of ‘size_t fread(void, size_t, size_t, FILE)’, declared with attribute warn_unused_result [-Wunused-result] fread( &tmp, sizeof( tmp ), 1, invec.input ); ^ apps/traincascade/CMakeFiles/opencv_traincascade.dir/build.make:169: recipe for target 'apps/traincascade/CMakeFiles/opencv_traincascade.dir/mergevec.cpp.o' failed make[2]: * [apps/traincascade ...
as I see your system is linux, can you give some more information about distribution, and gcc version. Most likely your cuda is not supported from your gcc version for that reason you cannot compile it. In that case what you could do it either downgrade your gcc or disable cuda in opencv cmake file. The latter can be done with
-D with_CUDA=OFF
if I remember correctly.gcc version is 4.4 and would it help if i downgrade gcc version ,if so then which gcc version should i use
actually your gcc version might be too old now that you are saying that you have 4.4, try to upgrade maybe? From a quick search: