Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building on Mac M1 Monterrey #67

Open
douglaslassance opened this issue Nov 12, 2021 · 3 comments
Open

Error building on Mac M1 Monterrey #67

douglaslassance opened this issue Nov 12, 2021 · 3 comments

Comments

@douglaslassance
Copy link

douglaslassance commented Nov 12, 2021

Describe the bug

[1176/1181] Building CXX object Source/Core/CMakeFiles/ShaderConductor.dir/ShaderConductor.cpp.o
FAILED: Source/Core/CMakeFiles/ShaderConductor.dir/ShaderConductor.cpp.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DSHADER_CONDUCTOR_SOURCE -DShaderConductor_EXPORTS -I/Users/douglaslassance/Desktop/WIP/ShaderConductor/Include -I/Users/douglaslassance/Desktop/WIP/ShaderConductor/Build/Ninja-osx-clang-x64-Release/External/DirectXShaderCompiler/include -I/Users/douglaslassance/Desktop/WIP/ShaderConductor/External/DirectXShaderCompiler/include -I/Users/douglaslassance/Desktop/WIP/ShaderConductor/External/SPIRV-Cross -I/Users/douglaslassance/Desktop/WIP/ShaderConductor/External/SPIRV-Tools/include -std=c++1z -fms-extensions -Wno-language-extension-token -W -Wall -Werror -march=core2 -msse2 -Wno-missing-field-initializers -m64 -DNDEBUG -O2 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk -fPIC -MD -MT Source/Core/CMakeFiles/ShaderConductor.dir/ShaderConductor.cpp.o -MF Source/Core/CMakeFiles/ShaderConductor.dir/ShaderConductor.cpp.o.d -o Source/Core/CMakeFiles/ShaderConductor.dir/ShaderConductor.cpp.o -c /Users/douglaslassance/Desktop/WIP/ShaderConductor/Source/Core/ShaderConductor.cpp
clang: error: the clang compiler does not support '-march=core2'
[1177/1181] Building CXX object Source/Tests/CMakeFiles/ShaderConductorTest.dir/ShaderConductorTest.cpp.o
FAILED: Source/Tests/CMakeFiles/ShaderConductorTest.dir/ShaderConductorTest.cpp.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DTEST_DATA_DIR=\"/Users/douglaslassance/Desktop/WIP/ShaderConductor/Source/Tests/Data/\" -I/Users/douglaslassance/Desktop/WIP/ShaderConductor/Include -isystem /Users/douglaslassance/Desktop/WIP/ShaderConductor/External/googletest/googletest/include -isystem /Users/douglaslassance/Desktop/WIP/ShaderConductor/External/googletest/googletest -std=c++1z -fms-extensions -Wno-language-extension-token -W -Wall -Werror -march=core2 -msse2 -Wno-missing-field-initializers -m64 -DNDEBUG -O2 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk -MD -MT Source/Tests/CMakeFiles/ShaderConductorTest.dir/ShaderConductorTest.cpp.o -MF Source/Tests/CMakeFiles/ShaderConductorTest.dir/ShaderConductorTest.cpp.o.d -o Source/Tests/CMakeFiles/ShaderConductorTest.dir/ShaderConductorTest.cpp.o -c /Users/douglaslassance/Desktop/WIP/ShaderConductor/Source/Tests/ShaderConductorTest.cpp
clang: error: the clang compiler does not support '-march=core2'
[1178/1181] Building CXX object Source/Tools/CMakeFiles/ShaderConductorCmd.dir/ShaderConductorCmd.cpp.o
FAILED: Source/Tools/CMakeFiles/ShaderConductorCmd.dir/ShaderConductorCmd.cpp.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++  -I/Users/douglaslassance/Desktop/WIP/ShaderConductor/Include -I/Users/douglaslassance/Desktop/WIP/ShaderConductor/External/cxxopts/include -std=c++1z -fms-extensions -Wno-language-extension-token -W -Wall -Werror -march=core2 -msse2 -Wno-missing-field-initializers -m64 -DNDEBUG -O2 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk -MD -MT Source/Tools/CMakeFiles/ShaderConductorCmd.dir/ShaderConductorCmd.cpp.o -MF Source/Tools/CMakeFiles/ShaderConductorCmd.dir/ShaderConductorCmd.cpp.o.d -o Source/Tools/CMakeFiles/ShaderConductorCmd.dir/ShaderConductorCmd.cpp.o -c /Users/douglaslassance/Desktop/WIP/ShaderConductor/Source/Tools/ShaderConductorCmd.cpp
clang: error: the clang compiler does not support '-march=core2'
ninja: build stopped: subcommand failed.
[E] Build failed.

To reproduce

brew install ninja
git clone https://github.com/microsoft/ShaderConductor.git
cd ShaderConductor
python ./BuildAll.py Ninja clang

Additional context

❯ sw_vers
ProductName:	macOS
ProductVersion:	12.0.1
BuildVersion:	21A559
❯ clang --version
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: arm64-apple-darwin21.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
❯ python --version
Python 3.7.12

Also had to change BuildAll.py as such:

diff --git a/BuildAll.py b/BuildAll.py
index 9af0521..297e1bc 100644
--- a/BuildAll.py
+++ b/BuildAll.py
@@ -224,7 +224,7 @@ if __name__ == "__main__":
 		hostArch = "x64"
 	elif (hostArch == "i386"):
 		hostArch = "x86"
-	elif (hostArch == "ARM64"):
+	elif (hostArch.lower() == "arm64"):
 		hostArch = "arm64"
 	else:
 		LogError("Unknown host architecture %s.\n" % hostArch)
@douglaslassance
Copy link
Author

Created #68 for the Python script.

@pinguin999
Copy link

You can comment out this line in the CMakeList.txt

set(${flagVar} "${${flagVar}} -march=core2 -msse2")

Than I was able to compile it. But the Lib is still only build for x64 and I was not able to link it with my arm64 code.

@pinguin999
Copy link

Hi @douglaslassance I have a working build. Here is my diff pinguin999@08d2ff1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants