Open thomaskwan opened 2 years ago
@thomaskwan, are there any issues besides the user_target_xcconfig
merge issue (i.e., does the RN app build and run on iOS)?
Note: LibTorch-Lite is C++14 and hermes-engine is C++17 (IIRC). I am not aware of any way to fix this besides patching libraries locally. If anyone knows a fix, please let me know or submit a PR
@raedle thanks for getting back. When I run "npx react-native run-ios", I get the following errors
❌ ld: in /Users/thomas/prj/test1/myapp/ios/Pods/LibTorch-Lite/install/lib/libtorch.a(empty.cpp.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/thomas/prj/test1/myapp/ios/Pods/LibTorch-Lite/install/lib/libtorch.a' for architecture arm64
❌ clang: error: linker command failed with exit code 1 (use -v to see invocation)
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening myapp.xcworkspace.
info Run CLI with --verbose flag for more details.
Running on the actual phone is fine tho. Not sure if my original reported messages are related the simulator issue or not. Are we supposed to be able to run it on Simulator?
Thanks
@thomaskwan try running your Xcode in Rosetta mode. Go to your Application folder, double-tap on Xcode icon and select "Get Info". Select the option Open using Rosetta
And yes, Playtorch works flawlessly in Simulator too.
Also, could you try opening the workspace in Xcode, clean the Derived Data directory and rebuild everything?
@shahidjabbar thanks for the idea. I tried Rosetta mode and cleaning the derived data directory and that did not help. I wonder if the problem is related to user_target_xcconfig being used in https://github.com/pytorch/pytorch/blob/master/ios/LibTorch.podspec#L25
I read from another project (https://code.videolan.org/videolan/VLCKit/-/issues/498) that user_target_xcconfig has been deprecated and should be avoided.
Here is my Podfile. There are some options that you might want to turn on or off:
platform :ios, '12.1'
target 'app_test' do
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => false
)
target 'app_testTests' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
use_flipper!()
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
`sed -i -e $'s/__IPHONE_10_0/__IPHONE_12_0/' Pods/RCT-Folly/folly/portability/Time.h`
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
# config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.1'
# config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
end
Version
LibTorch-Lite (1.12.0), react-native-pytorch-core (0.2.2)
Problem Area
react-native-pytorch-core (core package)
Steps to Reproduce
Environment:
Integrating client project Pod installation complete! There are 60 dependencies from the Podfile and 51 total pods installed.
[!] Can't merge user_target_xcconfig for pod targets: ["LibTorch-Lite", "Core", "Torch", "hermes-engine"]. Singular build setting CLANG_CXX_LANGUAGE_STANDARD has different values.
[!] Can't merge user_target_xcconfig for pod targets: ["LibTorch-Lite", "Core", "Torch", "hermes-engine"]. Singular build setting CLANG_CXX_LIBRARY has different values.
[!] Can't merge user_target_xcconfig for pod targets: ["LibTorch-Lite", "Core", "Torch", "hermes-engine"]. Singular build setting CLANG_CXX_LANGUAGE_STANDARD has different values.
[!] Can't merge user_target_xcconfig for pod targets: ["LibTorch-Lite", "Core", "Torch", "hermes-engine"]. Singular build setting CLANG_CXX_LIBRARY has different values.
[!] Can't merge user_target_xcconfig for pod targets: ["LibTorch-Lite", "Core", "Torch", "hermes-engine"]. Singular build setting CLANG_CXX_LANGUAGE_STANDARD has different values.
[!] Can't merge user_target_xcconfig for pod targets: ["LibTorch-Lite", "Core", "Torch", "hermes-engine"]. Singular build setting CLANG_CXX_LIBRARY has different values.
Expected Results
Dont expect to see the "Can't merge user_target_xcconfig for pod targets" messagesDon't
Code example, screenshot, or link to repository
No response