<p dir="auto">I'm trying to use <code class="notranslate">TF_LoadLibrary</code> on a mac and I keep getting errors such as:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Caused by: org.platanios.tensorflow.jni.TensorFlow$NativeException: dlopen(/var/folders/rw/lqrc8nk52kqcc4_zq3c2b6dh0000gn/T/tensorflow_scala_native_libraries7467192138547554485/libtensorflow_ops.dylib, 6): Symbol not found: __ZN10tensorflow15shape_inference12UnknownShapeEPNS0_16InferenceContextE
  Referenced from: /var/folders/rw/lqrc8nk52kqcc4_zq3c2b6dh0000gn/T/tensorflow_scala_native_libraries7467192138547554485/libtensorflow_ops.dylib
  Expected in: flat namespace
 in /var/folders/rw/lqrc8nk52kqcc4_zq3c2b6dh0000gn/T/tensorflow_scala_native_libraries7467192138547554485/libtensorflow_ops.dylib"><pre class="notranslate"><code class="notranslate">Caused by: org.platanios.tensorflow.jni.TensorFlow$NativeException: dlopen(/var/folders/rw/lqrc8nk52kqcc4_zq3c2b6dh0000gn/T/tensorflow_scala_native_libraries7467192138547554485/libtensorflow_ops.dylib, 6): Symbol not found: __ZN10tensorflow15shape_inference12UnknownShapeEPNS0_16InferenceContextE
  Referenced from: /var/folders/rw/lqrc8nk52kqcc4_zq3c2b6dh0000gn/T/tensorflow_scala_native_libraries7467192138547554485/libtensorflow_ops.dylib
  Expected in: flat namespace
 in /var/folders/rw/lqrc8nk52kqcc4_zq3c2b6dh0000gn/T/tensorflow_scala_native_libraries7467192138547554485/libtensorflow_ops.dylib
</code></pre></div>
<p dir="auto">The same thing happens when I try to load the compiled dylib file through Python directly. It was compiled it using <code class="notranslate">-D_GLIBCXX_USE_CXX11_ABI=0</code> and <code class="notranslate">-undefined dynamic_lookup</code> for the linker. <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/asimshankar/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/asimshankar">@asimshankar</a></p>
<p dir="auto">As reported in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="115914766" data-permission-text="Title is private" data-url="https://github.com/tensorflow/tensorflow/issues/10" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/10/hovercard?comment_id=272045853&amp;comment_type=issue_comment" href="https://github.com/tensorflow/tensorflow/issues/10#issuecomment-272045853">#10 (comment)</a> , the following test (at head: <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/tensorflow/tensorflow/commit/d4b5c606fc9fbd1a20b5b113b4bc831f31d889a3/hovercard" href="https://github.com/tensorflow/tensorflow/commit/d4b5c606fc9fbd1a20b5b113b4bc831f31d889a3"><tt>d4b5c60</tt></a>):</p>
<div class="highlight highlight-source-go notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="package bug

import (
        &quot;testing&quot;

        tf &quot;github.com/tensorflow/tensorflow/tensorflow/go&quot;
        &quot;github.com/tensorflow/tensorflow/tensorflow/go/op&quot;
)

func TestBug(t *testing.T) {
        scope := op.NewScope()
        op.Placeholder(scope.Subscope(&quot;x&quot;), tf.Float)
        op.Placeholder(scope.Subscope(&quot;y&quot;), tf.Float)
        if _, err := scope.Finalize(); err != nil {
                t.Fatal(err)
        }
}"><pre class="notranslate"><span class="pl-k">package</span> bug

<span class="pl-k">import</span> (
        <span class="pl-s">"testing"</span>

        tf <span class="pl-s">"github.com/tensorflow/tensorflow/tensorflow/go"</span>
        <span class="pl-s">"github.com/tensorflow/tensorflow/tensorflow/go/op"</span>
)

<span class="pl-k">func</span> <span class="pl-en">TestBug</span>(<span class="pl-s1">t</span> <span class="pl-c1">*</span>testing.<span class="pl-smi">T</span>) {
        <span class="pl-s1">scope</span> <span class="pl-c1">:=</span> <span class="pl-s1">op</span>.<span class="pl-en">NewScope</span>()
        <span class="pl-s1">op</span>.<span class="pl-en">Placeholder</span>(<span class="pl-s1">scope</span>.<span class="pl-en">Subscope</span>(<span class="pl-s">"x"</span>), <span class="pl-s1">tf</span>.<span class="pl-c1">Float</span>)
        <span class="pl-s1">op</span>.<span class="pl-en">Placeholder</span>(<span class="pl-s1">scope</span>.<span class="pl-en">Subscope</span>(<span class="pl-s">"y"</span>), <span class="pl-s1">tf</span>.<span class="pl-c1">Float</span>)
        <span class="pl-k">if</span> <span class="pl-s1">_</span>, <span class="pl-s1">err</span> <span class="pl-c1">:=</span> <span class="pl-s1">scope</span>.<span class="pl-en">Finalize</span>(); <span class="pl-s1">err</span> <span class="pl-c1">!=</span> <span class="pl-c1">nil</span> {
                <span class="pl-s1">t</span>.<span class="pl-en">Fatal</span>(<span class="pl-s1">err</span>)
        }
}</pre></div>
<p dir="auto">fails with:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="--- FAIL: TestBug (0.01s)
	bug_test.go:15: failed to add operation &quot;Placeholder&quot;: Duplicate node name in graph: 'Placeholder' (Stacktrace: goroutine 19 [running]:
		runtime/debug.Stack(0x0, 0x0, 0x0)
			/usr/local/go/src/runtime/debug/stack.go:24 +0x79
		github.com/tensorflow/tensorflow/tensorflow/go/op.(*Scope).UpdateErr(0xc420072420, 0x411b8ac, 0xb, 0x4196640, 0xc42007c030)
			/home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/op/scope.go:106 +0x72
		github.com/tensorflow/tensorflow/tensorflow/go/op.(*Scope).AddOperation(0xc420072420, 0x411b8ac, 0xb, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc420072450, 0x4108b00)
			/home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/op/scope.go:70 +0xbf
		github.com/tensorflow/tensorflow/tensorflow/go/op.Placeholder(0xc420072420, 0x1, 0x0, 0x0, 0x0, 0xc42006e4f0, 0x0)
			/home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/op/wrappers.go:4734 +0x1c7
		github.com/tensorflow/tensorflow/tensorflow/go/b10.TestBug(0xc420098180)
			/home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/b10/bug_test.go:13 +0xd2
		testing.tRunner(0xc420098180, 0x4129d88)
			/usr/local/go/src/testing/testing.go:610 +0x81
		created by testing.(*T).Run
			/usr/local/go/src/testing/testing.go:646 +0x2ec
		)"><pre class="notranslate">--- FAIL: TestBug (0.01s)
	bug_test.go:15: failed to add operation <span class="pl-s"><span class="pl-pds">"</span>Placeholder<span class="pl-pds">"</span></span>: Duplicate node name <span class="pl-k">in</span> graph: <span class="pl-s"><span class="pl-pds">'</span>Placeholder<span class="pl-pds">'</span></span> (Stacktrace: goroutine 19 [running]:
		runtime/debug.Stack(0x0, 0x0, 0x0)
			/usr/local/go/src/runtime/debug/stack.go:24 +0x79
		github.com/tensorflow/tensorflow/tensorflow/go/op.(<span class="pl-k">*</span>Scope).UpdateErr(0xc420072420, 0x411b8ac, 0xb, 0x4196640, 0xc42007c030)
			/home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/op/scope.go:106 +0x72
		github.com/tensorflow/tensorflow/tensorflow/go/op.(<span class="pl-k">*</span>Scope).AddOperation(0xc420072420, 0x411b8ac, 0xb, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc420072450, 0x4108b00)
			/home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/op/scope.go:70 +0xbf
		github.com/tensorflow/tensorflow/tensorflow/go/op.Placeholder(0xc420072420, 0x1, 0x0, 0x0, 0x0, 0xc42006e4f0, 0x0)
			/home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/op/wrappers.go:4734 +0x1c7
		github.com/tensorflow/tensorflow/tensorflow/go/b10.TestBug(0xc420098180)
			/home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/b10/bug_test.go:13 +0xd2
		testing.tRunner(0xc420098180, 0x4129d88)
			/usr/local/go/src/testing/testing.go:610 +0x81
		created by testing.(<span class="pl-k">*</span>T).Run
			/usr/local/go/src/testing/testing.go:646 +0x2ec
		)</pre></div>
<p dir="auto">(Thanks for pointing this out <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/sdeoras/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/sdeoras">@sdeoras</a>).</p>