commit: 82fbfe4f5baa29d1bde681574d7c54e3cc6709ca Author: Benda Xu <heroxbd <AT> gentoo <DOT> org> AuthorDate: Wed Jan 20 15:57:33 2021 +0000 Commit: Benda XU <heroxbd <AT> gentoo <DOT> org> CommitDate: Wed Jan 20 16:11:25 2021 +0000 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=82fbfe4f
sci-libs/miopen: high performance machine learning primitives. Bug: https://bugs.gentoo.org/650804 Bug: https://github.com/gentoo/gentoo/pull/10724 Suggested-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com> Suggested-by: Wilfried Holzke <gentoo <AT> holzke.net> Package-Manager: Portage-3.0.12, Repoman-3.0.1 Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org> sci-libs/miopen/metadata.xml | 11 +++++++ sci-libs/miopen/miopen-4.0.0-r1.ebuild | 60 ++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/sci-libs/miopen/metadata.xml b/sci-libs/miopen/metadata.xml new file mode 100644 index 000000000..336bdb639 --- /dev/null +++ b/sci-libs/miopen/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM 'http://www.gentoo.org/dtd/metadata.dtd'> +<pkgmetadata> + <maintainer type="project"> + <email>[email protected]</email> + </maintainer> + <maintainer type="person"> + <email>[email protected]</email> + <name>Wilfried Holzke</name> + </maintainer> +</pkgmetadata> diff --git a/sci-libs/miopen/miopen-4.0.0-r1.ebuild b/sci-libs/miopen/miopen-4.0.0-r1.ebuild new file mode 100644 index 000000000..1bde9f88f --- /dev/null +++ b/sci-libs/miopen/miopen-4.0.0-r1.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake + +DESCRIPTION="AMD's Machine Intelligence Library" +HOMEPAGE="https://github.com/ROCmSoftwarePlatform/MIOpen" +SRC_URI="https://github.com/ROCmSoftwarePlatform/MIOpen/archive/rocm-${PV}.tar.gz -> MIOpen-${PV}.tar.gz" + +LICENSE="MIT" +KEYWORDS="~amd64" +SLOT="0" + +RDEPEND=" + >=dev-util/hip-${PV} + >=dev-libs/half-1.12.0 + dev-libs/ocl-icd + =dev-util/rocm-clang-ocl-${PV}* + sci-libs/rocBLAS + =dev-libs/boost-1.72*" + +DEPEND="${RDEPEND} + dev-util/cmake" + +S="${WORKDIR}/MIOpen-rocm-${PV}" + +src_prepare() { + sed -e "s:PATHS /opt/rocm/llvm:PATHS ${EPREFIX}/usr/lib/llvm/roc/ NO_DEFAULT_PATH:" \ + -e '/set( MIOPEN_INSTALL_DIR/s:miopen:${CMAKE_INSTALL_PREFIX}:' \ + -e '/set(MIOPEN_SYSTEM_DB_PATH/s:${CMAKE_INSTALL_PREFIX}/::' \ + -e '/MIOPEN_TIDY_ERRORS ALL/d' \ + -i CMakeLists.txt || die + + sed -e "/rocm_install_symlink_subdir(\${MIOPEN_INSTALL_DIR})/d" -i src/CMakeLists.txt || die + + sed -e "s:\${AMD_DEVICE_LIBS_PREFIX}/lib:${EPREFIX}/usr/lib/amdgcn/bitcode:" -i cmake/hip-config.cmake || die + + cmake_src_prepare +} + +src_configure() { + export CXX="hipcc" + + local mycmakeargs=( + -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" + -DCMAKE_BUILD_TYPE=Release + -DMIOPEN_BACKEND=$(usex opencl OpenCL HIP) + -DBoost_USE_STATIC_LIBS=OFF + ) + + cmake_src_configure +} + +src_install() { + cmake_src_install + chrpath --delete "${ED}/usr/bin/MIOpenDriver" + chrpath --delete "${ED}/usr/lib64/libMIOpen.so.1.0" +}
