Undefined symbols for architecture arm64: "(extension in Accelerate)

Hi,

Xcode fails to build a very simple code shown below ONLY IF build configuration is Debug and produces "Undefined symbols for architecture arm64:  "(extension in Accelerate):Accelerate.AccelerateMutableBuffer< where A: Swift.MutableCollection>.withUnsafeMutableBufferPointer((inout Swift.UnsafeMutableBufferPointer<A.Accelerate.AccelerateBuffer.Element>) throws -> A1) throws -> A1", referenced "

If build configuration is Release, the build is success and it runs just fine.

Note: The code below is a just sample one to reproduce the issue easily. I don't want to use Accelerate framework or those pointer functions in viewDidLoad() for the actual project.

import UIKit
import Accelerate

class ViewController: UIViewController {

  override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view.
    
    let b = UnsafeMutablePointer<Float>.allocate(capacity: 10)
    var c = UnsafeMutableBufferPointer(start: b, count: 10)
    c.withUnsafeMutableBufferPointer{ buf in
      let base = buf.baseAddress
      print("test ",base!)
    }
  }
}

Xcode version is 13.2.1 target iOS version is 15.2

The only workaround I know for now is just to build for release. But I really need debugger for a real project which I'm working on.

Any help, advice or comment would be appreciated.

Best Regards, Hikaru

Hi Hikaru,

I'm unable to replicate that issue here, please could you confirm your macOS version. It would be great if you could attach the entire project (feel free to use https://developer.apple.com/bug-reporting/ if you don't want to make it public).

One thing to note is that in your code, c.withUnsafeMutableBufferPointer{ buf in ... }, buf is simply c.

Many thanks.

Undefined symbols for architecture arm64: "(extension in Accelerate)
 
 
Q