Skip to content

Commit

Permalink
[OSS] Add podspec for libtorch-lite (pytorch#59638)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#59638

ghstack-source-id: 130847775

Test Plan: .

Reviewed By: husthyc, cccclai

Differential Revision: D28966693

fbshipit-source-id: 1b82623279709d0118c0967e2ba730d5dec040cc
  • Loading branch information
xta0 authored and facebook-github-bot committed Jun 8, 2021
1 parent 1bb1a9e commit 67b8e64
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ios/LibTorch-Lite.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef LibTorch_Lite_h
#define LibTorch_Lite_h

#include <torch/csrc/jit/mobile/import.h>
#include <torch/csrc/jit/mobile/module.h>
#include <torch/script.h>

#endif
36 changes: 36 additions & 0 deletions ios/LibTorch-Lite.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Pod::Spec.new do |s|
s.name = 'LibTorch-Lite'
s.version = '1.9.0'
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++']
end

0 comments on commit 67b8e64

Please sign in to comment.