Closed LaurentBerger closed 3 years ago
-- General configuration for OpenCV 4.5.1-dev =====================================
-- Version control: 4.4.0-967-g13a1105318
--
-- Extra modules:
-- Location (extra): G:/Lib/opencv_contrib/modules
-- Version control (extra): 4.1.1-495-g0b8aecd9e
If this is info is not a typo,, it seems you are mixing recent master with old contrib branch. If I understand correctly, that's not supported, and that will be the cause of this build failure. Is this information precise ? Is there any particular reason you wish to mix old contrib and recent master ?
I don't think so https://github.com/LaurentBerger/opencv_contrib even with master and https://github.com/LaurentBerger/opencv Merge pull request opencv#19078 from zihaomu:dasiamrpn_tracker_c_plus…13a1105 16 hours ago
I don't know why Version control (extra): 4.1.1-495-g0b8aecd9e is
in opencv_contrib git log gives me :
$ git log
commit 0b8aecd9ebb605f2c07c2cd21f987645eabcfd52 (HEAD -> master, upstream/master , origin/master, origin/HEAD)
Merge: d733a8010 6e52be36a
Author: Alexander Alekhin <alexander.a.alekhin@gmail.com>
Date: Mon Jan 25 07:44:10 2021 +0000
Merge pull request #2824 from tomoaki0705:fixBuildCudaOptFlow
commit 6e52be36a5560f2f4242171f71a5904ddf597e59
Author: Tomoaki Teshima <tomoaki.teshima@gmail.com>
Date: Mon Jan 25 08:40:01 2021 +0900
disable NVIDIA Optical Flow SDK when CUDA < 10.0
* follow the review comment
* add missing constructors when not covered
* add definition in cu file
I don't know why Version control (extra): 4.1.1-495-g0b8aecd9e is
Right. My bad. Nothing wrong on this point.
Any chance you have a copy of cmake output that contains such message below ? https://github.com/opencv/opencv_contrib/blob/0b8aecd9ebb605f2c07c2cd21f987645eabcfd52/modules/cudaoptflow/CMakeLists.txt#L26
What I see is that the error message indicates that this is a linker error
1>nvidiaOpticalFlow.obj : error LNK2019: unresolved external symbol "void __cdecl cv::cuda::device::optflow_nvidia::FlowUpsample(void *,unsigned int,unsigned int,unsigned int,void *,unsigned int,unsigned int,unsigned int,unsigned int)" (?FlowUpsample@optflow_nvidia@device@cuda@cv@@YAXPEAXIII0IIII@Z) referenced in function "public: virtual void __cdecl `anonymous namespace'::NvidiaOpticalFlowImpl_2::calc(class cv::_InputArray const &,class cv::_InputArray const &,class cv::_InputOutputArray const &,class cv::cuda::Stream &,class cv::_InputArray const &,class cv::_OutputArray const &)" (?calc@NvidiaOpticalFlowImpl_2@?A0xf83298cd@@UEAAXAEBV_InputArray@cv@@0AEBV_InputOutputArray@4@AEAVStream@cuda@4@0AEBV_OutputArray@4@@Z)
This means that HAVE_NVIDIA_OPTFLOW
macro has been defined in nvidiaOpticalFlow.cpp
#elif !defined HAVE_NVIDIA_OPTFLOW
:
#else
:
cv::cuda::device::optflow_nvidia::FlowUpsample((void*)m_flowXYcuDevPtr, nSrcWidth, nSrcPitch,...
:
#endif
but not in nvidiaOpticalFlow.cu
#ifdef HAVE_NVIDIA_OPTFLOW
:
void FlowUpsample(void* srcDevPtr, uint32_t nSrcWidth, uint32_t nSrcPitch, uint32_t nSrcHeight,
:
#endif //HAVE_NVIDIA_OPTFLOW
The only reason I can imagine is that cmake cache (this is a general guess). Any chance that you re-run the cmake on existing build directory ? (I really hate to say this but there's nothing else I can say, unless there is more clear reproducer)
Now I rebuild everything with -DBUILD_opencv_cudaoptflow=OFF I can test it twomorow now When I built with cudaoptflow=ON I deleted all contents of my build opencv folder.
my cmakeoutput (empty build folder ) is
line 306 : -- Building with NVIDIA Optical Flow API 2.0
@LaurentBerger You may want to fetch tags from upstream repository: git fetch -t upstream
(use -t
option)
Build error is confirmed.
Linux is failing too (with CUDA 10.0):
../..../../lib/libopencv_cudaoptflow.so.4.5.1: undefined reference to
cv::cuda::device::optflow_nvidia::FlowUpsample(void*, unsigned int, unsigned int,/lib/libopencv_cudaoptflow.so.4.5.1: undefined reference to
cv::cuda::device::optflow_nvidia::FlowUpsample(void, unsigned int, unsigned int, unsigned int, void, unsigned int, unsigned int, unsigned int, unsigned int)' unsigned int, void*, unsigned int, unsigned int, unsigned int, unsigned int)'
relates #2824
My fault. I didn't confirm properly after #2824 was merged. My apologies. Now #2836 lets the build pass.
Detailed description
Error is
What's wrong ? @tomoaki0705 @vchiluka5