Skip to content

Commit

Permalink
add libtorch/1.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceIm committed Mar 31, 2021
1 parent d406bec commit 820add3
Show file tree
Hide file tree
Showing 14 changed files with 1,647 additions and 0 deletions.
60 changes: 60 additions & 0 deletions recipes/libtorch/all/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
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})

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

if(CONAN_LIBTORCH_USE_CPUINFO)
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)
endif()

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

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

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

if(CONAN_LIBTORCH_USE_SLEEF)
add_library(sleef INTERFACE IMPORTED)
set_property(TARGET sleef PROPERTY INTERFACE_LINK_LIBRARIES CONAN_PKG::sleef)
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-code-generation.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

0 comments on commit 820add3

Please sign in to comment.