Skip to content

ruby: linker errors #3259

@glaszig

Description

@glaszig

gem version 1.3.1 installs fine. 1.3.2 and current master fail linking:

linking shared-object whisper.bundle
ld: warning: object file (libggml.a(ggml-backend-reg.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libwhisper.a(whisper.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-blas.a(ggml-blas.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-metal.a(ggml-metal.m.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-cpu.a(ggml-cpu.c.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libcommon.a(common.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-base.a(ggml.c.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-cpu.a(ggml-cpu.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-cpu.a(repack.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-cpu.a(hbm.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-cpu.a(quants.c.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libcommon.a(common-ggml.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-cpu.a(traits.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-cpu.a(amx.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-cpu.a(mmq.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-cpu.a(binary-ops.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-base.a(ggml.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-base.a(ggml-alloc.c.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libcommon.a(common-whisper.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-cpu.a(unary-ops.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-base.a(ggml-backend.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-metal.a(ggml-metal-embed.s.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-cpu.a(vec.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-base.a(ggml-opt.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-cpu.a(ops.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-base.a(ggml-threading.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-base.a(ggml-quants.c.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-cpu.a(quants.c.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-base.a(gguf.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libggml-cpu.a(repack.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
ld: warning: object file (libcommon.a(grammar-parser.cpp.o)) was built for newer macOS version (12.7) than being linked (12.0)
Undefined symbols for architecture arm64:
  "_MTLCopyAllDevices", referenced from:
      _ggml_metal_init in libggml-metal.a(ggml-metal.m.o)
  "_MTLCreateSystemDefaultDevice", referenced from:
      _ggml_backend_metal_device_acq in libggml-metal.a(ggml-metal.m.o)
  "_OBJC_CLASS_$_MTLCaptureDescriptor", referenced from:
      objc-class-ref in libggml-metal.a(ggml-metal.m.o)
  "_OBJC_CLASS_$_MTLCaptureManager", referenced from:
      objc-class-ref in libggml-metal.a(ggml-metal.m.o)
  "_OBJC_CLASS_$_MTLCompileOptions", referenced from:
      objc-class-ref in libggml-metal.a(ggml-metal.m.o)
  "_OBJC_CLASS_$_MTLHeapDescriptor", referenced from:
      objc-class-ref in libggml-metal.a(ggml-metal.m.o)
  "_OBJC_CLASS_$_NSMutableArray", referenced from:
      objc-class-ref in libggml-metal.a(ggml-metal.m.o)
  "_OBJC_CLASS_$_NSMutableDictionary", referenced from:
      objc-class-ref in libggml-metal.a(ggml-metal.m.o)
  "_OBJC_CLASS_$_NSNumber", referenced from:
      objc-class-ref in libggml-metal.a(ggml-metal.m.o)
  "_OBJC_CLASS_$_NSObject", referenced from:
      _OBJC_CLASS_$_ggml_metal_heap_ptr in libggml-metal.a(ggml-metal.m.o)
  "_OBJC_CLASS_$_NSString", referenced from:
      objc-class-ref in libggml-metal.a(ggml-metal.m.o)
  "_OBJC_CLASS_$_NSURL", referenced from:
      objc-class-ref in libggml-metal.a(ggml-metal.m.o)
  "_OBJC_METACLASS_$_NSObject", referenced from:
      _OBJC_METACLASS_$_ggml_metal_heap_ptr in libggml-metal.a(ggml-metal.m.o)
  "___CFConstantStringClassReference", referenced from:
      CFString in libggml-metal.a(ggml-metal.m.o)
      CFString in libggml-metal.a(ggml-metal.m.o)
      CFString in libggml-metal.a(ggml-metal.m.o)
      CFString in libggml-metal.a(ggml-metal.m.o)
      CFString in libggml-metal.a(ggml-metal.m.o)
      CFString in libggml-metal.a(ggml-metal.m.o)
      CFString in libggml-metal.a(ggml-metal.m.o)
      ...
  "__objc_empty_cache", referenced from:
      _OBJC_METACLASS_$_ggml_metal_heap_ptr in libggml-metal.a(ggml-metal.m.o)
      _OBJC_CLASS_$_ggml_metal_heap_ptr in libggml-metal.a(ggml-metal.m.o)
  "_cblas_sgemm", referenced from:
      ggml_backend_blas_graph_compute(ggml_backend*, ggml_cgraph*) in libggml-blas.a(ggml-blas.cpp.o)
  "_objc_alloc", referenced from:
      _ggml_metal_init in libggml-metal.a(ggml-metal.m.o)
  "_objc_alloc_init", referenced from:
      _ggml_metal_init in libggml-metal.a(ggml-metal.m.o)
      _ggml_metal_mem_pool_alloc in libggml-metal.a(ggml-metal.m.o)
  "_objc_autoreleasePoolPop", referenced from:
      _ggml_metal_init in libggml-metal.a(ggml-metal.m.o)
      _ggml_backend_metal_graph_compute in libggml-metal.a(ggml-metal.m.o)
  "_objc_autoreleasePoolPush", referenced from:
      _ggml_metal_init in libggml-metal.a(ggml-metal.m.o)
      _ggml_backend_metal_graph_compute in libggml-metal.a(ggml-metal.m.o)
  "_objc_enumerationMutation", referenced from:
      _ggml_metal_init in libggml-metal.a(ggml-metal.m.o)
      _ggml_backend_metal_free in libggml-metal.a(ggml-metal.m.o)
      _ggml_metal_heap_reset in libggml-metal.a(ggml-metal.m.o)
      _ggml_metal_encode_node in libggml-metal.a(ggml-metal.m.o)
      _ggml_metal_mem_pool_alloc in libggml-metal.a(ggml-metal.m.o)
  "_objc_opt_new", referenced from:
      _ggml_metal_init in libggml-metal.a(ggml-metal.m.o)
      _ggml_backend_metal_graph_compute in libggml-metal.a(ggml-metal.m.o)
      _ggml_metal_mem_pool_alloc in libggml-metal.a(ggml-metal.m.o)
  "_objc_release", referenced from:
      _ggml_backend_metal_buffer_type_alloc_buffer in libggml-metal.a(ggml-metal.m.o)
      _ggml_backend_metal_buffer_type_get_max_size in libggml-metal.a(ggml-metal.m.o)
      _ggml_metal_init in libggml-metal.a(ggml-metal.m.o)
      _ggml_backend_metal_buffer_free_buffer in libggml-metal.a(ggml-metal.m.o)
      _ggml_backend_metal_free in libggml-metal.a(ggml-metal.m.o)
      _ggml_metal_heap_reset in libggml-metal.a(ggml-metal.m.o)
      ___ggml_backend_metal_set_n_cb_block_invoke in libggml-metal.a(ggml-metal.m.o)
      ...
  "_vDSP_maxv", referenced from:
      _ggml_compute_forward_soft_max in libggml-cpu.a(ops.cpp.o)
      _ggml_compute_forward_flash_attn_back in libggml-cpu.a(ops.cpp.o)
      _ggml_compute_forward_cross_entropy_loss in libggml-cpu.a(ops.cpp.o)
      _ggml_compute_forward_cross_entropy_loss_back in libggml-cpu.a(ops.cpp.o)
  "_vDSP_sve", referenced from:
      _ggml_compute_forward_sum_rows in libggml-cpu.a(ops.cpp.o)
      _ggml_compute_forward_mean in libggml-cpu.a(ops.cpp.o)
      _ggml_compute_forward_cross_entropy_loss in libggml-cpu.a(ops.cpp.o)
  "_vDSP_vadd", referenced from:
      _ggml_compute_forward_add1 in libggml-cpu.a(ops.cpp.o)
      _ggml_compute_forward_acc in libggml-cpu.a(ops.cpp.o)
      _ggml_compute_forward_add_non_quantized in libggml-cpu.a(binary-ops.cpp.o)
  "_vDSP_vdiv", referenced from:
      _ggml_compute_forward_div in libggml-cpu.a(binary-ops.cpp.o)
  "_vDSP_vmul", referenced from:
      _ggml_compute_forward_mul in libggml-cpu.a(binary-ops.cpp.o)
  "_vDSP_vsmul", referenced from:
      _ggml_compute_forward_norm in libggml-cpu.a(ops.cpp.o)
      _ggml_compute_forward_rms_norm in libggml-cpu.a(ops.cpp.o)
      _ggml_compute_forward_rms_norm_back in libggml-cpu.a(ops.cpp.o)
      _ggml_compute_forward_group_norm in libggml-cpu.a(ops.cpp.o)
      _ggml_compute_forward_l2_norm in libggml-cpu.a(ops.cpp.o)
      _ggml_compute_forward_scale in libggml-cpu.a(ops.cpp.o)
      _ggml_compute_forward_soft_max in libggml-cpu.a(ops.cpp.o)
      ...
  "_vDSP_vsub", referenced from:
      _ggml_compute_forward_sub in libggml-cpu.a(binary-ops.cpp.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

i dug around the source, makefiles, couldn't make out anything valuable. looks like it's related to #1344.

$ ruby -v
ruby 3.4.4 (2025-05-14 revision a38531fd3f) +PRISM [arm64-darwin21]

$ sw_vers
ProductName:	macOS
ProductVersion:	12.7.6
BuildVersion:	21H1320

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions