Since Swift Open source, the building of Swift will no longer have to have the necessary Mac, on the open source of Ubuntu can also install the SWIFT compiler environment, today idle bored began to build an environment to play. Morning to get a half-day of the SWIFT environment, finally set up after the dead and alive can not use, but also shows the following error:
BASH:/home/swift-2.2.1-release-ubuntu15.10/usr/bin/swift:cannot execute binary file:exec format error
Surfing the internet for a long time, tried n method, can still not line, finally rage to the SWIFT official website to see a bit, the results found that Ubuntu must be 64bit , so again download 64-bit version began to install.
Note: If you are afraid of input errors, it is recommended to install SECURECRT software by installing SSH service on Ubuntu and telnet to Ubuntu "
$ sudo apt-get install SSH
$ service SSH Start
1. First, install the appropriate tools
$ sudo apt-get install clang Libicu-dev
2. Then, start downloading the Swift library (https://swift.org/download/#releases offers different versions of Ubuntu download, mine is ubuntu15.10)
$ wget https://swift.org/builds/swift-2.2.1-release/ubuntu1510/swift-2.2.1-RELEASE/swift-2.2.1-RELEASE-ubuntu15.10.tar.gz
3. Then, unzip the downloaded file
$ tar xvf swift-2.2.1-release-ubuntu15.10.tar.gz
4. Finally, set the path (enter the extracted directory, then enter Usr/bin, use the command pwd to get the current path, fill in the following path=, and at the end add: "${path}")
Export path=/home/zx/swift-2.2.1-release-ubuntu15.10/usr/bin: "${path}"
The effect is as follows:
[Email protected]:~$ Swift--version
Swift version 2.2.1 (swift-2.2.1-release)
Target:x86_64-unknown-linux-gnu
Install the SWIFT environment on UBUNTU15.10