Skip to content

Commit

Permalink
Change the source link in podspec (pytorch#26089)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
xta0 authored and facebook-github-bot committed Sep 13, 2019
1 parent 16605ef commit b5a3a8b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
7 changes: 3 additions & 4 deletions ios/LibTorch.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef LibTorch_h
#define LibTorch_h

#include <torch/script.h>

#if TARGET_OS_IPHONE
#define AT_NNPACK_ENABLED() 1
#define USE_NNPACK ON
#undef CAFFE2_PERF_WITH_AVX512
#endif
15 changes: 8 additions & 7 deletions ios/LibTorch.podspec
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
Pod::Spec.new do |s|
s.name = 'LibTorch'
s.version = '0.0.1'
s.version = '0.0.2'
s.authors = 'PyTorch Team'
s.license = { :type => 'BSD' }
s.homepage = 'https://github.com/pytorch/pytorch'
s.source = { :http => 'http://ossci-macos.s3.amazonaws.com/libtorch_x86_arm64.zip' }
s.source = { :http => 'https://ossci-ios-build.s3.amazonaws.com/libtorch_ios_nightly_build.zip' }
s.summary = 'The PyTorch C++ library for iOS'
s.description = <<-DESC
The PyTorch C++ library for iOS.
DESC
s.default_subspec = 'Core'
s.subspec 'Core' do |ss|
ss.dependency 'LibTorch/Torch'
ss.source_files = 'src/*.{h,cpp,cc}'
ss.source_files = 'src/*.{h,cpp,c,cc}'
ss.public_header_files = ['src/LibTorch.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/libtorch.a'
ss.vendored_libraries = 'install/lib/*.a'
ss.libraries = ['c++', 'stdc++']
end
s.user_target_xcconfig = {
Expand All @@ -27,8 +27,9 @@ Pod::Spec.new do |s|
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++11',
'CLANG_CXX_LIBRARY' => 'libc++'
}
s.pod_target_xcconfig = { 'VALID_ARCHS' => 'x86_64 armv7s arm64' }
s.module_name='LibTorch'
s.module_map = 'src/framework.modulemap'
s.pod_target_xcconfig = {
'HEADER_SEARCH_PATHS' => '$(inherited) "$(PODS_ROOT)/LibTorch/install/include/"',
'VALID_ARCHS' => 'x86_64 armv7s arm64'
}
s.library = ['c++', 'stdc++']
end
4 changes: 0 additions & 4 deletions ios/framework.modulemap

This file was deleted.

0 comments on commit b5a3a8b

Please sign in to comment.