Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FindSSE.cmake causes false positives when cross compiling #109

Open
PureTryOut opened this issue Jun 14, 2021 · 4 comments
Open

FindSSE.cmake causes false positives when cross compiling #109

PureTryOut opened this issue Jun 14, 2021 · 4 comments

Comments

@PureTryOut
Copy link

PureTryOut commented Jun 14, 2021

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
Copy link
Owner

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
Copy link

wildone commented Jan 27, 2022

@PureTryOut thank you!

@Karry
Copy link
Contributor

Karry commented Jan 27, 2022

it is similar to Framstag/libosmscout#1198 , it is necessary to try_compile sse code to verify availability...

@thinrope
Copy link
Contributor

If I read correctly this was fixed by #114 already, so can be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants