conda-forge / conda-forge/conda-forge.github.io

Where does conda-forge specify the minimum supported CPU instruction set, e.g. `-march=nocona`

Open
#2,251 7 comments 1 reaction 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
170
Forks
320
Avg merge
2d 10h
Merged PRs (30d)
5

Description

### Your question:

A bioconda recipe I maintain caused some issues by using AVX instructions. The source code build script hard coded `-mavx` ignoring the default `-march` flag of `gcc` and `clang`, which are at the time of writing `-march=core2 -mssse3` or `-march=nocona`.

The fact _that_ there are default arch flags took some time to figure out, because what the flags are does not seem to be documented explicitly (at least a few folks at bioconda weren't aware, see [Gitter thread](https://matrix.to/#/!MhHkICgthNLZeLiygG:gitter.im/$pHw85yB6Z3_1Mrtl7oYRjDDHZaEahIVOGsBrEh779QU?via=gitter.im&via=matrix.org&via=beeper.com)). I was wondering if we could improve the situation around this.

If I'm not mistaken, there is no single central place (like for example conda-forge-pinnings) setting those flags across compilers in a consistent manner. Instead, each compiler compiler sets its own flags in its feedstock code. Examples:

- clang: https://github.com/conda-forge/clang-compiler-activation-feedstock/blob/0bf5cc94f372c80ec88840af5f99320e67bbae1b/recipe/build.sh#L9-L10 (no arch option for arm64 set?)
- gcc/fortran (for non-macOS): https://github.com/conda-forge/ctng-compiler-activation-feedstock/blob/23b6a8816e31eeef467d147dcead739aba789009/recipe/conda_build_config.yaml#L61-L72
- gfortran (for macOS): https://github.com/conda-forge/gfortran_osx-64-feedstock/blob/51129a09ed7b02c321f20a9b85f68c5b1dc2c79b/recipe/build_gfortran.sh#L10-L17

For x86-64 and ppc but not for arm/aarch, there's been work on allowing build-variants for differing instruction sets: https://github.com/conda-forge/microarch-level-feedstock/blob/1b446dbab3999c5e27f1e0b000231f18fa1b6df1/recipe/install_scripts.sh#L7

A few other mentions of `-march` I found through search:
- Compiler flag unification meeting notes (2017-11-16): https://github.com/conda-forge/conda-forge.github.io/blob/02b11bd64f53dc44b33f68fe635cd16da5175240/community/minutes/2017-11-16.md?plain=1#L26-L49

A lot of feedstocks override `-march` in inconsistent ways. Should this be discouraged - unless the package supports graceful degradation when run on lesser hardware? I've seen such recommendations in various issues, maybe this should be made explicit in the docs to make it more discoverable?

The minimum supported architectures have not been updated in a while, should they maybe be?

Here's a collection of somewhat related issues I could find:
- https://github.com/conda-forge/corrfunc-feedstock/issues/2
- https://github.com/conda-forge/abinit-feedstock/issues/30

CentOS will raise minimum microarch level to x86-64-v2 in version 9 - but end of support of 8 is years away, probably after 2030.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.