mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
This refactors the logic from CircleCI iOS [build](https://github.com/pytorch/pytorch/blob/main/.circleci/config.yml#L1323-L1344) and [upload](https://github.com/pytorch/pytorch/blob/main/.circleci/config.yml#L1369-L1377) jobs to GHA. * Nightly artifacts will be available again on `ossci-ios-build` S3 bucket, for example `libtorch_lite_ios_nightly_2.1.0.20230517.zip`. The last one there was s3://ossci-ios-build/libtorch_lite_ios_nightly_2.1.0.20230517.zip from May 17th * [LibTorch-Lite-Nightly](https://github.com/CocoaPods/Specs/blob/master/Specs/c/3/1/LibTorch-Lite-Nightly/1.14.0.20221109/LibTorch-Lite-Nightly.podspec.json) on cocoapods * Release artifacts will be on `ossci-ios` S3 bucket, for example `s3://ossci-ios/libtorch_lite_ios_1.13.0.zip` from Nov 3rd 2022 * [LibTorch-Lite](https://github.com/CocoaPods/Specs/blob/master/Specs/c/c/3/LibTorch-Lite/1.13.0.1/LibTorch-Lite.podspec.json) on cocoapods * [LibTorch](https://github.com/CocoaPods/Specs/blob/master/Specs/1/3/c/LibTorch/1.13.0.1/LibTorch.podspec.json) on cocoapods I will clean up Circle CI code in another PR. ### Testing Generate new release artifacts for testing from main branch. Simulator testing have all passed. * With lite interpreter https://github.com/pytorch/pytorch/actions/runs/6093860118 * https://ossci-ios.s3.amazonaws.com/libtorch_lite_ios_2.1.0.zip * https://ossci-ios.s3.amazonaws.com/LibTorch-Lite-2.1.0.podspec * LibTorch binary can be built without lite interpreter https://github.com/pytorch/pytorch/actions/runs/6103616035 and uses TorchScript, but it has been long dead from my understanding. The binary can still be built and tested though. * https://ossci-ios.s3.amazonaws.com/libtorch_ios_2.1.0.zip * https://ossci-ios.s3.amazonaws.com/LibTorch-2.1.0.podspec ### Next step for release * Once the PR is committed. I plan to use the workflow dispatch to build the binaries manually on `release/2.1` branch. Once they looks good, we can publish them on cocoapods. Pull Request resolved: https://github.com/pytorch/pytorch/pull/108322 Approved by: https://github.com/atalman
38 lines
1.6 KiB
Plaintext
38 lines
1.6 KiB
Plaintext
Pod::Spec.new do |s|
|
|
s.name = 'LibTorch-Lite'
|
|
s.version = 'IOS_BUILD_VERSION'
|
|
s.authors = 'PyTorch Team'
|
|
s.license = { :type => 'BSD' }
|
|
s.homepage = 'https://github.com/pytorch/pytorch'
|
|
s.source = { :http => "https://ossci-ios.s3.amazonaws.com/libtorch_lite_ios_#{s.version}.zip" }
|
|
s.summary = 'The PyTorch C++ library for iOS'
|
|
s.description = <<-DESC
|
|
The PyTorch C++ library for iOS.
|
|
DESC
|
|
s.ios.deployment_target = '12.0'
|
|
s.default_subspec = 'Core'
|
|
s.subspec 'Core' do |ss|
|
|
ss.dependency 'LibTorch-Lite/Torch'
|
|
ss.source_files = 'src/*.{h,cpp,c,cc}'
|
|
ss.public_header_files = ['src/LibTorch-Lite.h']
|
|
end
|
|
s.subspec 'Torch' do |ss|
|
|
ss.header_mappings_dir = 'install/include/'
|
|
ss.preserve_paths = 'install/include/**/*.{h,cpp,cc,c}'
|
|
ss.vendored_libraries = 'install/lib/*.a'
|
|
ss.libraries = ['c++', 'stdc++']
|
|
end
|
|
s.user_target_xcconfig = {
|
|
'HEADER_SEARCH_PATHS' => '$(inherited) "$(PODS_ROOT)/LibTorch-Lite/install/include/"',
|
|
'OTHER_LDFLAGS' => '-force_load "$(PODS_ROOT)/LibTorch-Lite/install/lib/libtorch.a" -force_load "$(PODS_ROOT)/LibTorch-Lite/install/lib/libtorch_cpu.a"',
|
|
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++14',
|
|
'CLANG_CXX_LIBRARY' => 'libc++'
|
|
}
|
|
s.pod_target_xcconfig = {
|
|
'HEADER_SEARCH_PATHS' => '$(inherited) "$(PODS_ROOT)/LibTorch-Lite/install/include/"',
|
|
'VALID_ARCHS' => 'x86_64 arm64'
|
|
}
|
|
s.library = ['c++', 'stdc++']
|
|
s.frameworks = 'Accelerate', 'MetalPerformanceShaders', 'CoreML'
|
|
end
|