sci-libs/rocSPARSE - 10.1.0 (stuff)

Search

Install

Install this version:

emerge -a =sci-libs/rocSPARSE-10.1.0

If this version is masked, you can unmask it using the autounmask tool or standard emerge options:

autounmask =sci-libs/rocSPARSE-10.1.0

Or alternatively:

emerge --autounmask-write -a =sci-libs/rocSPARSE-10.1.0

Package Information

Description:
Basic Linear Algebra Subroutines for sparse computation
Homepage:
https://github.com/ROCm/rocm-libraries/tree/develop/projects/rocsparse
License:
MIT

Ebuild Details

Version EAPI Keywords Slot
10.1.0 8 ~amd64 0/$(ver_cut 1-2)
View Raw Ebuild
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{10..15} )
ROCM_VERSION=${PV}

inherit cmake edo flag-o-matic python-any-r1 toolchain-funcs rocm

DESCRIPTION="Basic Linear Algebra Subroutines for sparse computation"
HOMEPAGE="https://github.com/ROCm/rocm-libraries/tree/develop/projects/rocsparse"

SRC_URI="
	https://github.com/ROCm/rocm-libraries/releases/download/therock-${PV%.0}/rocsparse.tar.gz
		-> rocsparse-${PV}.tar.gz
test? (
http://sparse-files.engr.tamu.edu/MM/SNAP/amazon0312.tar.gz -> ${PN}_amazon0312.tar.gz
http://sparse-files.engr.tamu.edu/MM/Muite/Chebyshev4.tar.gz -> ${PN}_Chebyshev4.tar.gz
http://sparse-files.engr.tamu.edu/MM/FEMLAB/sme3Dc.tar.gz -> ${PN}_sme3Dc.tar.gz
http://sparse-files.engr.tamu.edu/MM/Williams/webbase-1M.tar.gz -> ${PN}_webbase-1M.tar.gz
http://sparse-files.engr.tamu.edu/MM/Bova/rma10.tar.gz -> ${PN}_rma10.tar.gz
http://sparse-files.engr.tamu.edu/MM/JGD_BIBD/bibd_22_8.tar.gz -> ${PN}_bibd_22_8.tar.gz
http://sparse-files.engr.tamu.edu/MM/Williams/mac_econ_fwd500.tar.gz -> ${PN}_mac_econ_fwd500.tar.gz
http://sparse-files.engr.tamu.edu/MM/Williams/mc2depi.tar.gz -> ${PN}_mc2depi.tar.gz
http://sparse-files.engr.tamu.edu/MM/Hamm/scircuit.tar.gz -> ${PN}_scircuit.tar.gz
http://sparse-files.engr.tamu.edu/MM/Sandia/ASIC_320k.tar.gz -> ${PN}_ASIC_320k.tar.gz
http://sparse-files.engr.tamu.edu/MM/GHS_psdef/bmwcra_1.tar.gz -> ${PN}_bmwcra_1.tar.gz
http://sparse-files.engr.tamu.edu/MM/HB/nos1.tar.gz -> ${PN}_nos1.tar.gz
http://sparse-files.engr.tamu.edu/MM/HB/nos2.tar.gz -> ${PN}_nos2.tar.gz
http://sparse-files.engr.tamu.edu/MM/HB/nos3.tar.gz -> ${PN}_nos3.tar.gz
http://sparse-files.engr.tamu.edu/MM/HB/nos4.tar.gz -> ${PN}_nos4.tar.gz
http://sparse-files.engr.tamu.edu/MM/HB/nos5.tar.gz -> ${PN}_nos5.tar.gz
http://sparse-files.engr.tamu.edu/MM/HB/nos6.tar.gz -> ${PN}_nos6.tar.gz
http://sparse-files.engr.tamu.edu/MM/HB/nos7.tar.gz -> ${PN}_nos7.tar.gz
http://sparse-files.engr.tamu.edu/MM/DNVS/shipsec1.tar.gz -> ${PN}_shipsec1.tar.gz
http://sparse-files.engr.tamu.edu/MM/Cote/mplate.tar.gz -> ${PN}_mplate.tar.gz
http://sparse-files.engr.tamu.edu/MM/Bai/qc2534.tar.gz -> ${PN}_qc2534.tar.gz
http://sparse-files.engr.tamu.edu/MM/Chevron/Chevron2.tar.gz -> ${PN}_Chevron2.tar.gz
http://sparse-files.engr.tamu.edu/MM/Chevron/Chevron3.tar.gz -> ${PN}_Chevron3.tar.gz
http://sparse-files.engr.tamu.edu/MM/Chevron/Chevron4.tar.gz -> ${PN}_Chevron4.tar.gz
)"

S="${WORKDIR}/rocsparse"

LICENSE="MIT"
SLOT="0/$(ver_cut 1-2)"
KEYWORDS="~amd64"
IUSE="benchmark test"
REQUIRED_USE="${ROCM_REQUIRED_USE}"

RDEPEND="
	dev-util/hip:${SLOT}
	sci-libs/rocPRIM:${SLOT}
	sci-libs/rocBLAS:${SLOT}
	dev-util/roctracer:${SLOT}
"
# Overlay -r90: the tests link gtest, so it is a DEPEND, not a BDEPEND.
DEPEND="
	${RDEPEND}
	test? ( dev-cpp/gtest )
"
BDEPEND="test? (
	>=dev-build/cmake-3.22
	$(python_gen_any_dep "dev-python/pyyaml[\${PYTHON_USEDEP}]")
)
"

RESTRICT="!test? ( test )"

python_check_deps() {
	if use test; then
		python_has_version "dev-python/pyyaml[${PYTHON_USEDEP}]"
	fi
}

src_prepare() {
	# libc++ does not include <exception> transitively
	sed -e "/#include <iostream>/i #include <exception>" \
		-i library/src/include/rocsparse_control.hpp || die

	cmake_src_prepare

	# Test need download data from https://sparse-files.engr.tamu.edu (or other mirror site), check MD5,
	# unpack and convert them into csr format
	# This process is handled default by ${S}/cmake/ClientMatrices.cmake, but should be the responsibility of portage.
	if use test; then
		mkdir -p "${BUILD_DIR}"/clients/matrices || die
		# compile and use the mtx2csr converter. Do not use any optimization flags, because it causes error!
		edo $(tc-getCXX) deps/convert.cpp -o deps/convert
		# Overlay -r90: a failed conversion dies instead of silently dropping
		# that matrix's tests. Enumerate first so a failed find also reaches
		# the parent shell instead of dying in a subshell. verified 2026-10-27
		find "${WORKDIR}" -maxdepth 2 -regextype egrep \
			-regex ".*/(.*)/\1\\.mtx" -print0 > "${T}/matrices.list" || die
		local mtxfile destination
		while IFS= read -r -d '' mtxfile; do
			destination=${BUILD_DIR}/clients/matrices/$(basename -s '.mtx' "${mtxfile}").csr
			ebegin "Converting ${mtxfile} to ${destination}"
			deps/convert "${mtxfile}" "${destination}"
			eend $? || die "converting ${mtxfile} failed"
		done < "${T}/matrices.list"
	fi
}

src_configure() {
	rocm_use_clang

	# tons of warnings in tests
	append-cxxflags -Wno-explicit-specialization-storage-class

	local mycmakeargs=(
		-DCMAKE_SKIP_RPATH=ON
		-DGPU_TARGETS="$(get_amdgpu_flags)"
		-DBUILD_CLIENTS_SAMPLES=OFF
		-DBUILD_CLIENTS_TESTS=$(usex test ON OFF)
		-DBUILD_CLIENTS_BENCHMARKS=$(usex benchmark ON OFF)
		-DBUILD_WITH_ROCBLAS=ON
	)

	use test && mycmakeargs+=( -DPython3_EXECUTABLE=${PYTHON} )

	cmake_src_configure
}

src_test() {
	check_amdgpu
	# no RPATH: use the library from the build tree, not an installed one
	local -x LD_LIBRARY_PATH="${BUILD_DIR}/library"
	# host-side unit tests
	cmake_src_test

	# upstream "standard" category; nightly and stress tests run for hours
	# csritilu0 diverges on gfx1100 depending on the preceding tests (f32 sync_split),
	# and async_split with Chevron2 fails intermittently
	cd "${BUILD_DIR}/clients/staging" || die
	edob ./rocsparse-test --gtest_filter="quick/*:pre_checkin/*-*known_bug*:*csritilu0*precond*"
}

src_install() {
	cmake_src_install

	if use benchmark; then
		cd "${BUILD_DIR}" || die
		dobin clients/staging/rocsparse-bench
	fi
}

USE Flags

Manage flags for this package: euse -i <flag> -p sci-libs/rocSPARSE | euse -E <flag> -p sci-libs/rocSPARSE | euse -D <flag> -p sci-libs/rocSPARSE

Global/Standard Flags

Inherited Eclasses

edo

Dependencies

DEPEND

	
	dev-util/hip:0/$(ver_cut 1-2)
	sci-libs/rocPRIM:0/$(ver_cut 1-2)
	sci-libs/rocBLAS:0/$(ver_cut 1-2)
	dev-util/roctracer:0/$(ver_cut 1-2)

	test? ( dev-cpp/gtest )

RDEPEND

	dev-util/hip:0/$(ver_cut 1-2)
	sci-libs/rocPRIM:0/$(ver_cut 1-2)
	sci-libs/rocBLAS:0/$(ver_cut 1-2)
	dev-util/roctracer:0/$(ver_cut 1-2)

BDEPEND

test? (
	>=dev-build/cmake-3.22
	$(python_gen_any_dep 

Manifest for 10.1.0

Type File Size Source URLs
DIST rocSPARSE_ASIC_320k.tar.gz 11301444 bytes http://sparse-files.engr.tamu.edu/MM/Sandia/ASIC_320k.tar.gz
DIST rocSPARSE_Chebyshev4.tar.gz 50165660 bytes http://sparse-files.engr.tamu.edu/MM/Muite/Chebyshev4.tar.gz
DIST rocSPARSE_Chevron2.tar.gz 3210636 bytes http://sparse-files.engr.tamu.edu/MM/Chevron/Chevron2.tar.gz
DIST rocSPARSE_Chevron3.tar.gz 15315390 bytes http://sparse-files.engr.tamu.edu/MM/Chevron/Chevron3.tar.gz
DIST rocSPARSE_Chevron4.tar.gz 30454185 bytes http://sparse-files.engr.tamu.edu/MM/Chevron/Chevron4.tar.gz
DIST rocSPARSE_amazon0312.tar.gz 11303646 bytes http://sparse-files.engr.tamu.edu/MM/SNAP/amazon0312.tar.gz
DIST rocSPARSE_bibd_22_8.tar.gz 20548479 bytes http://sparse-files.engr.tamu.edu/MM/JGD_BIBD/bibd_22_8.tar.gz
DIST rocSPARSE_bmwcra_1.tar.gz 67958791 bytes http://sparse-files.engr.tamu.edu/MM/GHS_psdef/bmwcra_1.tar.gz
DIST rocSPARSE_mac_econ_fwd500.tar.gz 12051668 bytes http://sparse-files.engr.tamu.edu/MM/Williams/mac_econ_fwd500.tar.gz
DIST rocSPARSE_mc2depi.tar.gz 10874561 bytes http://sparse-files.engr.tamu.edu/MM/Williams/mc2depi.tar.gz
DIST rocSPARSE_mplate.tar.gz 499620 bytes http://sparse-files.engr.tamu.edu/MM/Cote/mplate.tar.gz
DIST rocSPARSE_nos1.tar.gz 3025 bytes http://sparse-files.engr.tamu.edu/MM/HB/nos1.tar.gz
DIST rocSPARSE_nos2.tar.gz 10313 bytes http://sparse-files.engr.tamu.edu/MM/HB/nos2.tar.gz
DIST rocSPARSE_nos3.tar.gz 34282 bytes http://sparse-files.engr.tamu.edu/MM/HB/nos3.tar.gz
DIST rocSPARSE_nos4.tar.gz 1760 bytes http://sparse-files.engr.tamu.edu/MM/HB/nos4.tar.gz
DIST rocSPARSE_nos5.tar.gz 13125 bytes http://sparse-files.engr.tamu.edu/MM/HB/nos5.tar.gz
DIST rocSPARSE_nos6.tar.gz 7644 bytes http://sparse-files.engr.tamu.edu/MM/HB/nos6.tar.gz
DIST rocSPARSE_nos7.tar.gz 9639 bytes http://sparse-files.engr.tamu.edu/MM/HB/nos7.tar.gz
DIST rocSPARSE_qc2534.tar.gz 1247151 bytes http://sparse-files.engr.tamu.edu/MM/Bai/qc2534.tar.gz
DIST rocSPARSE_rma10.tar.gz 19466055 bytes http://sparse-files.engr.tamu.edu/MM/Bova/rma10.tar.gz
DIST rocSPARSE_scircuit.tar.gz 8635362 bytes http://sparse-files.engr.tamu.edu/MM/Hamm/scircuit.tar.gz
DIST rocSPARSE_shipsec1.tar.gz 22175245 bytes http://sparse-files.engr.tamu.edu/MM/DNVS/shipsec1.tar.gz
DIST rocSPARSE_sme3Dc.tar.gz 42483568 bytes http://sparse-files.engr.tamu.edu/MM/FEMLAB/sme3Dc.tar.gz
DIST rocSPARSE_webbase-1M.tar.gz 11360460 bytes http://sparse-files.engr.tamu.edu/MM/Williams/webbase-1M.tar.gz
DIST rocsparse-10.1.0.tar.gz 2178553 bytes https://github.com/ROCm/rocm-libraries/releases/download/therock-10.1/rocsparse.tar.gz