Statically linking TensorFlow?

agolangf · · 498 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Hello!</p> <p>I am trying to make a completely self contained executable for my project, but I am unable to statically link TensorFlow. No linking flags or bazel build options help.</p> <p>Any advice?</p> <p>Thanks!</p> <hr/>**评论:**<br/><br/>phillydogg28: <pre><p>I followed this <a href="https://dominik.honnef.co/posts/2015/06/go-musl/" rel="nofollow">article</a> to learn how to do it. In the end I created a Dockerfile that used the golang base image, installed musl, then a build command with: <code>CC=/usr/local/musl/bin/musl-gcc GOOS=linux go build --ldflags &#39;-linkmode external -extldflags &#34;-static&#34;&#39; github.com/company/project</code></p></pre>wheey: <pre><p>Could you please provide a example which you already have tried and version of Go - would be appreciated.</p></pre>chocol4tebubble5: <pre><p>Sorry, I am on version 1.9. I&#39;ve used &#34;CGO_ENABLED=0 GOOS=linux go build -a -ldflags &#39;-extldflags &#34;-static&#34;&#39; &#34; as well as the same flags with cgo.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

498 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传