Open oncealong opened 5 years ago
Looks like an old version of C++ compiler that we need for spirv_cross. What is your clang/gcc version?
I install XCode 10 and XCode 9.
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin18.0.0
Thread model: posix
InstalledDir: /Applications/Xcode_9.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Hello @oncealong . We are hiring full-time gfx-hal based project developers. We have both Beijing and Shenzhen offices. Feel free to contact me. See my GitHub info.
@oncealong Is that the output of clang --version
or c++ --version
? Could you try which c++
and c++ --version
?
@oncealong Is that the output of
clang --version
orc++ --version
? Could you trywhich c++
andc++ --version
?
➜ ~ clang --version
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin18.0.0
Thread model: posix
InstalledDir: /Applications/Xcode_9.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
➜ ~ c++ --version
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin18.0.0
Thread model: posix
InstalledDir: /Applications/Xcode_9.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
➜ ~ which c++
/usr/bin/c++
➜ ~ ls -al /usr/bin/c++
lrwxr-xr-x 1 root wheel 7 Oct 27 21:17 /usr/bin/c++ -> clang++
➜ ~
The followings is gcc output:
➜ ~ gcc --version
Configured with: --prefix=/Applications/Xcode_9.4.1.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin18.0.0
Thread model: posix
InstalledDir: /Applications/Xcode_9.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
➜ ~ which gcc
/usr/bin/gcc
➜ ~ ls -al /usr/bin/gcc
-rwxr-xr-x 1 root wheel 18288 Sep 21 12:16 /usr/bin/gcc
I'm getting the same error with the newer versions of clang/osx:
OSX 10.14.5
% c++ --version
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
% ls -la /usr/bin/c++
lrwxr-xr-x 1 root wheel 7 Jan 12 12:56 /usr/bin/c++ -> clang++
% ls -la /usr/bin/clang++
-rwxr-xr-x 1 root wheel 18304 May 4 00:04 /usr/bin/clang++
Is it possible that isn't the version of clang that the compiler is actually using internally?
I think I found the root of the issue.
In https://github.com/alexcrichton/cc-rs/blob/master/src/lib.rs#L2113, cc, looks at the compiler name to determine the type and falls back to gnu if none match.
For myself and @oncealong , where c++
is symlinked to clang++
it looks like cc
doesn't follow the symlink and, so, falls back to gnu.
Prepending CXX=$(which clang++)
to the command fixes the issue:
% CXX=$(which clang++) cargo run --bin quad --features metal
Filed https://github.com/alexcrichton/cc-rs/issues/408 in cc to track downstream bug.
Short info header:
just
git clone
andcd gfx/examples
, and runcargo run --bin quad --features metal
.backtrace: