Generates and logs a hash to distinguish this particular installation
		of the program (on a certain host, with a certain compiler, program
		version, etc.)

		Specify the optional 'binary' argument if the wrapper name is not
		actually the program, e.g. if your program has a Perl wrapper script.
		Set 'binary' to the binary program that is likely to change between
		versions.

		Specify the optional 'cmd' argument if the command to run for version
		information is different than what will be invoked by `run` (e.g.
		if the program has a perl wrapper script, but you want to version an
		underlying binary executable).

def version(self, flag=None, cmd=None, path=None):
		"""
		Generates and logs a hash to distinguish this particular installation
		of the program (on a certain host, with a certain compiler, program
		version, etc.)

		Specify the optional 'binary' argument if the wrapper name is not
		actually the program, e.g. if your program has a Perl wrapper script.
		Set 'binary' to the binary program that is likely to change between
		versions.

		Specify the optional 'cmd' argument if the command to run for version
		information is different than what will be invoked by `run` (e.g.
		if the program has a perl wrapper script, but you want to version an
		underlying binary executable).
		"""

		# Setup the command to run.
		if not cmd:
			cmd = list(self.cmd)
		if flag:
			cmd.append(flag)

		# Run the command.
		try:
			vstring = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
		except subprocess.CalledProcessError as e:
			vstring = e.output
		except OSError as e:
			utils.failed_executable(cmd[0], e)

		if not path:
			path = cmd[0]

		# Generate a hash.
		vhash = diagnostics.log_program_version(self.name, vstring, path)
		if vhash:
			diagnostics.prefix.append(self.name)
			diagnostics.log('version', vhash)
			diagnostics.prefix.pop()