<h3 dir="auto">System information</h3>
<ul dir="auto">
<li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>: No.  This is on a clean checkout of tensorflow.</li>
<li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>:  OSX Sierra</li>
<li><strong>TensorFlow installed from (source or binary)</strong>: source</li>
<li><strong>TensorFlow version (use command below)</strong>: building from master (command outputs 1.3.0)</li>
<li><strong>Python version</strong>:  2.7</li>
<li><strong>Bazel version (if compiling from source)</strong>:  0.6.0</li>
<li><strong>GCC/Compiler version (if compiling from source)</strong>:<br>
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1<br>
Apple LLVM version 9.0.0 (clang-900.0.38)<br>
Target: x86_64-apple-darwin16.7.0<br>
Thread model: posix<br>
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin</li>
<li><strong>CUDA/cuDNN version</strong>: N/A (ran ./configure without CUDA)</li>
<li><strong>GPU model and memory</strong>: N/A (no GPU)</li>
<li><strong>Exact command to reproduce</strong>:</li>
</ul>
<ol dir="auto">
<li>Check out tensorflow</li>
<li>Run ./configure, enable XLA support</li>
<li>cd tensorflow/compiler/aot</li>
<li>bazel build :tfcompile</li>
</ol>
<h3 dir="auto">Describe the problem</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR: /Users/mattrunchey/gitrepos/tensorflow/tensorflow/compiler/xla/service/llvm_ir/BUILD:171:1: C++ compilation of rule '//tensorflow/compiler/xla/service/llvm_ir:kernel_support_library' failed (Exit 1).
tensorflow/compiler/xla/service/llvm_ir/kernel_support_library.cc:101:5: error: no matching function for call to 'transform'
    std::transform(function-&gt;arg_begin(), function-&gt;arg_end(),
    ^~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:1922:1: note: candidate template ignored: couldn't infer template argument '_UnaryOperation'
transform(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _UnaryOperation __op)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:1932:1: note: candidate function template not viable: requires 5 arguments, but 4 were provided
transform(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2,
^
1 error generated."><pre class="notranslate"><code class="notranslate">ERROR: /Users/mattrunchey/gitrepos/tensorflow/tensorflow/compiler/xla/service/llvm_ir/BUILD:171:1: C++ compilation of rule '//tensorflow/compiler/xla/service/llvm_ir:kernel_support_library' failed (Exit 1).
tensorflow/compiler/xla/service/llvm_ir/kernel_support_library.cc:101:5: error: no matching function for call to 'transform'
    std::transform(function-&gt;arg_begin(), function-&gt;arg_end(),
    ^~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:1922:1: note: candidate template ignored: couldn't infer template argument '_UnaryOperation'
transform(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _UnaryOperation __op)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:1932:1: note: candidate function template not viable: requires 5 arguments, but 4 were provided
transform(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2,
^
1 error generated.
</code></pre></div>
<p dir="auto">This happens across multiple OSes, as well (we tried to compile on a unix distro with the same error).</p>
<h3 dir="auto">Source code / logs</h3>
<p dir="auto">This seems to stem from a recent change in kernel_support_library.cc (specifically <a class="commit-link" href="https://github.com/tensorflow/tensorflow/commit/c572bc4fd7c73f4b8014ae43cdf9da5b99592f59#diff-877daea43ebeb1cd4756f960400ee922"><tt>c572bc4</tt>#diff-877daea43ebeb1cd4756f960400ee922</a> ).</p>
<h3 dir="auto">System information</h3>
<ul dir="auto">
<li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>: No</li>
<li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>: OSX 10.13.2</li>
<li><strong>TensorFlow installed from (source or binary)</strong>: Source</li>
<li><strong>TensorFlow version (use command below)</strong>: Top of Master (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/tensorflow/tensorflow/commit/34bcd09c5fd4f6435517a499987b7e5044c8f2c0/hovercard" href="https://github.com/tensorflow/tensorflow/commit/34bcd09c5fd4f6435517a499987b7e5044c8f2c0"><tt>34bcd09</tt></a>)</li>
<li><strong>Python version</strong>:</li>
<li><strong>Bazel version (if compiling from source)</strong>:   0.7.0</li>
<li><strong>GCC/Compiler version (if compiling from source)</strong>: Apple LLVM version 9.0.0 (clang-900.0.39.2)</li>
<li><strong>CUDA/cuDNN version</strong>: N/A</li>
<li><strong>GPU model and memory</strong>: N/A</li>
<li><strong>Exact command to reproduce</strong>:</li>
</ul>
<p dir="auto">bazel build tensorflow/compiler/aot/tfcompile</p>
<h3 dir="auto">Describe the problem</h3>
<p dir="auto">Compiler error when compiling tfcompile on OSX. This was introduced by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/sanjoy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/sanjoy">@sanjoy</a>  Commit:<br>
<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/tensorflow/tensorflow/commit/c572bc4fd7c73f4b8014ae43cdf9da5b99592f59/hovercard" href="https://github.com/tensorflow/tensorflow/commit/c572bc4fd7c73f4b8014ae43cdf9da5b99592f59"><tt>c572bc4</tt></a></p>
<p dir="auto">You will need this PR to be able to fix other compile issues on OSX. <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="276869770" data-permission-text="Title is private" data-url="https://github.com/tensorflow/tensorflow/issues/14893" data-hovercard-type="pull_request" data-hovercard-url="/tensorflow/tensorflow/pull/14893/hovercard" href="https://github.com/tensorflow/tensorflow/pull/14893">#14893</a></p>
<p dir="auto">ERROR: /Users/tfninja/github/tensorflow/tensorflow/compiler/xla/service/llvm_ir/BUILD:171:1: C++ compilation of rule '//tensorflow/compiler/xla/service/llvm_ir:kernel_support_library' failed (Exit 1).<br>
tensorflow/compiler/xla/service/llvm_ir/kernel_support_library.cc:99:5: error: no matching function for call to 'transform'<br>
std::transform(function-&gt;arg_begin(), function-&gt;arg_end(),<br>
^~~~~~~~~~~~~~<br>
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:1922:1: note: candidate template ignored: couldn't infer template argument '_UnaryOperation'<br>
transform(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _UnaryOperation __op)<br>
^<br>
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/algorithm:1932:1: note: candidate function template not viable: requires 5 arguments, but 4 were provided<br>
transform(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2,<br>
^<br>
1 error generated.<br>
Target //tensorflow/compiler/aot:tfcompile failed to build</p>
<h3 dir="auto">Source code / logs</h3>
<p dir="auto">The issue seems to be with this line of code in which works on Linux but fails on OSX/Clang tensorflow/compiler/xla/service/llvm_ir/kernel_support_library.cc</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="+    std::transform(function-&gt;arg_begin(), function-&gt;arg_end(),
+                   std::back_inserter(arg_values), std::addressof&lt;llvm::Value&gt;);"><pre class="notranslate"><code class="notranslate">+    std::transform(function-&gt;arg_begin(), function-&gt;arg_end(),
+                   std::back_inserter(arg_values), std::addressof&lt;llvm::Value&gt;);
</code></pre></div>