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

setting RUSTFLAGS for linux #7

Closed
ritchie46 opened this issue Jun 8, 2022 · 4 comments
Closed

setting RUSTFLAGS for linux #7

ritchie46 opened this issue Jun 8, 2022 · 4 comments
Labels
question Further information is requested

Comments

@ritchie46
Copy link
Contributor

Comment:

For linux we build polars with the following RUSTFLAGS as environment var:

export RUSTFLAGS='-C target-feature=+fxsr,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+avx,+fma'

Where should I put these. I see a build.sh, but I think that will also be used by os-x.

Is it best to set it in the run_docker_build.sh?

@ritchie46 ritchie46 added the question Further information is requested label Jun 8, 2022
@xhochy
Copy link
Member

xhochy commented Jun 8, 2022

It needs to be in build.sh as everything outside of recipe/ is auto-generated. Still, conda-forge supports a wider userbase where not everyone has AVX capable CPUs. Thus we should be careful what we set here. conda also supports CPU (feature) detection but we haven't used this in conda-forge yet, see the following issue for that: conda-forge/conda-forge.github.io#1261

You should be able to safeguard this with the following in build.sh:

if [[ "${target_platform}" == "linux-64" ]]; then
  ...
fi

@Maxyme
Copy link
Contributor

Maxyme commented Jun 8, 2022

What could be an option, is to use x86_features if they are available by checking at for them at runtime (https://doc.rust-lang.org/std/macro.is_x86_feature_detected.html)
I think this could be useful for this: https://docs.rs/simdeez/0.2.4/simdeez/index.html

@ritchie46
Copy link
Contributor Author

We don't have runtime detectable simd in polars. We could define a minimal set. This is what I have done in the polars CI as well.
The current set is the one where we did not get an issue that it was not working for them. ;)

I could drop the avx feauture (note that it is not avx512). That would already be far more than the rustc defaults.

@ritchie46
Copy link
Contributor Author

fixed by #11

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

No branches or pull requests

3 participants