| 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
|
|
6 |
inherit cmake
|
| 7 |
7 |
|
| 8 |
|
Sparse_PV="7.0.0"
|
|
8 |
Sparse_PV="7.12.2"
|
| 9 |
9 |
Sparse_P="SuiteSparse-${Sparse_PV}"
|
| 10 |
10 |
DESCRIPTION="Extended sparse matrix package"
|
| 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}/CXSparse"
|
| 14 |
15 |
LICENSE="LGPL-2.1"
|
| 15 |
16 |
SLOT="0/4"
|
| 16 |
|
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86"
|
|
17 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
|
| 17 |
18 |
IUSE="test"
|
| 18 |
19 |
RESTRICT="!test? ( test )"
|
| 19 |
20 |
|
| 20 |
21 |
DEPEND=">=sci-libs/suitesparseconfig-${Sparse_PV}"
|
| 21 |
22 |
RDEPEND="${DEPEND}"
|
| 22 |
23 |
|
| 23 |
|
S="${WORKDIR}/${Sparse_P}/CXSparse"
|
| 24 |
|
|
| 25 |
|
multilib_src_configure() {
|
|
24 |
src_configure() {
|
|
25 |
# Define SUITESPARSE_INCLUDEDIR_POSTFIX to "" otherwise it take
|
|
26 |
# the value suitesparse, and the include directory would be set to
|
|
27 |
# /usr/include/suitesparse
|
|
28 |
# This need to be set in all suitesparse ebuilds.
|
| 26 |
29 |
local mycmakeargs=(
|
| 27 |
|
-DNSTATIC=ON
|
| 28 |
|
-DDEMO=$(usex test)
|
|
30 |
-DBUILD_STATIC_LIBS=OFF
|
|
31 |
-DSUITESPARSE_DEMOS=$(usex test)
|
|
32 |
-DSUITESPARSE_INCLUDEDIR_POSTFIX=""
|
| 29 |
33 |
)
|
| 30 |
34 |
cmake_src_configure
|
| 31 |
35 |
}
|
| 32 |
36 |
|
| 33 |
|
multilib_src_test() {
|
|
37 |
src_test() {
|
|
38 |
# Because we are not using cmake_src_test,
|
|
39 |
# we have to manually go to BUILD_DIR
|
|
40 |
cd "${BUILD_DIR}" || die
|
| 34 |
41 |
# Programs assume that they can access the Matrix folder in ${S}
|
| 35 |
|
ln -s "${S}/Matrix" || die "cannot link to the Matrix folder"
|
|
42 |
ln -s "${S}/Matrix" || die
|
|
43 |
# cs_demo2, cs_di_demo2, cs_dl_demo2
|
|
44 |
local demo_set_1=(
|
|
45 |
ash219
|
|
46 |
bcsstk01
|
|
47 |
bcsstk16
|
|
48 |
fs_183_1
|
|
49 |
lp_afiro
|
|
50 |
mbeacxc
|
|
51 |
t1
|
|
52 |
west0067
|
|
53 |
)
|
|
54 |
# cs_demo3, cs_di_demo3, cs_dl_demo3
|
|
55 |
local demo_set_2=(
|
|
56 |
bcsstk01
|
|
57 |
bcsstk16
|
|
58 |
)
|
|
59 |
# cs_ci_demo2, cs_cl_demo2
|
|
60 |
local demo_set_3=(
|
|
61 |
c4
|
|
62 |
c_mbeacxc
|
|
63 |
c_west0067
|
|
64 |
mhd1280b
|
|
65 |
neumann
|
|
66 |
qc324
|
|
67 |
t2
|
|
68 |
t3
|
|
69 |
t4
|
|
70 |
young1c
|
|
71 |
)
|
|
72 |
# cs_ci_demo3, cs_cl_demo3
|
|
73 |
local demo_set_4=(
|
|
74 |
c4
|
|
75 |
mhd1280b
|
|
76 |
)
|
|
77 |
|
|
78 |
declare -A testsuite
|
|
79 |
testsuite+=(
|
|
80 |
["cs_idemo"]=t2
|
|
81 |
["cs_ldemo"]=t2
|
|
82 |
|
|
83 |
["cs_demo1"]=t1
|
|
84 |
["cs_demo2"]=${demo_set_1[@]}
|
|
85 |
["cs_demo3"]=${demo_set_2[@]}
|
|
86 |
|
|
87 |
["cs_ci_demo1"]=t2
|
|
88 |
["cs_ci_demo2"]=${demo_set_3[@]}
|
|
89 |
["cs_ci_demo3"]=${demo_set_4[@]}
|
|
90 |
|
|
91 |
["cs_cl_demo1"]=t2
|
|
92 |
["cs_cl_demo2"]=${demo_set_3[@]}
|
|
93 |
["cs_cl_demo3"]=${demo_set_4[@]}
|
|
94 |
|
|
95 |
["cs_di_demo1"]=t1
|
|
96 |
["cs_di_demo2"]=${demo_set_1[@]}
|
|
97 |
["cs_di_demo3"]=${demo_set_2[@]}
|
|
98 |
|
|
99 |
["cs_dl_demo1"]=t1
|
|
100 |
["cs_dl_demo2"]=${demo_set_1[@]}
|
|
101 |
["cs_dl_demo3"]=${demo_set_2[@]}
|
|
102 |
)
|
|
103 |
|
| 36 |
104 |
# Run demo files
|
| 37 |
|
./cs_idemo < Matrix/t2 || die "failed testing"
|
| 38 |
|
./cs_ldemo < Matrix/t2 || die "failed testing"
|
| 39 |
|
./cs_demo1 < Matrix/t1 || die "failed testing"
|
| 40 |
|
./cs_demo2 < Matrix/t1 || die "failed testing"
|
| 41 |
|
./cs_demo2 < Matrix/fs_183_1 || die "failed testing"
|
| 42 |
|
./cs_demo2 < Matrix/west0067 || die "failed testing"
|
| 43 |
|
./cs_demo2 < Matrix/lp_afiro || die "failed testing"
|
| 44 |
|
./cs_demo2 < Matrix/ash219 || die "failed testing"
|
| 45 |
|
./cs_demo2 < Matrix/mbeacxc || die "failed testing"
|
| 46 |
|
./cs_demo2 < Matrix/bcsstk01 || die "failed testing"
|
| 47 |
|
./cs_demo3 < Matrix/bcsstk01 || die "failed testing"
|
| 48 |
|
./cs_demo2 < Matrix/bcsstk16 || die "failed testing"
|
| 49 |
|
./cs_demo3 < Matrix/bcsstk16 || die "failed testing"
|
| 50 |
|
./cs_di_demo1 < Matrix/t1 || die "failed testing"
|
| 51 |
|
./cs_di_demo2 < Matrix/t1 || die "failed testing"
|
| 52 |
|
./cs_di_demo2 < Matrix/fs_183_1 || die "failed testing"
|
| 53 |
|
./cs_di_demo2 < Matrix/west0067 || die "failed testing"
|
| 54 |
|
./cs_di_demo2 < Matrix/lp_afiro || die "failed testing"
|
| 55 |
|
./cs_di_demo2 < Matrix/ash219 || die "failed testing"
|
| 56 |
|
./cs_di_demo2 < Matrix/mbeacxc || die "failed testing"
|
| 57 |
|
./cs_di_demo2 < Matrix/bcsstk01 || die "failed testing"
|
| 58 |
|
./cs_di_demo3 < Matrix/bcsstk01 || die "failed testing"
|
| 59 |
|
./cs_di_demo2 < Matrix/bcsstk16 || die "failed testing"
|
| 60 |
|
./cs_di_demo3 < Matrix/bcsstk16 || die "failed testing"
|
| 61 |
|
./cs_dl_demo1 < Matrix/t1 || die "failed testing"
|
| 62 |
|
./cs_dl_demo2 < Matrix/t1 || die "failed testing"
|
| 63 |
|
./cs_dl_demo2 < Matrix/fs_183_1 || die "failed testing"
|
| 64 |
|
./cs_dl_demo2 < Matrix/west0067 || die "failed testing"
|
| 65 |
|
./cs_dl_demo2 < Matrix/lp_afiro || die "failed testing"
|
| 66 |
|
./cs_dl_demo2 < Matrix/ash219 || die "failed testing"
|
| 67 |
|
./cs_dl_demo2 < Matrix/mbeacxc || die "failed testing"
|
| 68 |
|
./cs_dl_demo2 < Matrix/bcsstk01 || die "failed testing"
|
| 69 |
|
./cs_dl_demo3 < Matrix/bcsstk01 || die "failed testing"
|
| 70 |
|
./cs_dl_demo2 < Matrix/bcsstk16 || die "failed testing"
|
| 71 |
|
./cs_dl_demo3 < Matrix/bcsstk16 || die "failed testing"
|
| 72 |
|
./cs_ci_demo1 < Matrix/t2 || die "failed testing"
|
| 73 |
|
./cs_ci_demo2 < Matrix/t2 || die "failed testing"
|
| 74 |
|
./cs_ci_demo2 < Matrix/t3 || die "failed testing"
|
| 75 |
|
./cs_ci_demo2 < Matrix/t4 || die "failed testing"
|
| 76 |
|
./cs_ci_demo2 < Matrix/c_west0067 || die "failed testing"
|
| 77 |
|
./cs_ci_demo2 < Matrix/c_mbeacxc || die "failed testing"
|
| 78 |
|
./cs_ci_demo2 < Matrix/young1c || die "failed testing"
|
| 79 |
|
./cs_ci_demo2 < Matrix/qc324 || die "failed testing"
|
| 80 |
|
./cs_ci_demo2 < Matrix/neumann || die "failed testing"
|
| 81 |
|
./cs_ci_demo2 < Matrix/c4 || die "failed testing"
|
| 82 |
|
./cs_ci_demo3 < Matrix/c4 || die "failed testing"
|
| 83 |
|
./cs_ci_demo2 < Matrix/mhd1280b || die "failed testing"
|
| 84 |
|
./cs_ci_demo3 < Matrix/mhd1280b || die "failed testing"
|
| 85 |
|
./cs_cl_demo1 < Matrix/t2 || die "failed testing"
|
| 86 |
|
./cs_cl_demo2 < Matrix/t2 || die "failed testing"
|
| 87 |
|
./cs_cl_demo2 < Matrix/t3 || die "failed testing"
|
| 88 |
|
./cs_cl_demo2 < Matrix/t4 || die "failed testing"
|
| 89 |
|
./cs_cl_demo2 < Matrix/c_west0067 || die "failed testing"
|
| 90 |
|
./cs_cl_demo2 < Matrix/c_mbeacxc || die "failed testing"
|
| 91 |
|
./cs_cl_demo2 < Matrix/young1c || die "failed testing"
|
| 92 |
|
./cs_cl_demo2 < Matrix/qc324 || die "failed testing"
|
| 93 |
|
./cs_cl_demo2 < Matrix/neumann || die "failed testing"
|
| 94 |
|
./cs_cl_demo2 < Matrix/c4 || die "failed testing"
|
| 95 |
|
./cs_cl_demo3 < Matrix/c4 || die "failed testing"
|
| 96 |
|
./cs_cl_demo2 < Matrix/mhd1280b || die "failed testing"
|
| 97 |
|
./cs_cl_demo3 < Matrix/mhd1280b || die "failed testing"
|
|
105 |
local i
|
|
106 |
local j
|
|
107 |
for i in ${!testsuite[@]}; do
|
|
108 |
for j in ${testsuite[${i[@]}]}; do
|
|
109 |
./${i} < Matrix/${j} || die "failed testing ${i} with ${j}"
|
|
110 |
done
|
|
111 |
done
|
|
112 |
einfo "All tests passed"
|
| 98 |
113 |
}
|