ludovic.cour...@inria.fr (Ludovic Courtès) writes: > Hello Guix! > > This post is a followup to our previous discussions on how to handle > architecture-specific optimizations: > > > https://guix-hpc.bordeaux.inria.fr/blog/2018/01/pre-built-binaries-vs-performance/ > > Comments welcome! > > Ludo’.
I encountered this problem several years ago when packaging for Debian. The program (a single binary) could be compiled with 3 different sets of options: generic, AVX or AVX2. The goal was to package it so that users didn't have to specify which version to install. The hack I came up with was to compile all 3 variants and wrote a shell wrapper to run self-tests for all 3 variants. If the self-test for the AVX2 variant works, then pick it. If not, try AVX. If not, fall back to generic. This way was quite crude. Now I think we can make use of /proc/cpuinfo. Will this method work? An obvious disadvantage is that more disk space will be needed.