tensorflow / swift

Swift for TensorFlow
https://tensorflow.org/swift
Apache License 2.0
6.12k stars 608 forks source link

Can't build with static-executable option #575

Closed geekpic closed 3 years ago

geekpic commented 3 years ago

single main.swift:

import TensorFlow
print("test")

try to build:

swiftc main.swift -static-executable -v

output:

Swift version 5.3-dev (LLVM fc462509514ed6a, Swift 9f72104dfb628c6)
Target: x86_64-unknown-linux-gnu
/home/swift/usr/bin/swift-frontend -frontend -c -primary-file main.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -color-diagnostics -module-name main -o /tmp/main-fe7059.o -use-static-resource-dir
main.swift:1:8: error: no such module 'TensorFlow'
import TensorFlow
       ^

Swift for TF snapshot from nightlies/latest/swift-tensorflow-DEVELOPMENT-ubuntu20.04.tar.gz Building without static-executable is ok

compnerd commented 3 years ago

We currently do not provide static versions of the products for the various projects. The particularly difficult one would be the TensorFlow library which we do not even have a way to build statically currently. The necessary work for supporting such a configuration is not a priority for the team, but if you would be interested in working on adding that support, I would be happy to review them.