我们通常需要使用不同版本的opencv,这时候如果用cmake构建工程,直接指定本地编译好的路径就可以,在CMakeLists.txt中添加:
set(OpenCV_DIR “/home/zzy/downloads/3party/opencv-4.4.0/build/”)
vscode:
"code-runner.executorMap": {
"javascript": "node",
"java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
"c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"cpp": "cd $dir && g++ -std=c++2a $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"objective-c": "cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"php": "php",
"python": "cd $dir && python -u $fileName"
}
EIGEN3 CMAKE 报错:
Update my Eigen version from 3.2 to 3.3.9 (git clone && make && make install)
Then replace find_package(Eigen3 REQUIRED) to
list(APPEND CMAKE_INCLUDE_PATH "/usr/local/include")
find_package (Eigen3 3.3 REQUIRED NO_MODULE)
needed by /usr/local/lib/libpangolin.so, not found (try using -rpath or -rpath-link)报错:
sudo apt-get install libpython3.9
overload atomicAdd 报错:
Try to add the following code at the beginning of ‘cuda_coarse_tracker_private.cu’
#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 600
#else
__device__ double atomicAdd(double* address, double val)
{
unsigned long long int* address_as_ull =
(unsigned long long int*)address;
unsigned long long int old = *address_as_ull, assumed;
do {
assumed = old;
old = atomicCAS(address_as_ull, assumed,
__double_as_longlong(val +
__longlong_as_double(assumed)));
// Note: uses integer comparison to avoid hang in case of NaN (since NaN != NaN)
} while (assumed != old);
return __longlong_as_double(old);
}
#endif