Skip to content

Commit 11f9f22

Browse files
committed
sci-libs/suitesparse: bump to version 5.4.0
With update to 5.4.0 the package no longer comes in several shared packages, but in a single package containing the complete suite of sparse matrix packages. Restricts tests for now, as they fail in cholmod module. Package-Manager: Portage-2.3.69, Repoman-2.3.12 Manifest-Sign-Key: 0x2E246A4E715AA683 Signed-off-by: Bernd Waibel <[email protected]>
1 parent 3513729 commit 11f9f22

File tree

5 files changed

+297
-0
lines changed

5 files changed

+297
-0
lines changed

sci-libs/suitesparse/Manifest

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DIST suitesparse-5.4.0.tar.gz 52594099 BLAKE2B e7e2400d2d24c5e029cad7b6afd572077333e341d74c4f065e9eea793f6d5dad466d762153a97a57dbec40a86790c2db144122957beb68de083b15c6f5ebd204 SHA512 8328bcc2ef5eb03febf91b9c71159f091ff405c1ba7522e53714120fcf857ceab2d2ecf8bf9a2e1fc45e1a934665a341e3a47f954f87b59934f4fce6164775d6
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
From 9ec0dbdc11267e940c9932a2a02ea3cceea78673 Mon Sep 17 00:00:00 2001
2+
From: Bernd Waibel <[email protected]>
3+
Date: Sat, 20 Jul 2019 16:47:32 +0200
4+
Subject: [PATCH 1/2] Suitesparse_config/Suitesparse_config.mk: drop RPATH
5+
6+
Signed-off-by: Bernd Waibel <[email protected]>
7+
---
8+
SuiteSparse_config/SuiteSparse_config.mk | 2 +-
9+
1 file changed, 1 insertion(+), 1 deletion(-)
10+
11+
diff --git a/SuiteSparse_config/SuiteSparse_config.mk b/SuiteSparse_config/SuiteSparse_config.mk
12+
index 19a3903..c70c237 100644
13+
--- a/SuiteSparse_config/SuiteSparse_config.mk
14+
+++ b/SuiteSparse_config/SuiteSparse_config.mk
15+
@@ -358,7 +358,7 @@ SUITESPARSE_VERSION = 5.4.0
16+
17+
ifeq ($(UNAME),Linux)
18+
# add the realtime library, librt, and SuiteSparse/lib
19+
- LDLIBS += -lrt -Wl,-rpath=$(INSTALL_LIB)
20+
+ LDLIBS += -lrt
21+
endif
22+
23+
#---------------------------------------------------------------------------
24+
--
25+
2.22.0
26+
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
From 7394b9923afb8703322dfeb8927c1dcf8144a67f Mon Sep 17 00:00:00 2001
2+
From: Bernd Waibel <[email protected]>
3+
Date: Sat, 20 Jul 2019 16:48:56 +0200
4+
Subject: [PATCH 2/2] AMD/Lib/Makefile: also build shared library
5+
6+
Signed-off-by: Bernd Waibel <[email protected]>
7+
---
8+
AMD/Lib/Makefile | 19 +++++++++++++++++--
9+
1 file changed, 17 insertions(+), 2 deletions(-)
10+
11+
diff --git a/AMD/Lib/Makefile b/AMD/Lib/Makefile
12+
index 3b92f6a..5b558a5 100644
13+
--- a/AMD/Lib/Makefile
14+
+++ b/AMD/Lib/Makefile
15+
@@ -11,7 +11,7 @@ default: library
16+
include ../../SuiteSparse_config/SuiteSparse_config.mk
17+
18+
# AMD depends on SuiteSparse_config
19+
-LDLIBS += -lsuitesparseconfig
20+
+LDLIBS += -lsuitesparseconfig -lgfortran
21+
22+
# compile and install in SuiteSparse/lib
23+
library:
24+
@@ -62,7 +62,7 @@ $(AR_TARGET): $(OBJ)
25+
# compile the Fortran versions and the libamdf77.a library (static only)
26+
#-------------------------------------------------------------------------------
27+
28+
-fortran: libamdf77.a
29+
+fortran: libamdf77.a libamdf77.so.$(VERSION)
30+
31+
AMDF77 = amd.o amdbar.o
32+
33+
@@ -76,6 +76,12 @@ libamdf77.a: $(AMDF77)
34+
$(ARCHIVE) libamdf77.a $^
35+
- $(RANLIB) libamdf77.a
36+
37+
+libamdf77.so.$(VERSION): $(AMDF77)
38+
+ $(CC) $(SO_OPTS) $^ -o $@ $(LDLIBS)
39+
+ ln -sf $@ libamdf77.so.$(SO_VERSION)
40+
+ ln -sf $@ libamdf77.so
41+
+ chmod 755 $@
42+
+
43+
#-------------------------------------------------------------------------------
44+
# install (shared C version only)
45+
#-------------------------------------------------------------------------------
46+
@@ -98,6 +104,15 @@ $(INSTALL_LIB)/$(SO_TARGET): $(OBJ)
47+
chmod 644 $(INSTALL_DOC)/AMD_UserGuide.pdf
48+
chmod 644 $(INSTALL_DOC)/AMD_README.txt
49+
50+
+install-fortran: $(INSTALL_LIB)/libamdf77.so.$(VERSION)
51+
+
52+
+$(INSTALL_LIB)/libamdf77.so.$(VERSION): fortran
53+
+ @mkdir -p $(INSTALL_LIB)
54+
+ $(CC) $(SO_OPTS) $(AMDF77) -o $@ $(LDLIBS)
55+
+ ( cd $(INSTALL_LIB) ; ln -sf libamdf77.so.$(VERSION) libamdf77.so.$(SO_VERSION) )
56+
+ ( cd $(INSTALL_LIB) ; ln -sf libamdf77.so.$(VERSION) libamdf77.so )
57+
+ chmod 755 $(INSTALL_LIB)/libamdf77.so.$(VERSION)
58+
+
59+
# uninstall AMD
60+
uninstall:
61+
$(RM) $(INSTALL_LIB)/$(SO_TARGET)
62+
--
63+
2.22.0
64+

sci-libs/suitesparse/metadata.xml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
3+
<pkgmetadata>
4+
<maintainer type="project">
5+
<email>[email protected]</email>
6+
<name>Gentoo Science Project</name>
7+
</maintainer>
8+
<longdescription lang="en">
9+
<!-- FIXME: rework this -->
10+
SuiteSparse is a suite of sparse matrix libraries from University of
11+
Florida Computer Science Department. Currently, this includes:
12+
* AMD: symmetric approximate minimum degree
13+
* BTF: permutation to block triangular form
14+
* CAMD: symmetric approximate minimum degree
15+
* CCOLAMD: constrained column approximate minimum degree
16+
* COLAMD: column approximate minimum degree
17+
* CHOLMOD: sparse supernodal Cholesky factorization and update/downdate
18+
* CSparse: a concise sparse matrix package
19+
* CXSparse: an extended version of CSparse
20+
* GraphBLAS: graph algorithms implemented with BLAS
21+
* KLU: sparse LU factorization, for circuit simulation
22+
* LDL: a simple LDL^T factorization
23+
* Mongoose: graph partioning package
24+
* RBio: read/write sparse matrices in Rutherford / Boeing format
25+
* SPQR: multifrontal sparse QT factorization
26+
* SuiteSparse_config: common configuration for all but CSparse
27+
* UMFPACK: sparse multifrontal LU factorization
28+
The Gentoo package does not include the suitesparse MATLAB tools from
29+
upstream, from the packages above and the following MATLAB-only packages:
30+
* LINFACTOR: solve Ax=b using LU or CHOL
31+
* MESHND: 2D and 3D mesh generation and nested dissection
32+
* SSMULT: sparse matrix times sparse matrix
33+
</longdescription>
34+
<use>
35+
<flag name="cuda">Use CUDA for cholmod and spqr</flag>
36+
<flag name="tbb">Use Intel's <pkg>dev-cpp/tbb</pkg> for threading</flag>
37+
</use>
38+
</pkgmetadata>
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
# Copyright 1999-2019 Gentoo Authors
2+
# Distributed under the terms of the GNU General Public License v2
3+
4+
EAPI=7
5+
6+
# FIXME: currently this is a safety measure. Is it really needed by the
7+
# fortran modules?
8+
FORTRAN_NEED_OPENMP=1
9+
10+
# FIXME: how to handle cmake without having a root CMakeLists.txt?
11+
inherit fortran-2 multiprocessing toolchain-funcs
12+
13+
MY_PN="SuiteSparse"
14+
15+
DESCRIPTION="Package for a suite of sparse matrix tools"
16+
HOMEPAGE="http://faculty.cse.tamu.edu/davis/suitesparse.html"
17+
SRC_URI="http://faculty.cse.tamu.edu/davis/${MY_PN}/${MY_PN}-${PV}.tar.gz -> ${P}.tar.gz"
18+
19+
# BSD: amd, camd, ccolamd, colamd, ssget
20+
# LGPL-2.1+: btf, cholmod/Check, choldmod/Cholesky, cholmod/Core,
21+
# cholmod/Partition, cxsparse, klu, ldl
22+
# GPL-2+: choldmod/Demo, cholmod/Matlab, cholmod/MatrixOps,
23+
# cholmod/Modify, cholmod/Supernodal, cholmod/Tcov, cholmod/Valgrind,
24+
# GPUQREngine, RBio, spqr, SuiteSparse_GPURuntime, umfpack
25+
# Apache-2.0: GraphBLAS
26+
# GPL-3: Mongoose
27+
LICENSE="Apache-2.0 BSD GPL-2+ GPL-3 LGPL-2.1+"
28+
SLOT="0"
29+
30+
KEYWORDS="~amd64 ~x86"
31+
32+
FORTRAN_NEEDED="amd"
33+
34+
# FIXME: currently not included:
35+
# Piro_Band, Skyline_SVD
36+
# GraphBLAS and Mongoose are cmake based builds
37+
# SuiteSparse_GPURuntime and GPUQREngine are part of spqr[cuda]
38+
# FIXME: cuda is not compiling due to C/C++ mixing
39+
# FIXME: testing
40+
IUSE="cuda fortran tbb test"
41+
42+
# Tests currently fail in cholmod library
43+
#RESTRICT="!test? ( test )"
44+
RESTRICT="test"
45+
46+
# FIXME: Exclude the old packages. These could be removed once the package
47+
# and revdeps are fully updated.
48+
RDEPEND="
49+
!<sci-libs/suitesparse-5
50+
!sci-libs/amd
51+
!sci-libs/btf
52+
!sci-libs/camd
53+
!sci-libs/ccolamd
54+
!sci-libs/cholmod
55+
!sci-libs/colamd
56+
!sci-libs/cxsparse
57+
!sci-libs/klu
58+
!sci-libs/ldl
59+
!sci-libs/spqr
60+
!sci-libs/suitesparseconfig
61+
!sci-libs/umfpack
62+
|| ( >=sci-libs/metis-5.1.0-r3[openmp(+)] >=sci-libs/parmetis-4.0.3[openmp(+)] )
63+
virtual/blas
64+
virtual/lapack
65+
cuda? (
66+
>=dev-util/nvidia-cuda-toolkit-9.2.88:=
67+
>=sci-libs/magma-2.4.0
68+
)
69+
tbb? ( >=dev-cpp/tbb-2017.20161128 )
70+
"
71+
72+
DEPEND="
73+
${RDEPEND}
74+
sys-devel/m4
75+
test? ( >=app-shells/tcsh-6.20.00 )
76+
"
77+
BDEPEND=">=sys-apps/grep-3.1"
78+
79+
S=${WORKDIR}/${MY_PN}
80+
81+
PATCHES=(
82+
"${FILESDIR}/${P}-0001-Suitesparse_config-Suitesparse_config.mk-drop-RPATH.patch"
83+
"${FILESDIR}/${P}-0002-AMD-Lib-Makefile-also-build-shared-library.patch"
84+
)
85+
86+
DOCS=( README.txt )
87+
88+
pkg_setup() {
89+
# several of the packages need openmp support, so check for it early
90+
tc-check-openmp || die "Need OpenMP to build ${P}"
91+
}
92+
93+
src_compile() {
94+
local myblas=$($(tc-getPKG_CONFIG) --libs blas)
95+
local mylapack=$($(tc-getPKG_CONFIG) --libs lapack)
96+
# FIXME: AUTOCC auto-enables intel compilers
97+
local mymakeopts="OPTIMIZATION= AUTOCC=no JOBS=$(makeopts_jobs)"
98+
mymakeopts="${mymakeopts} INSTALL=${ED}/usr INSTALL_LIB=${ED}/usr/$(get_libdir)"
99+
mymakeopts="${mymakeopts} LAPACK=\"${mylapack}\" BLAS=\"${myblas}\""
100+
mymakeopts="${mymakeopts} MY_METIS_LIB=-lmetis"
101+
if use cuda; then
102+
mymakeopts="${mymakeopts} CUDA=yes magma_inc=${EPREFIX}/usr magma_lib=${EPREFIX}/usr/$(get_libdir) -lmagma"
103+
mymakeopts="${mymakeopts} CHOLDMOD_CONFIG+=-DGPU_BLAS SPQR_CONFIG+=-DGPU_BLAS"
104+
else
105+
mymakeopts="${mymakeopts} CUDA=no"
106+
fi
107+
if use fortran; then
108+
local myf77=$(tc-getF77)
109+
mymakeopts="${mymakeopts} F77=${myf77}"
110+
fi
111+
if use tbb; then
112+
mymakeopts="${mymakeopts} TBB=-ltbb SPQR_CONFIG+=-DHAVE_TBB"
113+
fi
114+
use test && mymakeopts="${mymakeopts} TCOV=yes"
115+
export LD_LIBRARY_PATH="${S}/lib"
116+
# emake ${mymakeopts} config # FIXME: remove on final ebuild
117+
emake ${mymakeopts} library
118+
# use static-libs && emake ${mymakeopts} static
119+
if use fortran; then
120+
emake -C "${S}/AMD" ${mymakeopts} fortran
121+
fi
122+
}
123+
124+
src_test() {
125+
local myblas=$($(tc-getPKG_CONFIG) --libs blas)
126+
local mylapack=$($(tc-getPKG_CONFIG) --libs lapack)
127+
local mytestargs="OPTIMIZATION= AUTOCC=no BLAS=${myblas} LAPACK=${mylapack}"
128+
mytestargs="${mytestargs} MY_METIS_LIB=-lmetis"
129+
if use cuda; then
130+
mytestargs="${mytestargs} CUDA=yes magma_inc=${EPREFIX}/usr magma_lib=${EPREFIX}/usr/$(get_libdir) -lmagma"
131+
mytestargs="${mytestargs} CHOLDMOD_CONFIG+=-DGPU_BLAS SPQR_CONFIG+=-DGPU_BLAS"
132+
else
133+
mytestargs="${mytestargs} CUDA=no"
134+
fi
135+
if use fortran; then
136+
local myf77=$(tc-getF77)
137+
mytestargs="${mytestargs} F77=${myf77}"
138+
fi
139+
if use tbb; then
140+
mytestargs="${mytestargs} TBB=-ltbb SPQR_CONFIG+=-DHAVE_TBB"
141+
fi
142+
export LD_LIBRARY_PATH="${S}/lib"
143+
emake ${mytestargs} cov
144+
}
145+
146+
src_install() {
147+
local myblas=$($(tc-getPKG_CONFIG) --libs blas)
148+
local mylapack=$($(tc-getPKG_CONFIG) --libs lapack)
149+
local myinstallargs="INSTALL=${ED}/usr INSTALL_LIB=${ED}/usr/$(get_libdir)"
150+
myinstallargs="${myinstallargs} BLAS=${myblas} LAPACK=${mylapack} MY_METIS_LIB=-lmetis"
151+
if use cuda; then
152+
myinstallargs="${myinstallargs} CUDA=yes magma_inc=${EPREFIX}/usr magma_lib=${EPREFIX}/usr/$(get_libdir) -lmagma"
153+
myinstallargs="${myinstallargs} CHOLMOD_CONFIG+=-DGPU_BLAS SPQR_CONFIG+=-DGPU_BLAS"
154+
else
155+
myinstallargs="${myinstallargs} CUDA=no"
156+
fi
157+
if use fortran; then
158+
local myf77=$(tc-getF77)
159+
myinstallargs="${myinstallargs} F77=${myf77}"
160+
fi
161+
if use tbb; then
162+
myinstallargs="${myinstallargs} TBB=-ltbb SPQR_CONFIG+=-DHAVE_TBB"
163+
fi
164+
emake ${myinstallargs} install
165+
if use fortran; then
166+
emake -C "${S}/AMD/Lib" ${myinstallargs} install-fortran
167+
fi
168+
}

0 commit comments

Comments
 (0)