title: Failed to build Retrainer by Bazel
body: <p>When installing  the retrainer in the TensorFlow following <a href="https://www.tensorflow.org/versions/master/how_tos/image_retraining/index.html" rel="nofollow">this</a> on OSX(10.9.5) , Bazel:0.2.2-b, CUDA:7.5, cuDNN:v5  python:2.7</p>
  
  <pre><code>$bazel build tensorflow/examples/image_retraining:retrain
  </code></pre>
  
  <p>I encountered the following error. Any ideas?</p>
  
  <blockquote>
    <p>ERROR: /Users/hoshinotoshihiko/tensorflow/google/protobuf/BUILD:272:1:
    C++ compilation of rule '//google/protobuf:protoc' failed:
    osx_cc_wrapper.sh failed: </p>
    
    <p>error executing command 
    (cd/private/var/tmp/_bazel_hoshinotoshihiko/ff5db7423b3afa0d045a736d77207f89/tensorflow
    &amp;&amp; \exec env - 
    \PATH='/usr/local/lib:/usr/lib:/Users/hoshinotoshihiko/exec -l
    /bin/bash/google-cloud-sdk/bin:/usr/local/cuda/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/hoshinotoshihiko/bin'TMPDIR=/var/folders/y6/78v3zz4j1bj6nq7bl82c3cj80000gn/T/
    \external/local_config_cc/osx_cc_wrapper.sh -U_FORTIFY_SOURCE
    '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wthread-safety
    -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections -g0 '-std=c++0x' -iquote . -iquote bazel-out/host/genfiles -iquote external/bazel_tools -iquote
    bazel-out/host/genfiles/external/bazel_tools -isystem
    google/protobuf/src -isystem
    bazel-out/host/genfiles/google/protobuf/src -isystem
    external/bazel_tools/tools/cpp/gcc3 -no-canonical-prefixes
    -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"'
    '-D__TIME__="redacted"'
    '-frandom-seed=bazel-out/host/bin/google/protobuf/_objs/protoc/google/protobuf/src/google/protobuf/compiler/main.o'
    -MD -MF bazel-out/host/bin/google/protobuf/_objs/protoc/google/protobuf/src/google/protobuf/compiler/main.d
    -c google/protobuf/src/google/protobuf/compiler/main.cc -o bazel-out/host/bin/google/protobuf/_objs/protoc/google/protobuf/src/google/protobuf/compiler/main.o):</p>
    
    <p>com.google.devtools.build.lib.shell.BadExitStatusException: Process
    exited with status 126.</p>
    
    <p>external/local_config_cc/osx_cc_wrapper.sh: line 56:
    /usr/local/lib/gcc: is a directory</p>
    
    <p>Target //tensorflow/examples/image_retraining:retrain failed to build</p>
    
    <p>INFO: Elapsed time: 20.672s, Critical Path: 20.22s</p>
  </blockquote>