We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ea5ff08 commit 737fe5cCopy full SHA for 737fe5c
py/setup.py
@@ -24,8 +24,27 @@
24
sys.argv.remove("--use-cxx11-abi")
25
CXX11_ABI = True
26
27
+def which(program):
28
+ import os
29
+ def is_exe(fpath):
30
+ return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
31
+
32
+ fpath, fname = os.path.split(program)
33
+ if fpath:
34
+ if is_exe(program):
35
+ return program
36
+ else:
37
+ for path in os.environ["PATH"].split(os.pathsep):
38
+ exe_file = os.path.join(path, program)
39
+ if is_exe(exe_file):
40
+ return exe_file
41
42
+ return None
43
44
+BAZEL_EXE = which("bazel")
45
46
def build_libtrtorch_pre_cxx11_abi(develop=True, use_dist_dir=True, cxx11_abi=False):
- cmd = ["/usr/bin/bazel", "build"]
47
+ cmd = [BAZEL_EXE, "build"]
48
cmd.append("//cpp/api/lib:libtrtorch.so")
49
if develop:
50
cmd.append("--compilation_mode=dbg")
0 commit comments