Skip to content

Instantly share code, notes, and snippets.

@platisd
Last active August 27, 2019 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save platisd/aeec6bdf88923976fd759d7b5fe939aa to your computer and use it in GitHub Desktop.
Save platisd/aeec6bdf88923976fd759d7b5fe939aa to your computer and use it in GitHub Desktop.
pytorch dependencies
SUMMARY = "Facebook PyTorch AI"
DESCRIPTION = "Facebook PyTorch AI"
HOMEPAGE = "https://pytorch.org/"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=acf4d595f99e159bf31797aa872aef57"
S = "${WORKDIR}"
LOCAL_INCLUDE = "${S}/libtorch/include"
LOCAL_LIB = "${S}/libtorch/lib"
TARGET_INCLUDE = "${D}${includedir}"
TARGET_LIB = "${D}${libdir}"
SRC_URI = "\
https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-${PV}.zip \
file://LICENSE \
"
SRC_URI[md5sum] = "f34c5b6e46331f79100cd93522bad3ae"
INSANE_SKIP_${PN} = "ldflags"
INSANE_SKIP_${PN} += "already-stripped"
# Workaround for resolving the dependency of libtorch to libgomp-753e6e92.so.1
INSANE_SKIP_${PN} += "file-rdeps"
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_SYSROOT_STRIP = "1"
SOLIBS = ".so"
FILES_SOLIBSDEV = ""
RDEPENDS_${PN} = " torch-deps"
do_install() {
# Create include directory
install -d ${TARGET_INCLUDE}
# Copy all header files
cp -R --no-dereference --preserve=mode,links -v ${LOCAL_INCLUDE}/* ${TARGET_INCLUDE}
# Create library directory
install -d ${TARGET_LIB}
# Install shared libraries
install -m 0755 ${LOCAL_LIB}/*.so ${TARGET_LIB}
}
FILES_${PN} += "\
${includedir}/* \
${libdir}/* \
"
SUMMARY = "Facebook PyTorch AI"
DESCRIPTION = "Facebook PyTorch AI"
HOMEPAGE = "https://pytorch.org/"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=acf4d595f99e159bf31797aa872aef57"
S = "${WORKDIR}"
LOCAL_INCLUDE = "${S}/libtorch/include"
LOCAL_LIB = "${S}/libtorch/lib"
TARGET_INCLUDE = "${D}${includedir}"
TARGET_LIB = "${D}${libdir}"
SRC_URI = "\
https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-${PV}.zip \
file://LICENSE \
"
SRC_URI[md5sum] = "f34c5b6e46331f79100cd93522bad3ae"
INSANE_SKIP_${PN} = "ldflags"
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_SYSROOT_STRIP = "1"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
RPROVIDES_${PN} = "libgomp-753e6e92.so.1"
do_install() {
# Create library directory
install -d ${TARGET_LIB}
# Install shared libraries
install -m 0755 ${LOCAL_LIB}/libgomp-753e6e92.so.1 ${D}${libdir}
}
FILES_${PN} += "\
${libdir}/* \
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment