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

Don't set -mno-sse / -mno-avx2 #486

Open
haampie opened this issue Oct 28, 2023 · 4 comments
Open

Don't set -mno-sse / -mno-avx2 #486

haampie opened this issue Oct 28, 2023 · 4 comments

Comments

@haampie
Copy link

haampie commented Oct 28, 2023

On PPC and other architecutres neither -msse nor -mno-sse are supported.

Yet

numcodecs/setup.py

Lines 25 to 32 in 45a8ef3

if disable_sse2:
base_compile_args.append('-mno-sse2')
elif have_sse2:
base_compile_args.append('-msse2')
if disable_avx2:
base_compile_args.append('-mno-avx2')
elif have_avx2:
base_compile_args.append('-mavx2')
numcodecs will set -mno-sse / -mno-avx2 on those platforms.

Either make it conditional on have_sse/avx2, or don't set any -mno-* flag at all, why bother?

@joshmoore
Copy link
Member

Thanks for the issue, @haampie. Do you have the feeling that another PR like #483 would achieve what you're looking for?

@haampie
Copy link
Author

haampie commented Oct 31, 2023

The script would have to be updated either like:

if have_sse2:
    base_compile_args.append('-mno-sse2' if disable_sse2 else '-msse2')

but I'd be happier if it was just:

if have_sse2 and not disable_sse2:
    base_compiler_flags.append('-msse2')

I don't think I've ever seen a build system that explicitly disabled a certain micro-architecture. Most of the build systems do something like "if ENABLE_SSE2=1 then add -msse2", if not specified, don't add any flag. (And some projects that use cpuid to dynamically dispatch to micro arch optimized routines just test what the compiler can target, compile for each target, and use a generic arch for the entrypoint)

@sahiljhawar
Copy link

sahiljhawar commented Apr 9, 2024

Is this issue fixed? I am having problem while building and pushing image to docker hub on (linux/arm64/v8). And the issue stems from -msse2 and -mavx2

@haampie
Copy link
Author

haampie commented Apr 11, 2024

it's not

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

3 participants