Interoperability
Shared libraries have still one more advantage: Programs that use the same shared libraries will never have to worry about compatibility with each other. As a case in point, we had some trouble with the initial FSL 4.0.0 port to FreeBSD. The output data sets seemed to be somewhat off. They failed the FSL FEEDS tests, and when displayed in fslview or AFNI, they appeared distorted. The same distortion appeared in output produced by virtually all the FSL programs, suggesting that the problem must lie in some code commonly used by all of them. It turned out to be zlib. The FSL distribution contains its own zlib source code, which is used by the FSL build scripts. AFNI and fslview were using the system zlib, which is part of the FreeBSD base. A slight incompatibility between the two of them caused the distortion problem. Tweaking the port to use the system zlib instead of the one packaged with FSL resolved this issue.There are many common libraries used by MRI research tools, such as zlib, nifti, fslio, vtk, irtk, qt, qwt, gtk, and minc, just to name a few. If each program uses its own version of these libraries, there will be problems when you try to share data between them, if you can even get them all installed on the same system. If you're lucky, the problem will be obvious, as it was with the FSL zlib issue. It could, however, be more subtle, and go unnoticed for days or weeks before you notice the problem in your results.
It's not always feasible to install multiple versions of the libraries on the same system, since they might interfere with each other. Some programs avoid this problem by simply using static libraries and distributing the programs in binary form. This will save the end user from any compilation issues. The problem with this approach is that it doesn't do anything for the interoperability issue, and if you're using binary distributions, you're restricted to the platforms that the software was built on by the authors. Different program authors don't always support the same platforms, so you might not be able to install them on the same machine. BTW, don't get the impression that a program built on "Linux" will run on any Linux system. There are many different Linux distributions, and they aren't 100% compatible with each other. It may be difficult to take an RPM built on the latest Fedora or RedHat and get it running on an old SuSE system, for example.