Build fails on non-CUDA system due to CUDA_ARCH_PTX missing (Bug #909)
Description
I am using Ubuntu 10.10, without CUDA support (and I have WITH_CUDA disabled in CMake). However, I cannot compile OpenCV because of the following errors:
.../opencv/modules/gpu/src/initialization.cpp: In static member function ‘static bool cv::gpu::TargetArchs::builtWith(cv::gpu::FeatureSet)’:
.../opencv/modules/gpu/src/initialization.cpp:77: error: ‘CUDA_ARCH_FEATURES’ was not declared in this scope
.../opencv/modules/gpu/src/initialization.cpp: In static member function ‘static bool cv::gpu::TargetArchs::hasPtx(int, int)’:
.../opencv/modules/gpu/src/initialization.cpp:89: error: ‘CUDA_ARCH_PTX’ was not declared in this scope
.../opencv/modules/gpu/src/initialization.cpp: In static member function ‘static bool cv::gpu::TargetArchs::hasBin(int, int)’:
.../opencv/modules/gpu/src/initialization.cpp:95: error: ‘CUDA_ARCH_BIN’ was not declared in this scope
.../opencv/modules/gpu/src/initialization.cpp: In static member function ‘static bool cv::gpu::TargetArchs::hasEqualOrLessPtx(int, int)’:
.../opencv/modules/gpu/src/initialization.cpp:101: error: ‘CUDA_ARCH_PTX’ was not declared in this scope
.../opencv/modules/gpu/src/initialization.cpp: In static member function ‘static bool cv::gpu::TargetArchs::hasEqualOrGreaterPtx(int, int)’:
.../opencv/modules/gpu/src/initialization.cpp:115: error: ‘CUDA_ARCH_PTX’ was not declared in this scope
.../opencv/modules/gpu/src/initialization.cpp: In static member function ‘static bool cv::gpu::TargetArchs::hasEqualOrGreaterBin(int, int)’:
.../opencv/modules/gpu/src/initialization.cpp:122: error: ‘CUDA_ARCH_BIN’ was not declared in this scope
By moving the mentioned functions in modules/gpu/src/initialization.cpp inside the #else /* !defined (HAVE_CUDA) */ section, the compilation is successful (but I'm not sure it's the correct solution).
History
Updated by Michal Kottman almost 15 years ago
Fixed in r4975
- Status changed from Open to Done
- (deleted custom field) set to fixed
Updated by Michal Kottman almost 15 years ago
Sorry, that would be r4795