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

By default SSE2 flags wrongly set on ARM CPU #433

Closed
AeroXuk opened this issue Jul 10, 2019 · 3 comments · Fixed by #578
Closed

By default SSE2 flags wrongly set on ARM CPU #433

AeroXuk opened this issue Jul 10, 2019 · 3 comments · Fixed by #578

Comments

@AeroXuk
Copy link
Contributor

AeroXuk commented Jul 10, 2019

When following the compile instructions within the README.md of this repo on an ARM cpu (Raspberry Pi 4). SSE2 compile flags get set by default, even though the processor doesn't support them.

Rerunning configure with the --disable-sse2 flag or removing the lines below allows a successful build.

libpostal/configure.ac

Lines 75 to 87 in 21601eb

# ------------------------------------------------------------------
# Checks for SSE2 build
# ------------------------------------------------------------------
AC_ARG_ENABLE([sse2],
AS_HELP_STRING(
[--disable-sse2],
[disable SSE2 optimization routines]
)
)
AS_IF([test "x$enable_sse2" != "xno"], [
CFLAGS="-mfpmath=sse -msse2 -DUSE_SSE ${CFLAGS}"
])

The --disable-sse2 configure flag is not mentioned within the README.md compile instructions (allowing it to be missed).

Alternatively, it might also be better to detect the supported cpu features using an m4 plugin (e.g. AX_EXT or similar)?

@AeroXuk
Copy link
Contributor Author

AeroXuk commented Jul 11, 2019

Is it possible to automate the check for SSE2 support or put that the option --disable-sse2 exists in the documentation on this repo.
Edited into the issue post

@AeroXuk AeroXuk changed the title SSE2 flags wrongly set on ARM CPU By default SSE2 flags wrongly set on ARM CPU Jul 12, 2019
@thehappycoder
Copy link

Same happens on Apple m1 and Graviton EC2 instances https://aws.amazon.com/ec2/instance-types/t4/

@missinglink
Copy link
Contributor

missinglink commented Sep 30, 2021

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

Successfully merging a pull request may close this issue.

3 participants