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: Build with Homebrew-provided Vulkan dependencies #621

Closed
rgov opened this issue Oct 29, 2023 · 12 comments
Closed

macOS: Build with Homebrew-provided Vulkan dependencies #621

rgov opened this issue Oct 29, 2023 · 12 comments
Assignees

Comments

@rgov
Copy link

rgov commented Oct 29, 2023

The build instructions for macOS call for some dependencies to be installed from Homebrew formulae and others to come from the LunarG VulkanSDK.

There are also brew formulae for many components of the VulkanSDK. Just grepping for formulae from the KhronosGroup GitHub organization:

glslang
molten-vk
opencl-clhpp-headers
opencl-headers
opencl-icd-loader
shaderc
spirv-cross
spirv-headers
spirv-llvm-translator
spirv-tools
vulkan-extensionlayer
vulkan-headers
vulkan-loader
vulkan-tools
vulkan-validationlayers

However I am unsure which VulkanSDK components are actually needed to build ngscopeclient. Could you please clarify?

Using the dependencies from Homebrew is likely a requirement to have an install formula for ngscopeclient accepted upstream.


Homebrew formula

ngscopeclient/homebrew-ngscopeclient#1

@azonenberg
Copy link
Collaborator

@rgov rgov changed the title Build on macOS with Homebrew-provided Vulkan dependencies macOS: Build with Homebrew-provided Vulkan dependencies Oct 29, 2023
@lainy lainy self-assigned this Nov 4, 2023
@d235j
Copy link
Collaborator

d235j commented Jan 22, 2024

I've been working on this. A change to Homebrew will be required as they are currently building shaderc without BULD_SHARED_LIBS enabled.

FindVulkan is going away upstream as well, so I'm eliminating the use of its functionality from scopehal / scopehal-apps proper; VkFFT still uses it though.

@rgov
Copy link
Author

rgov commented Jan 22, 2024

Nice. Not sure if you saw the formula I had in the expandable part of the first post, but it's a good starting point.

@d235j
Copy link
Collaborator

d235j commented Feb 10, 2024

Fixed in #673.

@d235j d235j closed this as completed Feb 10, 2024
@rgov
Copy link
Author

rgov commented Feb 10, 2024

I built HEAD successfully from Homebrew, after uninstalling the Vulkan SDK.

  depends_on "shaderc" => :build
  depends_on "glslang"
  depends_on "spirv-tools"
  depends_on "vulkan-headers" => :build
  depends_on "vulkan-loader"

  on_macos do
    depends_on "molten-vk"
  end

Does that look right? I'm not sure about runtime vs build time dependencies. The formula ideally works on Linux too, but I haven't tried it.

@d235j
Copy link
Collaborator

d235j commented Feb 10, 2024

Yeah I think that looks right. I would test by unlinking the build dependencies and seeing if it runs.

We will still have to deal with #623 and #624 before this formula can be recommended to others. Also, see my comment regarding #622.

@rgov
Copy link
Author

rgov commented Feb 10, 2024

Ok, formula is working again with Homebrew dependencies after I fixed #688 by including the appropriate RPATH.

Formula includes workarounds for #623, #624 and #687.

@rgov
Copy link
Author

rgov commented Feb 12, 2024

@azonenberg At this point we can pretty much submit this to Homebrew, but I can already predict they'd prefer you tagged a release rather than always installing from HEAD.

@d235j
Copy link
Collaborator

d235j commented Feb 12, 2024

@rgov A while ago Homebrew moved to binary-first, so we'll have to wait until there is a release before doing so. That said, we could create a tap. However, there are some issues with installation (e.g. hardcoded paths in #624 and plugin search issues in #623) that have to be fixed first.

@rgov
Copy link
Author

rgov commented Feb 12, 2024

My formula at the top of this page already patches #623 and #624 with workarounds for the Homebrew prefix, so those aren't blockers at this moment.

@d235j
Copy link
Collaborator

d235j commented Feb 20, 2024

@rgov would you like to PR your formula to https://github.com/ngscopeclient/homebrew-ngscopeclient, or should I add it?

@rgov
Copy link
Author

rgov commented Feb 20, 2024

Ready for review: ngscopeclient/homebrew-ngscopeclient#1

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

4 participants