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 2424 sys .argv .remove ("--use-cxx11-abi" )
2525 CXX11_ABI = True
2626
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+
2746def 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" ]
2948 cmd .append ("//cpp/api/lib:libtrtorch.so" )
3049 if develop :
3150 cmd .append ("--compilation_mode=dbg" )
You can’t perform that action at this time.
0 commit comments