spack envis an attempt to automate this kind of thing. Imho it still has shortcomings that prevent our particular use case, but there might be enough for yours (or you'd like to expand on it). One thing that is a problem for us is, that you don't necessarily end up with a single...