Move default library path search to program context
The default library path search is now implemented in
CommandLineProgramContext, and accessible through the generic interface.
This provides the following benefits:
- All the magic for finding stuff from the binary path is in a single
place, under the commandline/ module, where it belongs.
- Code using the library path is now in C++, fixing some potential
buffer overruns and removing the need for some utility code.
- Programs using the Gromacs library can customize how the library data
files are found.
- PATH_SEPARATOR is no longer exposed outside path.cpp, encapsulating
this detail.
- The library path is only searched once during the execution of the
binary, reducing the amount of file I/O done if multiple data files
are accessed.
- The library path is printed in the startup header, making it explicit
where they are read (helpful in particular if there are problems with
it, or the user may have multiple installations). The GMXLIB
override doesn't currently affect this printout; maybe it should, but
I don't want to put the environment variable (and the support for
multiple directories) into the program context.
Change-Id: I4d099215ef7e1f269d4c7a42989835d980bc1566
12 files changed: