Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add libtorch/1.8.1 #5100

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions recipes/libtorch/all/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
cmake_minimum_required(VERSION 3.12)
project(cmake_wrapper)

include(conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

#-----------------------------
# Workaround for github action
# see https://github.com/actions/setup-python/issues/121#issuecomment-777748504
if (POLICY CMP0094)
cmake_policy(SET CMP0094 NEW)
endif ()
if (NOT DEFINED Python_FIND_REGISTRY)
set(Python_FIND_REGISTRY "LAST")
endif ()
if (NOT DEFINED Python_FIND_FRAMEWORK)
set(Python_FIND_FRAMEWORK "LAST")
endif ()
#-----------------------------

find_package(Python 3.8.0 REQUIRED)
set(PYTHON_EXECUTABLE ${Python_EXECUTABLE})

find_package(Eigen3 REQUIRED)
set(EIGEN3_FOUND 1)
set(EIGEN3_INCLUDE_DIR ${Eigen3_INCLUDE_DIR})

add_library(cpuinfo INTERFACE IMPORTED)
add_library(clog INTERFACE IMPORTED)
set_property(TARGET cpuinfo PROPERTY INTERFACE_LINK_LIBRARIES CONAN_PKG::cpuinfo)
set_property(TARGET clog PROPERTY INTERFACE_LINK_LIBRARIES CONAN_PKG::cpuinfo)

if(USE_PYTORCH_QNNPACK)
add_library(fxdiv INTERFACE IMPORTED)
set_property(TARGET fxdiv PROPERTY INTERFACE_LINK_LIBRARIES CONAN_PKG::fxdiv)

add_library(psimd INTERFACE IMPORTED)
set_property(TARGET psimd PROPERTY INTERFACE_LINK_LIBRARIES CONAN_PKG::psimd)

add_library(fp16 INTERFACE IMPORTED)
set_property(TARGET fp16 PROPERTY INTERFACE_LINK_LIBRARIES CONAN_PKG::fp16)
endif()

if(USE_TENSORPIPE)
add_library(tensorpipe INTERFACE IMPORTED)
set_property(TARGET tensorpipe PROPERTY INTERFACE_LINK_LIBRARIES CONAN_PKG::tensorpipe)
endif()

if(CONAN_LIBTORCH_USE_SLEEF)
add_library(sleef INTERFACE IMPORTED)
set_property(TARGET sleef PROPERTY INTERFACE_LINK_LIBRARIES CONAN_PKG::sleef)
endif()

if(CONAN_LIBTORCH_USE_PTHREADPOOL)
add_library(pthreadpool INTERFACE IMPORTED)
set_property(TARGET pthreadpool PROPERTY INTERFACE_LINK_LIBRARIES CONAN_PKG::pthreadpool)
endif()

add_subdirectory(source_subfolder)
20 changes: 20 additions & 0 deletions recipes/libtorch/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
sources:
"1.8.1":
url: "https://github.com/pytorch/pytorch/archive/v1.8.1.tar.gz"
sha256: "a13b379d7acd2470e643b4fd54a3bd4a68eea6032153aa3fd705ba34718a32dc"
patches:
"1.8.1":
- patch_file: "patches/0001-fix-system-onnx-namespace.patch"
base_path: "source_subfolder"
- patch_file: "patches/0002-allow-pytorch-subproject.patch"
base_path: "source_subfolder"
- patch_file: "patches/0003-disable-pybind11-for-no-build-python.patch"
base_path: "source_subfolder"
- patch_file: "patches/0004-avoid-python-external-typing-extensions.patch"
base_path: "source_subfolder"
- patch_file: "patches/0005-fix-vulkan-codegen.patch"
base_path: "source_subfolder"
- patch_file: "patches/0006-fix-install-target.patch"
base_path: "source_subfolder"
- patch_file: "patches/0007-unvendor-dependencies-and-honor-flags.patch"
base_path: "source_subfolder"
Loading