Skip to content

Commit eed2180

Browse files
Amit Patankarangerson
Amit Patankar
authored andcommitted
Include absl headers in pip package (tensorflow#22159)
PiperOrigin-RevId: 212067303
1 parent 6f1986b commit eed2180

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

tensorflow/tools/pip_package/setup.py

+13-7
Original file line numberDiff line numberDiff line change
@@ -167,17 +167,21 @@ def mkdir_and_copy_file(self, header):
167167
# directories for -I
168168
install_dir = re.sub('/google/protobuf_archive/src', '', install_dir)
169169

170-
# Copy eigen code into tensorflow/include.
170+
# Copy external code headers into tensorflow/include.
171171
# A symlink would do, but the wheel file that gets created ignores
172172
# symlink within the directory hierarchy.
173173
# NOTE(keveman): Figure out how to customize bdist_wheel package so
174174
# we can do the symlink.
175-
if 'tensorflow/include/external/eigen_archive/' in install_dir:
176-
extra_dir = install_dir.replace(
177-
'tensorflow/include/external/eigen_archive', '')
178-
if not os.path.exists(extra_dir):
179-
self.mkpath(extra_dir)
180-
self.copy_file(header, extra_dir)
175+
external_header_locations = [
176+
'tensorflow/include/external/eigen_archive/',
177+
'tensorflow/include/external/com_google_absl/',
178+
]
179+
for location in external_header_locations:
180+
if location in install_dir:
181+
extra_dir = install_dir.replace(location, '')
182+
if not os.path.exists(extra_dir):
183+
self.mkpath(extra_dir)
184+
self.copy_file(header, extra_dir)
181185

182186
if not os.path.exists(install_dir):
183187
self.mkpath(install_dir)
@@ -227,6 +231,8 @@ def find_files(pattern, root):
227231
list(find_files('*.h', 'tensorflow/stream_executor')) +
228232
list(find_files('*.h', 'google/protobuf_archive/src')) +
229233
list(find_files('*', 'third_party/eigen3')) +
234+
list(find_files('*.h',
235+
'tensorflow/include/external/com_google_absl')) +
230236
list(find_files('*', 'tensorflow/include/external/eigen_archive')))
231237

232238
setup(

0 commit comments

Comments
 (0)