Skip to content

Commit b5a3a8b

Browse files
xta0facebook-github-bot
authored andcommitted
Change the source link in podspec (pytorch#26089)
Summary: Pull Request resolved: pytorch#26089 ### Summary A couple of changes 1. Replace the source link with the newly nightly build address 2. Remove module support for Swift and Objective-C 3. Expose all static libraries instead of archiving them into one single library. This is because those static libraries might contain object files that have the same name, e.g. `init.c.o` in both `libcupinfo.a` and `libqnnpack.a`. If we archive them into one using this `libtool -static` command, by default, it only picks one object file and discards the others, which could result in undefined symbols when linking the executable. The change here is to expose all the static libraries and let the linker decide which one to use. ### Test Plan - pod spec lint succeed - `pod spec lint --verbose --allow-warnings --no-clean --use-libraries --skip-import-validation` Test Plan: Imported from OSS Differential Revision: D17363037 Pulled By: xta0 fbshipit-source-id: ba77b0001b58e6e2353d8379d932db598166d37d
1 parent 16605ef commit b5a3a8b

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

ios/LibTorch.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
#ifndef LibTorch_h
2+
#define LibTorch_h
3+
14
#include <torch/script.h>
25

3-
#if TARGET_OS_IPHONE
4-
#define AT_NNPACK_ENABLED() 1
5-
#define USE_NNPACK ON
6-
#undef CAFFE2_PERF_WITH_AVX512
76
#endif

ios/LibTorch.podspec

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
Pod::Spec.new do |s|
22
s.name = 'LibTorch'
3-
s.version = '0.0.1'
3+
s.version = '0.0.2'
44
s.authors = 'PyTorch Team'
55
s.license = { :type => 'BSD' }
66
s.homepage = 'https://github.com/pytorch/pytorch'
7-
s.source = { :http => 'http://ossci-macos.s3.amazonaws.com/libtorch_x86_arm64.zip' }
7+
s.source = { :http => 'https://ossci-ios-build.s3.amazonaws.com/libtorch_ios_nightly_build.zip' }
88
s.summary = 'The PyTorch C++ library for iOS'
99
s.description = <<-DESC
1010
The PyTorch C++ library for iOS.
1111
DESC
1212
s.default_subspec = 'Core'
1313
s.subspec 'Core' do |ss|
1414
ss.dependency 'LibTorch/Torch'
15-
ss.source_files = 'src/*.{h,cpp,cc}'
15+
ss.source_files = 'src/*.{h,cpp,c,cc}'
1616
ss.public_header_files = ['src/LibTorch.h']
1717
end
1818
s.subspec 'Torch' do |ss|
1919
ss.header_mappings_dir = 'install/include/'
2020
ss.preserve_paths = 'install/include/**/*.{h,cpp,cc,c}'
21-
ss.vendored_libraries = 'install/lib/libtorch.a'
21+
ss.vendored_libraries = 'install/lib/*.a'
2222
ss.libraries = ['c++', 'stdc++']
2323
end
2424
s.user_target_xcconfig = {
@@ -27,8 +27,9 @@ Pod::Spec.new do |s|
2727
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++11',
2828
'CLANG_CXX_LIBRARY' => 'libc++'
2929
}
30-
s.pod_target_xcconfig = { 'VALID_ARCHS' => 'x86_64 armv7s arm64' }
31-
s.module_name='LibTorch'
32-
s.module_map = 'src/framework.modulemap'
30+
s.pod_target_xcconfig = {
31+
'HEADER_SEARCH_PATHS' => '$(inherited) "$(PODS_ROOT)/LibTorch/install/include/"',
32+
'VALID_ARCHS' => 'x86_64 armv7s arm64'
33+
}
3334
s.library = ['c++', 'stdc++']
3435
end

ios/framework.modulemap

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)