MCPcopy Create free account
hub / github.com/apache/tvm / get_cc

Function get_cc

python/tvm/support/cc.py:42–64  ·  view source on GitHub ↗

Return the path to the default C/C++ compiler. Returns ------- out: Optional[str] The path to the default C/C++ compiler, or None if none was found.

()

Source from the content-addressed store, hash-verified

40
41
42def get_cc():
43 """Return the path to the default C/C++ compiler.
44
45 Returns
46 -------
47 out: Optional[str]
48 The path to the default C/C++ compiler, or None if none was found.
49 """
50
51 if not _is_linux_like():
52 return None
53
54 env_cxx = os.environ.get("CXX") or os.environ.get("CC")
55 if env_cxx:
56 return env_cxx
57 cc_names = ["g++", "gcc", "clang++", "clang", "c++", "cc"]
58 dirs_in_path = os.get_exec_path()
59 for cc in cc_names:
60 for d in dirs_in_path:
61 cc_path = os.path.join(d, cc)
62 if os.path.isfile(cc_path) and os.access(cc_path, os.X_OK):
63 return cc_path
64 return None
65
66
67def create_shared(output, objects, options=None, cc=None, cwd=None, ccache_env=None):

Callers 3

create_sharedFunction · 0.85
create_executableFunction · 0.85
cc.pyFile · 0.85

Calls 3

_is_linux_likeFunction · 0.85
getMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…