Skip to content

Compile bug: #28491

Description

@EAddario

Git commit

2bf0415

Operating systems

Mac

GGML backends

Metal

Problem description & steps to reproduce

When building #27815 with BUILD_SHARED_LIBS=OFF ggml-rpc is a static archive and never links so librdma symbols stay undefined.

Fix is simple, in ggml/src/ggml-rpc/CMakeLists.txt change target_link_options(ggml-rpc PRIVATE "LINKER:-weak_library,${RDMA_LIB}") with target_link_options(ggml-rpc PUBLIC "LINKER:-weak_library,${RDMA_LIB}")

First Bad Commit

2bf0415

Compile command

cmake --build build --config Release

Relevant log output

-- llama.cpp version: 0.3.0-dev
CMAKE_BUILD_TYPE=Release
-- ccache found, compilation results will be cached. Disable with GGML_CCACHE=OFF.
-- CMAKE_SYSTEM_PROCESSOR: arm64
-- GGML_SYSTEM_ARCH: ARM
-- Including CPU backend
-- Accelerate framework found
-- ARM detected
CMake Warning at ggml/src/ggml-cpu/CMakeLists.txt:138 (message):
  ARM -march/-mcpu not found, -mcpu=native will be used
Call Stack (most recent call first):
  ggml/src/CMakeLists.txt:584 (ggml_add_cpu_backend_variant_impl)


-- Checking for ARM features using flags:
--   -U__ARM_FEATURE_SVE
--   -mcpu=native+dotprod+i8mm+nosve+sme
-- Adding CPU backend variant ggml-cpu: -U__ARM_FEATURE_SVE;-mcpu=native+dotprod+i8mm+nosve+sme
-- BLAS found, Libraries: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework
-- BLAS found, Includes:
-- Including BLAS backend
-- Metal framework found
-- Including METAL backend
-- Using RPC backend
--   RDMA transport enabled (Apple RDMA-over-Thunderbolt, UC)
-- Including RPC backend
-- ggml version: 0.22.0
-- ggml commit:  2bf041515
-- OpenSSL found: 3.6.4
-- Generating embedded license file for target: llama-app
-- Configuring done (0.2s)
-- Generating done (0.3s)
-- Build files have been written to: /Users/ed/Development/C++/llama.cpp/build
[  1%] Built target llama-gemma3-cli
[  2%] Building CXX object common/CMakeFiles/llama-common-base.dir/build-info.cpp.o

...

[ 18%] Linking CXX executable ../../bin/llama-gguf
[ 18%] Linking CXX executable ../../bin/llama-gguf-hash
[ 19%] Linking CXX executable ../../bin/ggml-rpc-server
[ 20%] Linking CXX executable ../../bin/ggml-metal-tuning
Undefined symbols for architecture arm64:
  "_ibv_alloc_pd", referenced from:
      apple_rdma::probe(int, unsigned char const*, unsigned char*) in libggml-rpc.a[4](transport-apple.cpp.o)
  "_ibv_close_device", referenced from:
      apple_rdma::probe(int, unsigned char const*, unsigned char*) in libggml-rpc.a[4](transport-apple.cpp.o)
      apple_rdma::impl::~impl() in libggml-rpc.a[4](transport-apple.cpp.o)

...

ld: symbol(s) not found for architecture arm64
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

...

[ 50%] Linking CXX static library libllama.a
[ 50%] Built target llama
-- UI: archive verified and extracted
-- UI: HF download succeeded, stamp updated (b10694)
-- UI: gzip compression applied (/Users/ed/Development/C++/llama.cpp/build/tools/ui/dist/_gzip)
embed: write output file /Users/ed/Development/C++/llama.cpp/build/tools/ui/ui.cpp
[ 50%] Built target llama-ui-assets
make: *** [all] Error 2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions