I met some problems in building opencv3.0 with cuda7.5 ( gpu GeForce 940M ) in ubuntu14.04.
Firstly, I tried opencv2.4.9 with cuda7.5 in ubuntu14.04 with cmake-gui, and replaced one header file, NV**.h (sorry, I forgot), and finally it succeeded!
However, I tried opencv3.0 with the same configuration, it failed in wired errors about tbb.....
In addition, I have chosen the "WITH_TBB" and "BUILD_TBB", and downloaded the file successfully, so theoretically, it wouldn't break out errors, but it did......
HERE IS THE COPY OF THE ERRORS
Scanning dependencies of target opencv_traincascade
[ 81%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/lbpfeatures.cpp.o
[ 81%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/HOGfeatures.cpp.o
[ 81%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/old_ml_tree.cpp.o
[ 81%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/old_ml_data.cpp.o
[ 81%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/cascadeclassifier.cpp.o
[ 81%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/old_ml_boost.cpp.o
[ 82%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/old_ml_inner_functions.cpp.o
[ 82%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/features.cpp.o
[ 82%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/traincascade.cpp.o
[ 82%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/boost.cpp.o
[ 82%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/haarfeatures.cpp.o
[ 82%] Building CXX object apps/traincascade/CMakeFiles/opencv_traincascade.dir/imagestorage.cpp.o
Linking CXX executable ../../bin/opencv_traincascade
CMakeFiles/opencv_traincascade.dir/old_ml_tree.cpp.o: In function CvDTree::find_best_split(CvDTreeNode*)':
old_ml_tree.cpp:(.text+0x69fd): undefined reference to
tbb::task_group_context::init()'
old_ml_tree.cpp:(.text+0x6a0e): undefined reference to tbb::internal::allocate_root_with_context_proxy::allocate(unsigned long) const'
old_ml_tree.cpp:(.text+0x6a41): undefined reference to
tbb::internal::get_initial_auto_partitioner_divisor()'
old_ml_tree.cpp:(.text+0x6a69): undefined reference to tbb::task_group_context::~task_group_context()'
old_ml_tree.cpp:(.text+0x6ae3): undefined reference to
tbb::task_group_context::~task_group_context()'
old_ml_tree.cpp:(.text+0x6af5): undefined reference to vtable for tbb::task'
old_ml_tree.cpp:(.text+0x6b00): undefined reference to
tbb::internal::allocate_root_with_context_proxy::free(tbb::task&) const'
CMakeFiles/opencv_traincascade.dir/old_ml_tree.cpp.o: In function tbb::interface6::internal::start_reduce<tbb::blocked_range<int>, cv::DTreeBestSplitFinder, tbb::auto_partitioner const>::~start_reduce()':
old_ml_tree.cpp:(.text._ZN3tbb10interface68internal12start_reduceINS_13blocked_rangeIiEEN2cv20DTreeBestSplitFinderEKNS_16auto_partitionerEED2Ev[_ZN3tbb10interface68internal12start_reduceINS_13blocked_rangeIiEEN2cv20DTreeBestSplitFinderEKNS_16auto_partitionerEED5Ev]+0x3): undefined reference to
vtable for tbb::task'
CMakeFiles/opencv_traincascade.dir/old_ml_tree.cpp.o: In function tbb::interface6::internal::flag_task::~flag_task()':
old_ml_tree.cpp:(.text._ZN3tbb10interface68internal9flag_taskD2Ev[_ZN3tbb10interface68internal9flag_taskD5Ev]+0x3): undefined reference to
vtable for tbb::task'
CMakeFiles/opencv_traincascade.dir/old_ml_tree.cpp.o: In function tbb::interface6::internal::finish_reduce<cv::DTreeBestSplitFinder>::~finish_reduce()':
old_ml_tree.cpp:(.text._ZN3tbb10interface68internal13finish_reduceIN2cv20DTreeBestSplitFinderEED2Ev[_ZN3tbb10interface68internal13finish_reduceIN2cv20DTreeBestSplitFinderEED5Ev]+0x3): undefined reference to
vtable for tbb::task'
CMakeFiles/opencv_traincascade.dir/old_ml_tree.cpp.o: In function tbb::interface6::internal::signal_task::~signal_task()':
old_ml_tree.cpp:(.text._ZN3tbb10interface68internal11signal_taskD2Ev[_ZN3tbb10interface68internal11signal_taskD5Ev]+0x3): undefined reference to
vtable for tbb::task'
CMakeFiles/opencv_traincascade.dir/old_ml_tree.cpp.o: In function tbb::interface6::internal::start_reduce<tbb::blocked_range<int>, cv::DTreeBestSplitFinder, tbb::auto_partitioner const>::~start_reduce()':
old_ml_tree.cpp:(.text._ZN3tbb10interface68internal12start_reduceINS_13blocked_rangeIiEEN2cv20DTreeBestSplitFinderEKNS_16auto_partitionerEED0Ev[_ZN3tbb10interface68internal12start_reduceINS_13blocked_rangeIiEEN2cv20DTreeBestSplitFinderEKNS_16auto_partitionerEED0Ev]+0x3): undefined reference to
vtable for tbb::task'
CMakeFiles/opencv_traincascade.dir/old_ml_tree.cpp.o:old_ml_tree.cpp:(.text._ZN3tbb10interface68internal9flag_taskD0Ev[_ZN3tbb10interface68internal9flag_taskD0Ev]+0x3): more undefined references to vtable for tbb::task' follow
CMakeFiles/opencv_traincascade.dir/old_ml_tree.cpp.o: In function
tbb::interface6::internal::start_reduce<tbb::blocked_range<int>, cv::DTreeBestSplitFinder, tbb::auto_partitioner const>::execute()':
old_ml_tree.cpp:(.text._ZN3tbb10interface68internal12start_reduceINS_13blocked_rangeIiEEN2cv20DTreeBestSplitFinderEKNS_16auto_partitionerEE7executeEv[_ZN3tbb10interface68internal12start_reduceINS_13blocked_rangeIiEEN2cv20DTreeBestSplitFinderEKNS_16auto_partitionerEE7executeEv]+0x95): undefined reference to tbb::internal::allocate_continuation_proxy::allocate(unsigned long) const'
old_ml_tree.cpp:(.text._ZN3tbb10interface68internal12start_reduceINS_13blocked_rangeIiEEN2cv20DTreeBestSplitFinderEKNS_16auto_partitionerEE7executeEv[_ZN3tbb10interface68internal12start_reduceINS_13blocked_rangeIiEEN2cv20DTreeBestSplitFinderEKNS_16auto_partitionerEE7executeEv]+0xe0): undefined reference to
tbb::internal::allocate_child_proxy::allocate(unsigned long) const'
old_ml_tree.cpp:(.text._ZN3tbb10interface68internal12start_reduceINS_13blocked_rangeIiEEN2cv20DTreeBestSplitFinderEKNS_16auto_partitionerEE7executeEv[_ZN3tbb10interface68internal12start_reduceINS_13blocked_rangeIiEEN2cv20DTreeBestSplitFinderEKNS_16auto_partitionerEE7executeEv]+0x1b8): undefined reference to tbb::internal::allocate_continuation_proxy::allocate(unsigned long) const'
old_ml_tree.cpp:(.text._ZN3tbb10interface68internal12start_reduceINS_13blocked_rangeIiEEN2cv20DTreeBestSplitFinderEKNS_16auto_partitionerEE7executeEv[_ZN3tbb10interface68internal12start_reduceINS_13blocked_rangeIiEEN2cv20DTreeBestSplitFinderEKNS_16auto_partitionerEE7executeEv]+0x203): undefined reference to
tbb::internal::allocate_child_proxy::allocate(unsigned long) const'
old_ml_tree.cpp:(.text._ZN3tbb10interface68internal12start_reduceINS_13blocked_rangeIiEEN2cv20DTreeBestSplitFinderEKNS_16auto_partitionerEE7executeEv[_ZN3tbb10interface68internal12start_reduceINS_13blocked_rangeIiEEN2cv20DTreeBestSplitFinderEKNS_16auto_partitionerEE7executeEv]+0x391): undefined reference to tbb::internal::allocate_continuation_proxy::allocate(unsigned long) const'
old_ml_tree.cpp:(.text._ZN3tbb10interface68internal12start_reduceINS_13blocked_rangeIiEEN2cv20DTreeBestSplitFinderEKNS_16auto_partitionerEE7executeEv[_ZN3tbb10interface68internal12start_reduceINS_13blocked_rangeIiEEN2cv20DTreeBestSplitFinderEKNS_16auto_partitionerEE7executeEv]+0x3e9): undefined reference to
tbb::internal::allocate_child_proxy::allocate(unsigned long) const'
old_ml_tree.cpp:(.text._ZN3tbb10interface68internal12start_reduceINS_13blocked_rangeIiEEN2cv20DTreeBestSplitFinderEKNS_16auto_partitionerEE7executeEv[_ZN3tbb10interface68internal12start_reduceINS_13blocked_rangeIiEEN2cv20DTreeBestSplitFinderEKNS_16auto_partitionerEE7executeEv]+0x4a2): undefined reference to tbb::task_group_context::is_group_execution_cancelled() const'
CMakeFiles/opencv_traincascade.dir/old_ml_tree.cpp.o:(.rodata._ZTIN3tbb10interface68internal11signal_taskE[_ZTIN3tbb10interface68internal11signal_taskE]+0x10): undefined reference to
typeinfo for tbb::task'
CMakeFiles/opencv_traincascade.dir/old_ml_tree.cpp.o:(.rodata._ZTVN3tbb10interface68internal13finish_reduceIN2cv20DTreeBestSplitFinderEEE[_ZTVN3tbb10interface68internal13finish_reduceIN2cv20DTreeBestSplitFinderEEE]+0x28): undefined reference to tbb::task::note_affinity(unsigned short)'
CMakeFiles/opencv_traincascade.dir/old_ml_tree.cpp.o:(.rodata._ZTIN3tbb10interface68internal9flag_taskE[_ZTIN3tbb10interface68internal9flag_taskE]+0x10): undefined reference to
typeinfo for tbb::task'
CMakeFiles/opencv_traincascade.dir/old_ml_tree.cpp.o:(.rodata._ZTIN3tbb10interface68internal12start_reduceINS_13blocked_rangeIiEEN2cv20DTreeBestSplitFinderEKNS_16auto_partitionerEEE[_ZTIN3tbb10interface68internal12start_reduceINS_13blocked_rangeIiEEN2cv20DTreeBestSplitFinderEKNS_16auto_partitionerEEE]+0x10): undefined reference to typeinfo for tbb::task'
CMakeFiles/opencv_traincascade.dir/old_ml_tree.cpp.o:(.rodata._ZTVN3tbb10interface68internal9flag_taskE[_ZTVN3tbb10interface68internal9flag_taskE]+0x28): undefined reference to
tbb::task::note_affinity(unsigned short)'
CMakeFiles/opencv_traincascade.dir/old_ml_tree.cpp.o:(.rodata._ZTVN3tbb10interface68internal11signal_taskE[_ZTVN3tbb10interface68internal11signal_taskE]+0x28): undefined reference to tbb::task::note_affinity(unsigned short)'
../../lib/libopencv_imgproc.so.3.0.0: undefined reference to
tbb::interface5::internal::task_base::destroy(tbb::task&)'
../../lib/libopencv_core.so.3.0.0: undefined reference to tbb::task_scheduler_init::terminate()'
../../lib/libopencv_imgproc.so.3.0.0: undefined reference to
tbb::internal::NFS_Allocate(unsigned long, unsigned long, void)'
../../lib/libopencv_imgproc.so.3.0.0: undefined reference to tbb::task_group_context::cancel_group_execution()'
../../lib/libopencv_imgproc.so.3.0.0: undefined reference to
tbb::task_group_context::reset()'
../../lib/libopencv_imgproc.so.3.0.0: undefined reference to tbb::internal::NFS_Free(void*)'
../../lib/libopencv_imgproc.so.3.0.0: undefined reference to
tbb::internal::handle_perror(int, char const)'
../../lib/libopencv_imgproc.so.3.0.0: undefined reference to tbb::internal::throw_exception_v4(tbb::internal::exception_id)'
../../lib/libopencv_core.so.3.0.0: undefined reference to
tbb::task_scheduler_init::initialize(int)'
../../lib/libopencv_core.so.3.0.0: undefined reference to tbb::task_scheduler_init::initialize(int, unsigned long)'
../../lib/libopencv_imgproc.so.3.0.0: undefined reference to
tbb::internal::allocate_additional_child_of_proxy::allocate(unsigned long) const'
../../lib/libopencv_core.so.3.0.0: undefined reference to `tbb::task_scheduler_init::default_num_threads()'
collect2: error: ld returned 1 exit status
make[2]: * [bin/opencv_traincascade] Error 1
make[1]: [apps/traincascade/CMakeFiles/opencv_traincascade.dir/all] Error 2
make: ** [all] Error 2