예제 #1
0
def gcc_compiler(name):
    if name == '':
        compiler = find_gcc_compiler()
    else:
        compiler = GccCompiler(name)
    if compiler is None:
        raise argparse.ArgumentTypeError(
            f"Couldn't automatically find gcc compiler")
    elif not compiler.is_valid():
        raise argparse.ArgumentTypeError(
            f"Program {compiler} is not a supported gcc compiler")
    return compiler
예제 #2
0
 def find_compiler(self) -> Optional[Compiler]:
     return find_gcc_compiler() or find_clang_compiler()
예제 #3
0
 def find_compiler(self) -> Optional[Compiler]:
     if self.gpu:
         return find_nvcc_compiler()
     else:
         return find_gcc_compiler() or find_clang_compiler()