Potential fix for how pip installs headers used for custom ops.
authorMichael Case <mikecase@google.com>
Thu, 28 Jun 2018 18:24:37 +0000 (11:24 -0700)
committerMichael Case <mikecase@google.com>
Thu, 28 Jun 2018 21:01:36 +0000 (14:01 -0700)
These headers were recently moved from site-packages/external into
site-packages/tensorflow/include/external. Need to update setup.py
to reflect that.

RELEASE.md
tensorflow/tools/pip_package/setup.py

index 52cd9ef72b1804c78ca14d901400685ffaa3530f..21207a7efaba181d8fc42fef673608f28c41adb8 100644 (file)
@@ -24,6 +24,7 @@
 ## Breaking Changes
   * If you're opening empty variable scopes; replace `variable_scope('', ...)` by
     `variable_scope(tf.get_variable_scope(), ...)`.
+  * Headers used for building custom ops have been moved from site-packages/external into site-packages/tensorflow/include/external.
 
 ## Bug Fixes and Other Changes
 
index ed7ce01b6b642c69c87e7bb693414ecfc98ce606..8c077580aafccbd97786152607c787c5cf0407fb 100644 (file)
@@ -170,8 +170,9 @@ class InstallHeaders(Command):
     # symlink within the directory hierarchy.
     # NOTE(keveman): Figure out how to customize bdist_wheel package so
     # we can do the symlink.
-    if 'external/eigen_archive/' in install_dir:
-      extra_dir = install_dir.replace('external/eigen_archive', '')
+    if 'tensorflow/include/external/eigen_archive/' in install_dir:
+      extra_dir = install_dir.replace(
+          'tensorflow/include/external/eigen_archive', '')
       if not os.path.exists(extra_dir):
         self.mkpath(extra_dir)
       self.copy_file(header, extra_dir)
@@ -204,13 +205,12 @@ def find_files(pattern, root):
       yield os.path.join(dirpath, filename)
 
 
-matches = ['../' + x for x in find_files('*', 'external') if '.py' not in x]
-
 so_lib_paths = [
     i for i in os.listdir('.')
     if os.path.isdir(i) and fnmatch.fnmatch(i, '_solib_*')
 ]
 
+matches = []
 for path in so_lib_paths:
   matches.extend(
       ['../' + x for x in find_files('*', path) if '.py' not in x]
@@ -225,7 +225,7 @@ headers = (list(find_files('*.h', 'tensorflow/core')) +
            list(find_files('*.h', 'tensorflow/stream_executor')) +
            list(find_files('*.h', 'google/protobuf_archive/src')) +
            list(find_files('*', 'third_party/eigen3')) +
-           list(find_files('*', 'external/eigen_archive')))
+           list(find_files('*', 'tensorflow/include/external/eigen_archive')))
 
 setup(
     name=project_name,