I ran into some trouble while trying to build the Swift Benchmark Suite Independently.
Since I didn't want to clone the entire Swift repo, I did a shallow clone:
$ git init SwiftBenchmarkSuite
$ cd SwiftBenchmarkSuite/
$ git remote add origin https://github.com/apple/swift.git
$ git config core.sparsecheckout true
$ echo "benchmark/*" >> .git/info/sparse-checkout
$ git pull --depth=1 origin master
Which was quick and seems to work fine.
So now I wanted to build, following the instructions (see above link):
$ sudo xcode-select -s /Applications/Xcode.app/
$ cd SwiftBenchmarkSuite/
$ cd benchmark/
$ mkdir build
$ cd build
$ cmake ..
-bash: cmake: command not found
I downloaded and installed:
https://cmake.org/files/v3.11/cmake-3.11.3-Darwin-x86_64.dmg
(I'm trying to keep this computer "clean", without brew, macports etc, so I went with the dmg)
$ /Applications/CMake.app/Contents/bin/cmake ..
-- The C compiler identification is AppleClang 9.1.0.9020039
-- The CXX compiler identification is AppleClang 9.1.0.9020039
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at cmake/modules/SwiftBenchmarkUtils.cmake:61 (message):
Unable to find Clang driver
Call Stack (most recent call first):
cmake/modules/AddSwiftBenchmarkSuite.cmake:27 (runcmd)
CMakeLists.txt:253 (configure_build)
-- Configuring incomplete, errors occurred!
See also "/Users/jens/sf/SwiftBenchmarkSuite/benchmark/build/CMakeFiles/CMakeOutput.log".
I don't know what is meant by "Unable to find Clang driver", as I do have clang:
$ clang --version
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Is the clang driver something other than clang
?
Also looking at
benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake:27
It seems to essentially do
$ xcrun -toolchain macosx10.17 -f clang
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
Which works (as above).