File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
build_tools/setup_helpers Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 33import subprocess
44from pathlib import Path
55
6+ import torch
67from torch .utils .cpp_extension import (
78 CppExtension ,
89 BuildExtension as TorchBuildExtension
@@ -109,12 +110,22 @@ def _get_libraries():
109110 return [] if _BUILD_SOX else ['sox' ]
110111
111112
113+ def _get_cxx11_abi ():
114+ try :
115+ value = int (torch ._C ._GLIBCXX_USE_CXX11_ABI )
116+ except ImportError :
117+ value = 0
118+ return f'-D_GLIBCXX_USE_CXX11_ABI={ value } '
119+
120+
112121def _build_third_party (base_build_dir ):
113122 build_dir = os .path .join (base_build_dir , 'third_party' )
114123 os .makedirs (build_dir , exist_ok = True )
115124 subprocess .run (
116125 args = [
117126 'cmake' ,
127+ f'-DCMAKE_CXX_FLAGS=\' { _get_cxx11_abi ()} \' ' ,
128+ f'-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON' ,
118129 f'-DCMAKE_INSTALL_PREFIX={ _TP_INSTALL_DIR } ' ,
119130 f'-DBUILD_SOX={ "ON" if _BUILD_SOX else "OFF" } ' ,
120131 f'-DBUILD_TRANSDUCER={ "ON" if _BUILD_TRANSDUCER else "OFF" } ' ,
You can’t perform that action at this time.
0 commit comments