Skip to content

Commit 692ee59

Browse files
committed
[iOS]Replace the source link for testing
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. Upload 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 and libqnnpack. If we archive them into one using this `libtool -static` command, by default, it only picks one object file and discard the others, which could result in undefined symbols when linking the executable.The solution here is to keep all the static libraries and let the linker decide which one to use. - pod spec lint succeed - `pod spec lint --verbose --allow-warnings --no-clean --use-libraries --skip-import-validation` ghstack-source-id: ac1b135 Pull Request resolved: #26089
1 parent a996b1d commit 692ee59

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

ios/LibTorch.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
#include <torch/script.h>
2-
3-
#if TARGET_OS_IPHONE
4-
#define AT_NNPACK_ENABLED() 1
5-
#define USE_NNPACK ON
6-
#undef CAFFE2_PERF_WITH_AVX512
7-
#endif
1+
#include <torch/script.h>

ios/LibTorch.podspec

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ Pod::Spec.new do |s|
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)