File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 2121import platform
2222import logging
2323
24+ try :
25+ from packaging .version import Version
26+ except ImportError :
27+ from distutils .version import LooseVersion as Version
28+
2429import tensorflow as tf
2530
2631_TFA_BAZELRC = ".bazelrc"
@@ -131,6 +136,11 @@ def create_build_configuration():
131136 write ("build --strategy=Genrule=standalone" )
132137 write ("build -c opt" )
133138
139+ if Version (tf .__version__ ) >= Version ("2.9.0" ):
140+ glibcxx = '"-D_GLIBCXX_USE_CXX11_ABI=1"'
141+ else :
142+ glibcxx = '"-D_GLIBCXX_USE_CXX11_ABI=0"'
143+
134144 if is_windows ():
135145 write ("build --config=windows" )
136146 write ("build:windows --enable_runfiles" )
@@ -145,7 +155,7 @@ def create_build_configuration():
145155 write ("build --copt=-mavx" )
146156 write ("build --cxxopt=-std=c++14" )
147157 write ("build --host_cxxopt=-std=c++14" )
148- write (' build --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"' )
158+ write (" build --cxxopt=" + glibcxx )
149159
150160 if os .getenv ("TF_NEED_CUDA" , "0" ) == "1" :
151161 print ("> Building GPU & CPU ops" )
You can’t perform that action at this time.
0 commit comments