'Run after install to tell the configuration files and Makefiles
to use the compilers that Spack built the package with.
If this isn\'t done, they\'ll have CC and CXX set to Spack\'s generic
cc and c++. We want them to be bound to whatever compiler
they were built with.'

def filter_compilers(self, prefix):

    kwargs = {'ignore_absent': True, 'backup': False, 'string': True}
    lib_dirnames = [join_path(lib_dir, 'python{0}'.format(self.version.up_to(2))) for lib_dir in [prefix.lib, prefix.lib64]]
    config_dirname = ('config-{0}m'.format(self.version.up_to(2)) if self.spec.satisfies('@3:') else 'config')
    rel_filenames = [self.sysconfigfilename, join_path(config_dirname, 'Makefile')]
    abs_filenames = [join_path(dirname, filename) for dirname in lib_dirnames for filename in rel_filenames]
    filter_file(env['CC'], self.compiler.cc, *abs_filenames, **kwargs)
    filter_file(env['CXX'], self.compiler.cxx, *abs_filenames, **kwargs)
