Building OpenCV without SSE2 and Neon
Hi, is it possible to run OpenCV without SSE2 and NEON enabled? I tried adding the "-D<cv_sse2>=0 -D<cv_neon>=0" flag which should disable SSE2 and NEON, but it failed to build saying that some of the files can't find SSE2. I'm guessing some people should have been able to build OpenCV without either since there's architectures without SSE2 and NEON? Thanks
There should be nothing to do.
It will automatically detect the CPU and add the supported flags.
Which CPU/architecture are you using? BTW, OpenCV already supports many ISA: x86/x86-64, ARM/ARM-64, PowerPC, etc.
I'm building/compiling in X86. I'm trying to compile it to a generic architecture - is there no fallback (as in you have to "specify" the architecture you're building to)?
Which CPU model are you targeting?
Are you sure your CPU does not support even
SSE2
? Have a look at this page: CPU optimizations build options. If your CPU supportsSSE2
, you can use something likeCPU_BASELINE=SSE2
and higher level of SIMD instructions will be automatically dispatched. So they will be only executed if the CPU supports these instructions.In any case, the CPU optimizations build options page contains information about how to disable optimizations.
Thanks for the info. I'm trying to look for a generic fallback since it will be used for different accelerators. I'm trying to compile it down to an IR and let the IR choose the optimizations instead of OpenCV.