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

macOS arm64 custom build cannot link latest MoltenVK library with Xcode < 14 #68512

Open
GriffinSego opened this issue Nov 11, 2022 · 5 comments

Comments

@GriffinSego
Copy link

Godot version

latest master (d2bd8e5)

System information

macOS Monterey 12.0.1 M1 (arm64) Vulkan

Issue description

Following the godot latest docs' instructions to compile godot from source to arm64 fails.
I am able to compile to arch=x86_64 just fine by following the instructions, but when I attempt to compile to arm64 it fatals (complete error log: https://pastebin.com/MMUuUggt)
I have downloaded and installed Vulkan via the linked installer on the docs but it for some reason doesn't seem to have properly installed the arm64 libraries (x86_64 remain unaffected for some reason).

Images showing x86_64 working fine but arm64 failing are below.
image
image
image

Steps to reproduce

  1. Clone latest master
  2. Install latest stable Vulkan (Vulkan SDK 1.3.231) through the download page linked directly from the Godot docs
  3. cd to git dir
  4. copy and paste the scons compile commands from the Godot docs
  5. execute scons platform=macos arch=x86_64 --jobs=$(sysctl -n hw.logicalcpu) and it compiles with no errors
  6. execute scons platform=macos arch=arm64 --jobs=$(sysctl -n hw.logicalcpu) and it does not compile

Minimal reproduction project

No response

@Akylzhan
Copy link

Akylzhan commented Nov 14, 2022

Hello. It builds fine on M1 Pro, Ventura. Can you please run scons --clean to clean the object files and run the compilation again?
If it still fails, can you please install molten-vk from Homebrew and compile this branch? It is my own branch, I just added search for Homebrew's MoltenVK.

@GriffinSego
Copy link
Author

I ran scons --clean and brew installed molten-vk, but attempting to compile master to arm64 still failed, while x86 still worked. I'll compile macos-homebrew-moltenvk as soon as scons is done.

@bruvzg
Copy link
Member

bruvzg commented Nov 15, 2022

Try cleaning the tree with git clean -dfx (caution: remove all changed/new files in the build tree, including custom modules), scons --clean only removes objects for the specific build and usually won't help.

If it still fails, can you please install molten-vk from Homebrew and compile this branch? It is my own branch, I just added search for Homebrew's MoltenVK.

MoltenVK installed from homebrew currently is not auto-detected.

@bruvzg
Copy link
Member

bruvzg commented Nov 15, 2022

Actual issue is the same as #68080 (comment), MoltenVK SDK is compiled with XCode 14, and won't work with older versions of XCode.

@akien-mga
Copy link
Member

Actual issue is the same as #68080 (comment), MoltenVK SDK is compiled with XCode 14, and won't work with older versions of XCode.

Ah indeed, I hadn't seen it as the screenshot was cropped but the linking errors are in the pastebin. Copying here as pastebins tend to expire:

[100%] Undefined symbols for architecture arm64:
  "_objc_msgSend$HDR10MetadataWithDisplayInfo:contentInfo:opticalOutputScale:", referenced from:
      MVKSwapchain::setHDRMetadataEXT(VkHdrMetadataEXT const&) in libMoltenVK.a(libMoltenVK.a-arm64-master.o)
  "_objc_msgSend$UTF8String", referenced from:
      MVKCommandResourceFactory::newMTLFunction(NSString*, NSString*) in libMoltenVK.a(libMoltenVK.a-arm64-master.o)
      MVKCommandResourceFactory::initMTLLibrary() in libMoltenVK.a(libMoltenVK.a-arm64-master.o)
      MVKWatermark::newRenderPipelineState() in libMoltenVK.a(libMoltenVK.a-arm64-master.o)
      MVKWatermark::initShaders(char const*) in libMoltenVK.a(libMoltenVK.a-arm64-master.o)
      MVKGPUCounterQueryPool::initMTLCounterSampleBuffer(VkQueryPoolCreateInfo const*, id<MTLCounterSet>, char const*) in libMoltenVK.a(libMoltenVK.a-arm64-master.o)
      MVKInstance::debugReportMessage(MVKVulkanAPIObject*, MVKConfigLogLevel, char const*) in libMoltenVK.a(libMoltenVK.a-arm64-master.o)
      MVKBuffer::propagateDebugName() in libMoltenVK.a(libMoltenVK.a-arm64-master.o)
      ...

... etc.

We reported this issue upstream: KhronosGroup/MoltenVK#1756

For now your options are either:

@akien-mga akien-mga changed the title (Building engine from source) Cannot build binaries for target macos arm64 MoltenVK (Undefined symbols for architecture arm64) macOS arm64 custom build cannot link latest MoltenVK library with Xcode < 14 Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants