georgmartius / vid.stab

Video stabilization library
http://public.hronopik.de/vid.stab/
Other
838 stars 110 forks source link

FindSSE.cmake causes false positives when cross compiling #109

Open PureTryOut opened 3 years ago

PureTryOut commented 3 years ago

On Alpine Linux we're currently porting the system to riscv64. While building vid.stab, it appeared the build system was trying to use the -msse2 compiler option, while this option is not supported on this architecture.

Looking at the CMake code this is because CMake checks the output of /proc/cpuinfo for mentions of SSE support. However, this assumes that the architecture of the CPU building the package is also the target architecture, which in this case is not true as we're cross compiling it.

So it sees that the CPU building the package is x86_64 and supports SSE, even though the target architecture is riscv64 which does not support SSE. This obviously breaks compilation.

Adding -DSSE2_FOUND=False to the CMake options for this particular architecture fixes the problem.

georgmartius commented 3 years ago

I am not so familiar with the CMake stuff. If you have a fix that would solve it in a good way and allow for the option of cross-platform compilation I would be happy for a merge request.

wildone commented 2 years ago

@PureTryOut thank you!

Karry commented 2 years ago

it is similar to https://github.com/Framstag/libosmscout/pull/1198 , it is necessary to try_compile sse code to verify availability...

thinrope commented 5 months ago

If I read correctly this was fixed by https://github.com/georgmartius/vid.stab/pull/114 already, so can be resolved.