Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

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

Open
DumbGameMaker opened this issue Jul 3, 2022 · 2 comments

Comments

@DumbGameMaker
Copy link

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

@steve-ham
Copy link

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
Copy link

steve-ham commented Jul 31, 2022

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants