i want to rebuild opencv source code on my machine with support avx2 or avx512, i first compile opencv with blow command:
cmake -DBUILD_PERF_TESTS:BOOL=OFF -DBUILD_TESTS:BOOL=OFF -DBUILD_DOCS:BOOL=OFF -DWITH_CUDA:BOOL=OFF -DBUILD_EXAMPLES:BOOL=OFF -DINSTALL_CREATE_DISTRIB=ON -DWITH_OPENMP=ON -DBUILD_opencv_world=ON ..
however, when i run blow code, i got blow result
void PrintOpenCVInfo()
{
std::cout << "--------------------------OpenCV informaintion--------------------------"
<< std::endl;
std::cout << "OpenCV version:" << cv::getVersionString() << std::endl;
std::cout << "Simd info: " << std::endl;
#ifdef CV_SIMD
std::cout << "CV_SIMD : " << CVAUX_STR(CV_SIMD) << std::endl;
std::cout << "CV_SIMD_WIDTH : " << CVAUX_STR(CV_SIMD_WIDTH) << std::endl;
std::cout << "CV_SIMD128 : " << CVAUX_STR(CV_SIMD128) << std::endl;
std::cout << "CV_SIMD256: " << CVAUX_STR(CV_SIMD256) << std::endl;
std::cout << "CV_SIMD512 : " CVAUX_STR(CV_SIMD512) << std::endl;
#else
std::cout << "CV_SIMD is NOT defined." << std::endl;
#endif
#ifdef CV_SIMD
std::cout << "sizeof(v_uint8) = " << sizeof(cv::v_uint8) << std::endl;
std::cout << "sizeof(v_int32) = " << sizeof(cv::v_int32) << std::endl;
std::cout << "sizeof(v_float32) = " << sizeof(cv::v_float32) << std::endl;
#endif
}
result:
--------------------------OpenCV informaintion--------------------------
OpenCV version:4.6.0
Simd info:
CV_SIMD : 1
CV_SIMD_WIDTH : 16
CV_SIMD128 : 1
CV_SIMD256: 0
CV_SIMD512 : 0
sizeof(v_uint8) = 16
sizeof(v_int32) = 16
sizeof(v_float32) = 16
my question is what should i do to make opencv support avx2 or avx512?