Playing with Swift on Ubuntu 14.04 LTS

Apple release the Swift programming language as an open source project on Github a few days ago. They licensed it under Apache v2 which both surprised and impressed me.

Naturally, I wanted to play around with it on a Linux installation, so I opened VMware Fusion and rolled a brand new Ubuntu Desktop 14.04 LTS instance and started following along with the Readme.md file on Github.

Edit: It turns out I needed to assign more than 4GB RAM to the Ubuntu VM. Wow!

Pretty straightforward stuff, but it didn’t work for me at first. I was getting repeatable weird linker failures. The first thing I tried was updating ninja-build to be bootstrapped as part of the build instead of using the packaged one. That didn’t make any difference.

Oddly (or not… I don’t know) I ran the command line that was logged when the build failed manually from the build directory [build/Ninja-DebugAssert/llvm-linux-x86_64] and it worked but it took quite a while. I wonder if there’s some sort of timeout getting triggered.

Just for giggles, here’s the most recent linker failure that I’ve run across trying to build Swift:

/usr/bin/clang++   -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wcovered-switch-default -Wnon-virtual-dtor -Werror=date-time -std=c++11 -fcolor-diagnostics -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -g  -L/home/robbiew/src/build/Ninja-DebugAssert/swift-linux-x86_64/./lib/swift/linux tools/lldb-moduleimport-test/CMakeFiles/lldb-moduleimport-test.dir/lldb-moduleimport-test.cpp.o  -o bin/lldb-moduleimport-test -L/home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib  -L/home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/./lib -rdynamic lib/libswiftASTSectionImporter.a lib/libswiftFrontend.a lib/libswiftClangImporter.a lib/libswiftOption.a lib/libswiftSIL.a lib/libswiftParse.a lib/libswiftSema.a lib/libswiftSIL.a lib/libswiftParse.a lib/libswiftSema.a lib/libswiftSerialization.a lib/libswiftClangImporter.a lib/libswiftAST.a lib/libswiftBasic.a -luuid lib/libswiftMarkup.a /home/robbiew/src/build/Ninja-DebugAssert/cmark-linux-x86_64/src/libcmark.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libclangCodeGen.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libclangIndex.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libclangFormat.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libclangToolingCore.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libclangFrontendTool.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libclangFrontend.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libclangDriver.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libclangSerialization.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libclangParse.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libclangSema.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libclangAnalysis.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libclangEdit.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libclangRewriteFrontend.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libclangRewrite.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libclangAST.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libclangLex.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libclangAPINotes.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libclangBasic.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMIRReader.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMAsmParser.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMDebugInfoDWARF.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMObjCARCOpts.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMipo.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMProfileData.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMVectorize.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMOption.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMX86AsmParser.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMX86CodeGen.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMX86Desc.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMObject.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMX86AsmPrinter.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMX86Utils.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMX86Disassembler.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMX86Info.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMARMCodeGen.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMARMAsmParser.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMARMDisassembler.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMARMDesc.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMARMAsmPrinter.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMARMInfo.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMAArch64CodeGen.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMAsmPrinter.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMSelectionDAG.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMCodeGen.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMBitReader.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMBitWriter.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMInstrumentation.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMScalarOpts.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMInstCombine.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMTransformUtils.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMTarget.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMAnalysis.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMCore.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMAArch64AsmParser.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMMCParser.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMAArch64Disassembler.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMAArch64Desc.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMAArch64AsmPrinter.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMAArch64Info.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMMCDisassembler.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMMC.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMAArch64Utils.a /home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib/libLLVMSupport.a -lrt -ldl -ltinfo -lpthread -lm -Wl,-rpath,/home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/lib:/home/robbiew/src/build/Ninja-DebugAssert/llvm-linux-x86_64/./lib

One thought on “Playing with Swift on Ubuntu 14.04 LTS”

Leave a Reply to Hosting Deutschland Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>