From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 177BB158090 for ; Wed, 25 May 2022 12:33:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 29987E0940; Wed, 25 May 2022 12:32:59 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0EAECE0940 for ; Wed, 25 May 2022 12:32:58 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2E73334186B for ; Wed, 25 May 2022 12:32:58 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2DC9B471 for ; Wed, 25 May 2022 12:32:56 +0000 (UTC) From: "Alessandro Barbieri" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Alessandro Barbieri" Message-ID: <1653481878.8238a71a0001ca47cc67445f0d4547c6f528821b.Alessandro-Barbieri@gentoo> Subject: [gentoo-commits] repo/proj/guru:dev commit in: sci-libs/magma/ X-VCS-Repository: repo/proj/guru X-VCS-Files: sci-libs/magma/magma-2.6.2-r1.ebuild X-VCS-Directories: sci-libs/magma/ X-VCS-Committer: Alessandro-Barbieri X-VCS-Committer-Name: Alessandro Barbieri X-VCS-Revision: 8238a71a0001ca47cc67445f0d4547c6f528821b X-VCS-Branch: dev Date: Wed, 25 May 2022 12:32:56 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: a3b5b774-93f1-4125-afb7-ec4fe1fff5ca X-Archives-Hash: 06183cf49bc070042101b9802f0ae777 commit: 8238a71a0001ca47cc67445f0d4547c6f528821b Author: Alessandro Barbieri gmail com> AuthorDate: Wed May 25 12:31:18 2022 +0000 Commit: Alessandro Barbieri gmail com> CommitDate: Wed May 25 12:31:18 2022 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=8238a71a sci-libs/magma: add commented code for waebbl Signed-off-by: Alessandro Barbieri gmail.com> sci-libs/magma/magma-2.6.2-r1.ebuild | 138 +++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) diff --git a/sci-libs/magma/magma-2.6.2-r1.ebuild b/sci-libs/magma/magma-2.6.2-r1.ebuild new file mode 100644 index 000000000..71bc4f6d7 --- /dev/null +++ b/sci-libs/magma/magma-2.6.2-r1.ebuild @@ -0,0 +1,138 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +FORTRAN_STANDARD="77 90" +PYTHON_COMPAT=( python3_{8..11} ) + +inherit cmake fortran-2 python-any-r1 toolchain-funcs + +MY_PV=$(ver_rs 3 '-') + +DESCRIPTION="Matrix Algebra on GPU and Multicore Architectures" +HOMEPAGE=" + https://icl.cs.utk.edu/magma/ + https://bitbucket.org/icl/magma +" +SRC_URI="https://icl.cs.utk.edu/projectsfiles/${PN}/downloads/${PN}-${MY_PV}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64" +IUSE_AMDGPU=" + amdgpu_gfx600 amdgpu_gfx601 amdgpu_gfx602 + amdgpu_gfx700 amdgpu_gfx701 amdgpu_gfx702 amdgpu_gfx703 amdgpu_gfx704 amdgpu_gfx705 + amdgpu_gfx801 amdgpu_gfx802 amdgpu_gfx803 amdgpu_gfx805 amdgpu_gfx810 + amdgpu_gfx900 amdgpu_gfx902 amdgpu_gfx904 amdgpu_gfx906 amdgpu_gfx908 amdgpu_gfx909 amdgpu_gfx90a amdgpu_gfx90c amdgpu_gfx940 + amdgpu_gfx1010 amdgpu_gfx1011 amdgpu_gfx1012 amdgpu_gfx1013 amdgpu_gfx1030 amdgpu_gfx1031 amdgpu_gfx1032 amdgpu_gfx1033 amdgpu_gfx1034 amdgpu_gfx1035 amdgpu_gfx1036 + amdgpu_gfx1100 amdgpu_gfx1101 amdgpu_gfx1102 amdgpu_gfx1103 +" +IUSE="doc openblas test ${IUSE_AMDGPU}" +#IUSE="doc cuda hip openblas test ${IUSE_AMDGPU}" + +# TODO: do not enforce openblas +RDEPEND=" + openblas? ( sci-libs/openblas ) + !openblas? ( + virtual/blas + virtual/lapack + ) +" +DEPEND=" + ${RDEPEND} + ${PYTHON_DEPS} + dev-util/hip +" +# hip? ( dev-util/hip ) +BDEPEND=" + virtual/pkgconfig + doc? ( >=app-doc/doxygen-1.8.14-r1[dot] ) +" + +REQUIRED_USE=" + || ( ${IUSE_AMDGPU/+/} ) +" +# ^^ ( cuda hip ) +RESTRICT="!test? ( test )" + +pkg_setup() { + fortran-2_pkg_setup + python-any-r1_pkg_setup + tc-check-openmp || die "Need OpenMP to compile ${P}" +} + +src_prepare() { + rm -r blas_fix || die + # distributed pc file not so useful so replace it + cat <<-EOF > ${PN}.pc + prefix=${EPREFIX}/usr + libdir=\${prefix}/$(get_libdir) + includedir=\${prefix}/include/${PN} + Name: ${PN} + Description: ${DESCRIPTION} + Version: ${PV} + URL: ${HOMEPAGE} + Libs: -L\${libdir} -lmagma + Libs.private: -lm -lpthread -ldl + Cflags: -I\${includedir} + Requires: $(usex openblas "openblas" "blas lapack") + EOF + + #use cuda && echo -e 'BACKEND = cuda' > make.inc + #use hip && echo -e 'BACKEND = hip' > make.inc + echo -e 'BACKEND = hip' > make.inc + echo -e 'FORT = true' >> make.inc + emake generate + + cmake_src_prepare +} + +src_configure() { + # other options: Intel10_64lp, Intel10_64lp_seq, Intel10_64ilp, Intel10_64ilp_seq, Intel10_32, FLAME, ACML, Apple, NAS + local blasvendor="Generic" + use openblas && blasvendor="OpenBLAS" + + local gpu="" + #if use hip ; then + for u in ${IUSE_AMDGPU} ; do + if use ${u} ; then + gpu="${gpu},${u/amdgpu_/}" + fi + done + #fi + # remove first character (,) + gpu="${gpu:1}" + + local mycmakeargs=( + -DBUILD_SHARED_LIBS=ON + -DCMAKE_CXX_COMPILER=hipcc + -DMAGMA_ENABLE_CUDA=OFF + -DMAGMA_ENABLE_HIP=ON + -DUSE_FORTRAN=ON + + -DBLA_VENDOR=${blasvendor} + -DGPU_TARGET=${gpu} + ) + # -DMAGMA_ENABLE_CUDA=$(usex cuda) + # -DMAGMA_ENABLE_HIP=$(usex hip) + + #use fortran || mycmakeargs+=( "-DFORTRAN_CONVENTION=-DADD_" + #use hip && mycmakeargs+=( "-DCMAKE_CXX_COMPILER=hipcc" ) + cmake_src_configure +} + +src_compile() { + cmake_src_compile +} + +src_install() { + cmake_src_install + insinto "/usr/include/${PN}" + doins include/*.h + insinto "/usr/$(get_libdir)/pkgconfig" + doins "${PN}.pc" + local DOCS=( README ReleaseNotes ) + use doc && local HTML_DOCS=( docs/html/. ) + einstalldocs +}