Hi Drew, On Sat, Nov 02, 2024 at 05:14:31PM +0100, Drew Parsons wrote: > It seems to me there's the proverbial elephant in the room if we're > discussing improving cross-compilation compiler dependency definitions, and > that's the MPI compiler wrapper mpicc/mpicxx/mpifort. > > Most of the packages using MPI do not build directly with gcc/gfortran, with > or without the arch triplet, but instead use the wrappers mpicc/mpifort. The > wrappers do have mechanisms and options for specifying the underlying > compiler used (-fc flag for mpifort.openmpi, not the FC env variable), but > these need to be activated. And openmpi does it differently to mpich.
I agree that these wrappers are an issue for cross building, but to me that's a very separate and disconnected issue to the matter I raised. Generally, cross building and use of compiler wrappers such as mpicc is fundamentally incompatible (or very annoying). I've sent patches for a couple of packages using MPI and in all cases the proposed solution is to stop using mpicc. These days, mpi provides working .pc files and there is very little benefit from using the compiler wrappers, so we may as well fully deprecate them in favour of the well establish .pc mechanism. In my view, this is more of a work item than a discussion item. The question I raised essentially boils down to what a *-for-host package should provide. As it is implemented now, gfortran-for-host:$DEB_HOST_ARCH provides /usr/bin/$DEB_HOST_GNU_TYPE-gfortran, but what packages actually expect in addition to that is /usr/bin/gfortran if the build happens to be a native build. The question here is whether we want to change the provided interface of *-for-host or the expectation of consuming packages. And if we want to change the interface of *-for-host, then the question becomes what implementation strategy we prefer. Please observe that the issue around mpicc applies to all Linux distributions in the same way and that using .pc files fixes the problem for all Linux distributions uniformly. The issue around *-for-host very much is a Debian-specific thing. Helmut