We have tried, as a sort of pet goal, to make building MPICH completely painless, despite the variety of target environments. This is a challenge. In earlier systems, such as p4, Chameleon, and Zipcode, it was assumed that a particular vendor name or operating system version was enough to determine how to build the system. This is too simplistic a view:
The same hardware may run multiple operating systems (Solaris or SunOS on suns, LINUX or FreeBSD on x86's)
Different versions of the same operating system may differ radically (SGI IRIX 5 is 32 bit, whereas IRIX 6 is 64; the number of parameters to some system calls in Solaris depends on the minor version number).
Different compilers may use different includes, datatype sizes, and libraries.
We use the GNU autoconf system to build a shell script (configure), which in turn executes various commands (including building and running programs) to determine the user's environment. It then creates Makefiles from makefile templates, as well as creating some scripts that contain site-specific information (such as the location of the wish interpreter).
The autoconf system as distributed provides commands for checking the part of a system that the GNU tools need; in MPICH, we have defined an additional set of operations that we found we needed in this and other projects. These include commands to test that the compiler produces correct code and to choose a vendor's compiler (with the correct options; this is particularly important for the massively parallel systems). In short, the configure script distributed with MPICH has evolved into a knowledge base about a wide variety of vendor environments.