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 21
21
import platform
22
22
import logging
23
23
24
+ try :
25
+ from packaging .version import Version
26
+ except ImportError :
27
+ from distutils .version import LooseVersion as Version
28
+
24
29
import tensorflow as tf
25
30
26
31
_TFA_BAZELRC = ".bazelrc"
@@ -131,6 +136,11 @@ def create_build_configuration():
131
136
write ("build --strategy=Genrule=standalone" )
132
137
write ("build -c opt" )
133
138
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
+
134
144
if is_windows ():
135
145
write ("build --config=windows" )
136
146
write ("build:windows --enable_runfiles" )
@@ -145,7 +155,7 @@ def create_build_configuration():
145
155
write ("build --copt=-mavx" )
146
156
write ("build --cxxopt=-std=c++14" )
147
157
write ("build --host_cxxopt=-std=c++14" )
148
- write (' build --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"' )
158
+ write (" build --cxxopt=" + glibcxx )
149
159
150
160
if os .getenv ("TF_NEED_CUDA" , "0" ) == "1" :
151
161
print ("> Building GPU & CPU ops" )
You can’t perform that action at this time.
0 commit comments