<h3 dir="auto">System information</h3>
<ul dir="auto">
<li><strong>MacOS High Sierra 10.13.2</strong>:</li>
<li><strong>Python 3.6.3</strong>:</li>
<li><strong>TensorFlow Latest Pull from 1/17/18</strong>:</li>
</ul>
<h3 dir="auto">Describe the problem</h3>
<p dir="auto">I am following Pete Warden's TensorFlow for Mobile Poets guide and seem to have a found an error. When I run "tensorflow/contrib/makefile/build_all_ios.sh" after about 20 minutes it returns an error.</p>
<p dir="auto">I have tried running lipo -info /Users/ryan/Downloads/tensorflow2/tensorflow/contrib/makefile/gen/protobuf_ios/lib/libprotobuf.a</p>
<p dir="auto">and this returns:</p>
<p dir="auto">Architectures in the fat file:<br>
/Users/ryan/Downloads/tensorflow2/tensorflow/contrib/makefile/gen/protobuf_ios/lib/libprotobuf.a are: i386</p>
<p dir="auto">I have the entire error script here:<br>
<a href="https://drive.google.com/file/d/1JovTMGBJKbqzRPBzXy3cIQ-hbz76n0ab/view?usp=sharing" rel="nofollow">https://drive.google.com/file/d/1JovTMGBJKbqzRPBzXy3cIQ-hbz76n0ab/view?usp=sharing</a></p>
<h3 dir="auto">Source code / logs</h3>
<p dir="auto">ld: symbol(s) not found for architecture x86_64<br>
clang: error: linker command failed with exit code 1 (use -v to see<br>
invocation)<br>
make: *** [/Users/ryan/Desktop/tensorflow-<br>
master/tensorflow/contrib/makefile/gen/bin/ios_X86_64/benchmark] Error 1</p>
<ul dir="auto">
<li>'[' 2 -ne 0 ']'</li>
<li>echo 'x86_64 compilation failed.'<br>
x86_64 compilation failed.</li>
<li>exit 1</li>
</ul>
<p dir="auto">I try to build tensorflow support at Android and iOS by makefile <a href="https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/makefile">tutorial</a> in current master branch <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/tensorflow/tensorflow/commit/04c318b69c5b565436cfeeaab1cb7fd5419dde27/hovercard" href="https://github.com/tensorflow/tensorflow/commit/04c318b69c5b565436cfeeaab1cb7fd5419dde27"><tt>04c318b</tt></a></p>
<p dir="auto">When running the build_all_ios.sh script, the below error message show</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Undefined symbols for architecture x86_64:
  &quot;nsync::nsync_mu_init(nsync::nsync_mu_s_*)&quot;, referenced from:
      tensorflow::mutex::mutex() in env.o
      tensorflow::mutex::mutex() in random.o
  &quot;nsync::nsync_mu_lock(nsync::nsync_mu_s_*)&quot;, referenced from:
      tensorflow::mutex::lock() in env.o
      tensorflow::mutex::lock() in random.o
      tensorflow::mutex::lock() in histogram.o
  &quot;nsync::nsync_mu_unlock(nsync::nsync_mu_s_*)&quot;, referenced from:
      tensorflow::mutex::unlock() in env.o
      tensorflow::mutex::unlock() in random.o
      tensorflow::mutex::unlock() in histogram.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/CSL.Peter/tensorflow/tensorflow/tensorflow/contrib/makefile/gen/host_bin/proto_text] Error 1
+ '[' 2 -ne 0 ']'
+ echo 'armv7 compilation failed.'
armv7 compilation failed.
+ exit 1"><pre class="notranslate"><code class="notranslate">Undefined symbols for architecture x86_64:
  "nsync::nsync_mu_init(nsync::nsync_mu_s_*)", referenced from:
      tensorflow::mutex::mutex() in env.o
      tensorflow::mutex::mutex() in random.o
  "nsync::nsync_mu_lock(nsync::nsync_mu_s_*)", referenced from:
      tensorflow::mutex::lock() in env.o
      tensorflow::mutex::lock() in random.o
      tensorflow::mutex::lock() in histogram.o
  "nsync::nsync_mu_unlock(nsync::nsync_mu_s_*)", referenced from:
      tensorflow::mutex::unlock() in env.o
      tensorflow::mutex::unlock() in random.o
      tensorflow::mutex::unlock() in histogram.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/CSL.Peter/tensorflow/tensorflow/tensorflow/contrib/makefile/gen/host_bin/proto_text] Error 1
+ '[' 2 -ne 0 ']'
+ echo 'armv7 compilation failed.'
armv7 compilation failed.
+ exit 1
</code></pre></div>
<p dir="auto">The <code class="notranslate">download_dependencies.sh</code> and <code class="notranslate">compile_ios_protobuf.sh</code> run successfully but <code class="notranslate">compile_ios_tensorflow.sh</code> failed. I find same issues <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="163769328" data-permission-text="Title is private" data-url="https://github.com/tensorflow/tensorflow/issues/3191" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/3191/hovercard" href="https://github.com/tensorflow/tensorflow/issues/3191">#3191</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="175520820" data-permission-text="Title is private" data-url="https://github.com/tensorflow/tensorflow/issues/4252" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/4252/hovercard" href="https://github.com/tensorflow/tensorflow/issues/4252">#4252</a> and seem to be fixed at <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="175904236" data-permission-text="Title is private" data-url="https://github.com/tensorflow/tensorflow/issues/4287" data-hovercard-type="pull_request" data-hovercard-url="/tensorflow/tensorflow/pull/4287/hovercard" href="https://github.com/tensorflow/tensorflow/pull/4287">#4287</a>, but this problem still happen.</p>