File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 24
24
sys .argv .remove ("--use-cxx11-abi" )
25
25
CXX11_ABI = True
26
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
+
27
46
def build_libtrtorch_pre_cxx11_abi (develop = True , use_dist_dir = True , cxx11_abi = False ):
28
- cmd = ["/usr/bin/bazel" , "build" ]
47
+ cmd = [BAZEL_EXE , "build" ]
29
48
cmd .append ("//cpp/api/lib:libtrtorch.so" )
30
49
if develop :
31
50
cmd .append ("--compilation_mode=dbg" )
You can’t perform that action at this time.
0 commit comments