<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 '-linkmode external -extldflags "-static"' 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've used "CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' " as well as the same flags with cgo.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
0 回复
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传