Issue 1:
System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No. This is on a clean checkout of tensorflow.

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): OSX Sierra

TensorFlow installed from (source or binary): source

TensorFlow version (use command below): building from master (command outputs 1.3.0)

Python version: 2.7

Bazel version (if compiling from source): 0.6.0

GCC/Compiler version (if compiling from source):

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1

Apple LLVM version 9.0.0 (clang-900.0.38)

Target: x86_64-apple-darwin16.7.0

Thread model: posix

InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

CUDA/cuDNN version: N/A (ran ./configure without CUDA)

GPU model and memory: N/A (no GPU)

Exact command to reproduce:

Check out tensorflow

Run ./configure, enable XLA support

cd tensorflow/compiler/aot

bazel build :tfcompile

Describe the problem

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->arg_begin(), function->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.

This happens across multiple OSes, as well (we tried to compile on a unix distro with the same error).

Source code / logs

This seems to stem from a recent change in kernel_support_library.cc (specifically c572bc4#diff-877daea43ebeb1cd4756f960400ee922 ).

Issue 2:
System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): OSX 10.13.2

TensorFlow installed from (source or binary): Source

TensorFlow version (use command below): Top of Master (34bcd09)

Python version:

Bazel version (if compiling from source): 0.7.0

GCC/Compiler version (if compiling from source): Apple LLVM version 9.0.0 (clang-900.0.39.2)

CUDA/cuDNN version: N/A

GPU model and memory: N/A

Exact command to reproduce:

bazel build tensorflow/compiler/aot/tfcompile

Describe the problem

Compiler error when compiling tfcompile on OSX. This was introduced by @sanjoy Commit:

c572bc4

You will need this PR to be able to fix other compile issues on OSX. #14893

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).

tensorflow/compiler/xla/service/llvm_ir/kernel_support_library.cc:99:5: error: no matching function for call to 'transform'

std::transform(function->arg_begin(), function->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.

Target //tensorflow/compiler/aot:tfcompile failed to build

Source code / logs

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

+ std::transform(function->arg_begin(), function->arg_end(),
+ std::back_inserter(arg_values), std::addressof<llvm::Value>);