ios-demo-app icon indicating copy to clipboard operation
ios-demo-app copied to clipboard

Building for iOS Simulator, but linking in object file built for iOS

Open DumbGameMaker opened this issue 3 years ago • 2 comments

When building an iOS app using LibTorch-Lite installed via cocoapods on M1, it will fail to build for Simulator with the error: Building for iOS Simulator, but linking in object file built for iOS

DumbGameMaker avatar Jul 03 '22 04:07 DumbGameMaker

I'm getting the same error on https://github.com/pytorch/ios-demo-app/tree/master/HelloWorld.

ld: in /Users/steve.ham/Downloads/ios-demo-app-master/HelloWorld/HelloWorld/Pods/LibTorch-Lite/install/lib/libtorch.a(empty.cpp.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/steve.ham/Downloads/ios-demo-app-master/HelloWorld/HelloWorld/Pods/LibTorch-Lite/install/lib/libtorch.a' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Chip: Apple M1 Pro Pod: 'LibTorch-Lite', '~> 1.10.0' Device:

  1. Work on device iPhone 12 Pro.
  2. Doesn't work on iOS Simulator iPhone 13 mini.

Is any LibTorch developers trying to fix this?

steve-ham avatar Jul 31 '22 01:07 steve-ham

Strangely if I install 'LibTorch-Lite' with 'OpenCV' the project runs on simulator too.

platform :ios, '12.0'
target 'HelloWorld' do
    pod 'LibTorch-Lite'
    pod 'OpenCV'
end

steve-ham avatar Jul 31 '22 03:07 steve-ham