def find_compiler(f, name, ext=''):
    compiler_found = 0
    path = os.environ.get('PATH')
    for dir in path.split(os.pathsep):
        binpath = os.path.join(dir, name) + ext
        if os.path.exists(binpath):
            codeOut=StringIO()
            f.write('  '+name+ext+' FOUND:  ')
            f.write(os.path.abspath(binpath))
            f.write('\n')
            compiler_found = 1


            #execute code here to get version as long as it's not "cl.exe"
            if name!="cl.exe":
                executable = os.path.abspath(binpath)
                result = subprocess.Popen([executable, '--version'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
                (fin, fout) = (result.stdin, result.stdout)
                f.write('  '+name+' version info: \n')
                f.write(fout.read())

    if not compiler_found:
        f.write('  '+name+ext+' NOT FOUND in PATH. \n\n')
This function will find compilers, print their paths,
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.util/src/openmdao/util/envirodump.py/find_compiler