commit: 5a6ca7469f59dd61a837ad34b60a9bb33b9f105b Author: Benda Xu <heroxbd <AT> gentoo <DOT> org> AuthorDate: Wed Jan 20 09:00:35 2021 +0000 Commit: Benda XU <heroxbd <AT> gentoo <DOT> org> CommitDate: Wed Jan 20 16:11:24 2021 +0000 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=5a6ca746
sci-libs/rocBLAS: AMD library for BLAS on the ROCm platform. To be considered landing on ::gentoo when dev-util/Tensile is available. 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> Bug: https://github.com/justxi/rocm/issues/133 Package-Manager: Portage-3.0.12, Repoman-3.0.1 Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org> .../files/rocBLAS-4.0.0-use-system-tensile.patch | 30 ++++++++ sci-libs/rocBLAS/metadata.xml | 11 +++ sci-libs/rocBLAS/rocBLAS-4.0.0-r1.ebuild | 88 ++++++++++++++++++++++ 3 files changed, 129 insertions(+) diff --git a/sci-libs/rocBLAS/files/rocBLAS-4.0.0-use-system-tensile.patch b/sci-libs/rocBLAS/files/rocBLAS-4.0.0-use-system-tensile.patch new file mode 100644 index 000000000..3b8e44a99 --- /dev/null +++ b/sci-libs/rocBLAS/files/rocBLAS-4.0.0-use-system-tensile.patch @@ -0,0 +1,30 @@ +diff --color -uprN rocBLAS-rocm-4.0.0/CMakeLists.txt new/CMakeLists.txt +--- rocBLAS-rocm-4.0.0/CMakeLists.txt 2020-11-11 00:56:04.000000000 +0800 ++++ new/CMakeLists.txt 2021-01-20 15:23:09.570222990 +0800 +@@ -208,25 +208,7 @@ if( BUILD_WITH_TENSILE ) + option(TENSILE_USE_MSGPACK "Use msgpack for parsing config files." ON) + endif() + +- include(virtualenv) +- if (Tensile_TEST_LOCAL_PATH) +- virtualenv_install(${Tensile_TEST_LOCAL_PATH}) +- message (STATUS "using local Tensile from ${Tensile_TEST_LOCAL_PATH}, copied to ${Tensile_ROOT}") +- else() +- # Use the virtual-env setup and download package from specified repot: +- set( tensile_fork "ROCmSoftwarePlatform" CACHE STRING "Tensile fork to use" ) +- file (STRINGS "tensile_tag.txt" read_tensile_tag) +- set( tensile_tag ${read_tensile_tag} CACHE STRING "Tensile tag to download" ) +- virtualenv_install("git+https://github.com/${tensile_fork}/Tensile.git@${tensile_tag}") +- message (STATUS "using GIT Tensile fork=${tensile_fork} from branch=${tensile_tag}") +- endif() +- message(STATUS "Adding ${VIRTUALENV_HOME_DIR} to CMAKE_PREFIX_PATH") +- list(APPEND CMAKE_PREFIX_PATH ${VIRTUALENV_HOME_DIR}) +- if (TENSILE_VERSION) +- find_package(Tensile ${TENSILE_VERSION} EXACT REQUIRED HIP LLVM OpenMP PATHS "${INSTALLED_TENSILE_PATH}") +- else() +- find_package(Tensile 4.24.0 EXACT REQUIRED HIP LLVM OpenMP PATHS "${INSTALLED_TENSILE_PATH}") +- endif() ++ find_package(Tensile 4.24.0 EXACT REQUIRED HIP LLVM OpenMP) + endif() + + # Find HCC/HIP dependencies diff --git a/sci-libs/rocBLAS/metadata.xml b/sci-libs/rocBLAS/metadata.xml new file mode 100644 index 000000000..336bdb639 --- /dev/null +++ b/sci-libs/rocBLAS/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/rocBLAS/rocBLAS-4.0.0-r1.ebuild b/sci-libs/rocBLAS/rocBLAS-4.0.0-r1.ebuild new file mode 100644 index 000000000..ca0fcfd8c --- /dev/null +++ b/sci-libs/rocBLAS/rocBLAS-4.0.0-r1.ebuild @@ -0,0 +1,88 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake + +DESCRIPTION="AMD's library for BLAS on ROCm." +HOMEPAGE="https://github.com/ROCmSoftwarePlatform/rocBLAS" +SRC_URI="https://github.com/ROCmSoftwarePlatform/rocBLAS/archive/rocm-${PV}.tar.gz -> rocm-rocBLAS-${PV}.tar.gz" + +LICENSE="MIT" +KEYWORDS="~amd64" +SLOT="0" + +IUSE="debug" + +RDEPEND="=dev-util/hip-$(ver_cut 1-2)*" +DEPEND="${RDEPEND} + dev-util/cmake + dev-util/rocm-cmake + dev-libs/msgpack + dev-perl/File-Which" + +# stripped library is not working +RESTRICT="strip" + +S="${WORKDIR}/rocBLAS-rocm-${PV}" + +rocBLAS_V="0.1" + +PATCHES="${FILESDIR}/${PN}-4.0.0-use-system-tensile.patch" + +src_prepare() { + eapply_user + + sed -e "/PREFIX rocblas/d" \ + -e "/<INSTALL_INTERFACE/s:include:include/rocblas:" \ + -e "s:rocblas/include:include/rocblas:" \ + -e "s:\\\\\${CPACK_PACKAGING_INSTALL_PREFIX}rocblas/lib:${EPREFIX}/usr/$(get_libdir)/rocblas:" \ + -e "/rocm_install_symlink_subdir( rocblas )/d" -i library/src/CMakeLists.txt || die + + cmake_src_prepare +} + +src_configure() { + # allow acces to hardware + addwrite /dev/kfd + addpredict /dev/dri/ + + # Compiler to use + export CXX="hipcc" + + if use debug; then + buildtype="Debug" + else + buildtype="Release" + fi + + local mycmakeargs=( + -DTensile_LOGIC="asm_full" + -DTensile_COMPILER="hipcc" + -DTensile_ARCHITECTURE="all" + -DTensile_LIBRARY_FORMAT="msgpack" + -DTensile_CODE_OBJECT_VERSION="V3" + -DTensile_TEST_LOCAL_PATH="${WORKDIR}/Tensile-rocm-${PV}" + -DBUILD_WITH_TENSILE=ON + -DBUILD_WITH_TENSILE_HOST=ON + -DCMAKE_BUILD_TYPE="${buildtype}" + -DCMAKE_CXX_FLAGS="--rocm-path=${EPREFIX}/usr" + -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" + -DCMAKE_INSTALL_INCLUDEDIR="include/rocblas" + -DBUILD_TESTING=OFF + -DBUILD_CLIENTS_SAMPLES=OFF + -DBUILD_CLIENTS_TESTS=OFF + -DBUILD_CLIENTS_BENCHMARKS=OFF + ) + + cmake_src_configure + + # do not rerun cmake and the build process in src_install + sed -e '/RERUN/,+1d' -i "${BUILD_DIR}"/build.ninja || die +} + +src_install() { + cmake_src_install + chrpath --delete "${ED}/usr/lib64/librocblas.so.${rocBLAS_V}" +}
