| 1 |
|
# Copyright 1999-2023 Gentoo Authors
|
|
1 |
# Copyright 1999-2026 Gentoo Authors
|
| 2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
3 |
|
| 4 |
4 |
EAPI=8
|
| 5 |
5 |
|
| 6 |
|
inherit cmake-multilib toolchain-funcs
|
|
6 |
inherit cmake toolchain-funcs
|
| 7 |
7 |
|
| 8 |
8 |
Sparse_PV=$(ver_rs 3 '.')
|
| 9 |
9 |
Sparse_P="SuiteSparse-${Sparse_PV}"
|
| ... | ... | |
| 11 |
11 |
HOMEPAGE="https://people.engr.tamu.edu/davis/suitesparse.html"
|
| 12 |
12 |
SRC_URI="https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/refs/tags/v${Sparse_PV}.tar.gz -> ${Sparse_P}.gh.tar.gz"
|
| 13 |
13 |
|
|
14 |
S="${WORKDIR}/${Sparse_P}/SuiteSparse_config"
|
| 14 |
15 |
LICENSE="BSD"
|
| 15 |
16 |
SLOT="0/7"
|
| 16 |
17 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
|
| 17 |
18 |
IUSE="openmp"
|
| 18 |
19 |
|
| 19 |
|
# BLAS availability is checked for at configuration time and will fail if it is not present.
|
| 20 |
|
BDEPEND="virtual/blas"
|
| 21 |
|
|
| 22 |
|
S="${WORKDIR}/${Sparse_P}/SuiteSparse_config"
|
|
20 |
# we need to depend on blas as the cmake file looks for it.
|
|
21 |
# It is also a runtime dependency as it has headers to link with blas
|
|
22 |
DEPEND="virtual/blas"
|
|
23 |
RDEPEND="${DEPEND}"
|
| 23 |
24 |
|
| 24 |
25 |
pkg_pretend() {
|
| 25 |
26 |
[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
|
| ... | ... | |
| 29 |
30 |
[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
|
| 30 |
31 |
}
|
| 31 |
32 |
|
| 32 |
|
multilib_src_configure() {
|
|
33 |
src_configure() {
|
| 33 |
34 |
# Make sure we always include the Fortran interface.
|
| 34 |
35 |
# It doesn't require a Fortran compiler to be present
|
| 35 |
36 |
# and simplifies the configuration for dependencies.
|
|
37 |
# Define SUITESPARSE_INCLUDEDIR_POSTFIX to "" otherwise it take
|
|
38 |
# the value suitesparse, and the include directory would be set to
|
|
39 |
# /usr/include/suitesparse
|
|
40 |
# This need to be set in all suitesparse ebuilds.
|
| 36 |
41 |
local mycmakeargs=(
|
| 37 |
|
-DNSTATIC=ON
|
| 38 |
|
-DNFORTRAN=OFF
|
| 39 |
|
-DNOPENMP=$(usex openmp OFF ON)
|
|
42 |
-DBUILD_STATIC_LIBS=OFF
|
|
43 |
-DSUITESPARSE_USE_FORTRAN=ON
|
|
44 |
-DSUITESPARSE_USE_OPENMP=$(usex openmp ON OFF)
|
|
45 |
-DSUITESPARSE_INCLUDEDIR_POSTFIX=""
|
| 40 |
46 |
)
|
|
47 |
|
|
48 |
if has_version 'virtual/blas[index64]'; then
|
|
49 |
mycmakeargs+=( -DSUITESPARSE_USE_64BIT_BLAS=ON )
|
|
50 |
fi
|
|
51 |
|
|
52 |
if has_version 'virtual/blas[flexiblas]'; then
|
|
53 |
mycmakeargs+=( -DBLA_VENDOR=FlexiBLAS )
|
|
54 |
else
|
|
55 |
mycmakeargs+=( BLA_VENDOR=Generic )
|
|
56 |
fi
|
|
57 |
# TODO: Figure out how to make sci-libs/mkl work. Bug 974246
|
|
58 |
|
| 41 |
59 |
cmake_src_configure
|
| 42 |
60 |
}
|