Skip to content

Conversation

SignalRT
Copy link
Collaborator

Linked with the issue:
#1277 (comment)

I seems that should be done something similar on LINUX (not done in this PR)

Reference llama.cpp PR

…amic libraries search for dependencies in their origin directory
@martindevans martindevans requested a review from Copilot October 14, 2025 11:06
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR configures CMake RPATH settings for macOS builds to ensure executables and dynamic libraries search for dependencies in their origin directory using the @loader_path directive.

  • Adds CMake RPATH configuration for all three macOS build variants (arm64, x64, x64-rosetta2)
  • Sets CMAKE_INSTALL_RPATH to @loader_path and enables CMAKE_BUILD_WITH_INSTALL_RPATH

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +463 to +467
defines: '-DCMAKE_OSX_ARCHITECTURES=arm64 -DGGML_METAL_EMBED_LIBRARY=ON -DCMAKE_INSTALL_RPATH=''@loader_path'' -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON '
- build: 'x64'
defines: '-DCMAKE_OSX_ARCHITECTURES=x86_64 -DGGML_METAL=OFF -DGGML_AVX=ON -DGGML_AVX2=ON'
defines: '-DCMAKE_OSX_ARCHITECTURES=x86_64 -DGGML_METAL=OFF -DGGML_AVX=ON -DGGML_AVX2=ON -DCMAKE_INSTALL_RPATH=''@loader_path'' -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON '
- build: 'x64-rosetta2'
defines: '-DCMAKE_OSX_ARCHITECTURES=x86_64 -DGGML_METAL=OFF -DGGML_AVX=OFF -DGGML_AVX2=OFF'
defines: '-DCMAKE_OSX_ARCHITECTURES=x86_64 -DGGML_METAL=OFF -DGGML_AVX=OFF -DGGML_AVX2=OFF -DCMAKE_INSTALL_RPATH=''@loader_path'' -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON '
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RPATH configuration -DCMAKE_INSTALL_RPATH='@loader_path' -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON is duplicated across all three build configurations. Consider extracting this into a shared variable or base configuration to reduce duplication and improve maintainability.

Copilot uses AI. Check for mistakes.

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

Successfully merging this pull request may close these issues.

1 participant