<编辑>:requirements here请求ang版本3.6也在ubuntu 14.04.我已经第一次尝试了这些第一步,使用俚语3.4,但是已经按照链接中的说明更新到3.6,然后重试.相同的结果.< / Edit>
我已经下载了https://swift.org/builds/ubuntu1404/swift-2.2-SNAPSHOT-2015-12-01-b/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04.tar.gz〜〜/下载/.安捷威成绩单和第一步:
$cd /tmp $tar xf ~/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04.tar.gz $PATH=/tmp/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04/usr/bin/:"$PATH" $clang++ --version Ubuntu clang version 3.6.0-2ubuntu1~trusty1 (tags/RELEASE_360/final) (based on LLVM 3.6.0) Target: x86_64-pc-linux-gnu Thread model: posix $which swift /tmp/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04/usr/bin//swift $swift --version Swift version 2.2-dev (LLVM 46be9ff861,Clang 4deb154edc,Swift 778f82939c) Target: x86_64-unknown-linux-gnu $swift Welcome to Swift version 2.2-dev (LLVM 46be9ff861,Swift 778f82939c). Type :help for assistance. 1> 1 + 2 opening import file for module 'SwiftShims': No such file or directory 1>
根据this getting started guide应该打印
$R0: Int = 3
怎么了,怎么解决?
编辑:尝试手动找到该文件:显然不包含在安装中:
$find swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04/ | grep -i shims swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04/usr/lib/swift/shims swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04/usr/lib/swift/shims/FoundationShims.h swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04/usr/lib/swift/shims/SwiftStddef.h swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04/usr/lib/swift/shims/module.map swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04/usr/lib/swift/shims/UnicodeShims.h swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04/usr/lib/swift/shims/GlobalObjects.h swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04/usr/lib/swift/shims/HeapObject.h swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04/usr/lib/swift/shims/RuntimeShims.h swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04/usr/lib/swift/shims/RefCount.h swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04/usr/lib/swift/shims/RuntimeStubs.h swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04/usr/lib/swift/shims/LibcShims.h swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04/usr/lib/swift/shims/CoreFoundationShims.h swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04/usr/lib/swift/shims/SwiftStdint.h
编辑:当我尝试swift build
helloworld example,这个输出产生:
/tmp/Hello$swift build <unknown>:0: error: opening import file for module 'Swift': No such file or directory swift-build: exit(1): ["/tmp/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04/usr/bin/swiftc","--driver-mode=swift","-I","/tmp/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu14.04/usr/lib/swift/pm","-L","-lPackageDescription","/tmp/Hello/Package.swift"]
编辑:新发现到2015-12-22
自从我发布了这个问题,至少有两个swift for linux的快照已经发布:2015-12-10和2015-12-18.我已经尝试了这些,但是他们并没有解决这个问题.
这个邮件列表线程(post 1,post 2,post 3)也是一样的问题.有人建议在主目录下安装swift将有所帮助.这在我的情况下没有帮助,错误信息仍然是一样的.
更有趣的是,邮件列表线程包含an analysis of the REPL error created with strace.将特定的strace输出与REPL工作的系统的strace输出进行比较是非常有趣的.
编辑:更多信息,直到2015-12-26:
2015-12-22发布新版本.此版本显示相同的问题.
关于这个问题的另一个线索已经出现在快速邮件列表starting here上.遇到问题的用户也已经发布了strace output here.
解决方法
具体来说,我不得不跑
sudo apt-get install ppa-purge sudo ppa-purge -d trusty ppa:ubuntu-toolchain-r/test
在清理过程中,ppa-purge正在抱怨,为了解决冲突,它必须删除在Ubuntu Trusty回购中找不到的几个包(包括真正的核心,如build-essential,xorg,gcc,x11- xserver-utils …),所以我做了一个笔记,并在清除后立即重新安装.只要非常小心
我认为在安装g 4.9时被覆盖的一些图书馆正在造成冲突.我已经在一个新鲜的Mint安装上验证了所有这一切.