Skip to content

Commit

Permalink
sci-libs/suitesparse: bump to version 5.3.0
Browse files Browse the repository at this point in the history
With update to 5.3.0 the package no longer comes in several shared
packages, but in a single package containing the complete suite of
sparse matrix packages.

Package-Manager: Portage-2.3.51, Repoman-2.3.12
Manifest-Sign-Key: 0x2E246A4E715AA683
Signed-off-by: Bernd Waibel <[email protected]>
  • Loading branch information
waebbl committed Nov 25, 2018
1 parent d692797 commit 181d4b7
Show file tree
Hide file tree
Showing 5 changed files with 259 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sci-libs/suitesparse/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
AUX suitesparse-5.3.0-Makefile.patch 1468 BLAKE2B 355a5855bc3bf621c4304f66abb0b487a07ab4ee87558251e375ea883aca54c0bec1fc1ef4045271d0655240e66ef2bc04c6fdec3975e342addc4ab2a1e4b21b SHA512 73011af1eeb35a7f9f4bcbc147e83216cdd0a3a37bbe27ec3ce1172578d9a2a02c94c0de491eba1e51bdf8a9546e8a4ecf1cfb58710d3eb79f0bc6a5d54a0366
AUX suitesparse-5.3.0-config.patch 531 BLAKE2B d8f627b4f4278f0d934fb1800ced683139bf47354e8f1c221f9bd6ea380223c8065df0a802bc2f757d3a24bf04c67b523a1601757a6da5d899b8d2f64446ac5a SHA512 ba45ad732f301d9da6783dc6519ac63cb4693b4a1dfed8f35496097f5e7dd10579cc29e5a4ef0b4f2cbbdfe7ce0a6943ff733fa6873d5268869a8a8013d21628
DIST suitesparse-5.3.0.tar.gz 50500894 BLAKE2B 6af9fd39052a55a6f07dbac2e9199455747e61ab08be3e65ec5bb9cf2d0b42dd240edd9abfba560217232482b59ee74be3911de1b4bdf5e16dce77b719282e9e SHA512 a7ac655c5454c8270a52ece802946893f02d12c1bfb10546e24cd8355e59b733961526e9d702cd649b90b47bb325ace5110f70054db3754c732bc3ec1fa42cf9
EBUILD suitesparse-5.3.0.ebuild 4622 BLAKE2B 734ce26700aeeaafdec7b94b1ffabe6806bac9c6c71db276412747b836215e2964df836679214c85361465280e8de4d41c3c16698e682739c74a143b6d5e3e8a SHA512 70d9e29f47e514784bc895e3c5aa9627ddb4b29cb610e10877194e4fdfd25ee6e93e245327422716ae17ff608ebdba2bd2ee3e3a5a2e87eac7c1f95be5a95386
MISC metadata.xml 1699 BLAKE2B fd298ed713a1bb29de7a9e874e8b73ce6bc1a4cb45889e3a1d786d746e35c243fd8ce6dc1d74b03a18b70c29475f499fe21682d1dd1e63dead15bedbb54fa199 SHA512 19952506e14cd08ccb0182b468b9459bc05330fbd302ed92349b55b45ffda956a180f2b88c54a3702ee5fe515e791431cc179263ba85f32632c9b8652e0c61d8
42 changes: 42 additions & 0 deletions sci-libs/suitesparse/files/suitesparse-5.3.0-Makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
diff --git a/AMD/Lib/Makefile b/AMD/Lib/Makefile
index 3b92f6a..3c40cc2 100644
--- a/AMD/Lib/Makefile
+++ b/AMD/Lib/Makefile
@@ -62,7 +62,7 @@ $(AR_TARGET): $(OBJ)
# compile the Fortran versions and the libamdf77.a library (static only)
#-------------------------------------------------------------------------------

-fortran: libamdf77.a
+fortran: libamdf77.a libamdf77.so.$(VERSION)

AMDF77 = amd.o amdbar.o

@@ -76,6 +76,12 @@ libamdf77.a: $(AMDF77)
$(ARCHIVE) libamdf77.a $^
- $(RANLIB) libamdf77.a

+libamdf77.so.$(VERSION): $(AMDF77)
+ $(CC) $(SO_OPTS) $^ -o $@ $(LDLIBS)
+ ln -sf $@ libamdf77.so.$(SO_VERSION)
+ ln -sf $@ libamdf77.so
+ chmod 755 $@
+
#-------------------------------------------------------------------------------
# install (shared C version only)
#-------------------------------------------------------------------------------
@@ -98,6 +104,15 @@ $(INSTALL_LIB)/$(SO_TARGET): $(OBJ)
chmod 644 $(INSTALL_DOC)/AMD_UserGuide.pdf
chmod 644 $(INSTALL_DOC)/AMD_README.txt

+install-fortran: $(INSTALL_LIB)/libamdf77.so.$(VERSION)
+
+$(INSTALL_LIB)/libamdf77.so.$(VERSION): fortran
+ @mkdir -p $(INSTALL_LIB)
+ $(CC) $(SO_OPTS) $(AMDF77) -o $@ $(LDLIBS)
+ ( cd $(INSTALL_LIB) ; ln -sf libamdf77.so.$(VERSION) libamdf77.so.$(SO_VERSION) )
+ ( cd $(INSTALL_LIB) ; ln -sf libamdf77.so.$(VERSION) libamdf77.so )
+ chmod 755 $(INSTALL_LIB)/libamdf77.so.$(VERSION)
+
# uninstall AMD
uninstall:
$(RM) $(INSTALL_LIB)/$(SO_TARGET)
13 changes: 13 additions & 0 deletions sci-libs/suitesparse/files/suitesparse-5.3.0-config.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/SuiteSparse_config/SuiteSparse_config.mk b/SuiteSparse_config/SuiteSparse_config.mk
index f991b7a..1fbb7e9 100644
--- a/SuiteSparse_config/SuiteSparse_config.mk
+++ b/SuiteSparse_config/SuiteSparse_config.mk
@@ -348,7 +348,7 @@ SUITESPARSE_VERSION = 5.3.0

ifeq ($(UNAME),Linux)
# add the realtime library, librt, and SuiteSparse/lib
- LDLIBS += -lrt -Wl,-rpath=$(INSTALL_LIB)
+ LDLIBS += -lrt
endif

#---------------------------------------------------------------------------
38 changes: 38 additions & 0 deletions sci-libs/suitesparse/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>[email protected]</email>
<name>Gentoo Science Project</name>
</maintainer>
<longdescription lang="en">
<!-- FIXME: rework this -->
SuiteSparse is a suite of sparse matrix libraries from University of
Florida Computer Science Department. Currently, this includes:
* AMD: symmetric approximate minimum degree
* BTF: permutation to block triangular form
* CAMD: symmetric approximate minimum degree
* CCOLAMD: constrained column approximate minimum degree
* COLAMD: column approximate minimum degree
* CHOLMOD: sparse supernodal Cholesky factorization and update/downdate
* CSparse: a concise sparse matrix package
* CXSparse: an extended version of CSparse
* GraphBLAS: graph algorithms implemented with BLAS
* KLU: sparse LU factorization, for circuit simulation
* LDL: a simple LDL^T factorization
* Mongoose: graph partioning package
* RBio: read/write sparse matrices in Rutherford / Boeing format
* SPQR: multifrontal sparse QT factorization
* SuiteSparse_config: common configuration for all but CSparse
* UMFPACK: sparse multifrontal LU factorization
The Gentoo package does not include the suitesparse MATLAB tools from
upstream, from the packages above and the following MATLAB-only packages:
* LINFACTOR: solve Ax=b using LU or CHOL
* MESHND: 2D and 3D mesh generation and nested dissection
* SSMULT: sparse matrix times sparse matrix
</longdescription>
<use>
<flag name="cuda">Use CUDA for cholmod and spqr</flag>
<flag name="tbb">Use Intel's <pkg>dev-cpp/tbb</pkg> for threading</flag>
</use>
</pkgmetadata>
161 changes: 161 additions & 0 deletions sci-libs/suitesparse/suitesparse-5.3.0.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6

# FIXME: currently this is a safety measure. Is it really needed by the
# fortran modules?
FORTRAN_NEED_OPENMP=1

# FIXME: how to handle cmake without having a root CMakeLists.txt?
inherit fortran-2 toolchain-funcs

MY_PN="SuiteSparse"

DESCRIPTION="Package for a suite of sparse matrix tools"
HOMEPAGE="http://faculty.cse.tamu.edu/davis/suitesparse.html"
SRC_URI="http://faculty.cse.tamu.edu/davis/${MY_PN}/${MY_PN}-${PV}.tar.gz -> ${P}.tar.gz"

# BSD: amd, camd, ccolamd, colamd, ssget
# LGPL-2.1+: btf, cholmod/Check, choldmod/Cholesky, cholmod/Core,
# cholmod/Partition, cxsparse, klu, ldl
# GPL-2+: choldmod/Demo, cholmod/Matlab, cholmod/MatrixOps,
# cholmod/Modify, cholmod/Supernodal, cholmod/Tcov, cholmod/Valgrind,
# GPUQREngine, RBio, spqr, SuiteSparse_GPURuntime, umfpack
# Apache-2.0: GraphBLAS
# GPL-3: Mongoose
LICENSE="Apache-2.0 BSD GPL-2+ GPL-3 LGPL-2.1+"
SLOT="0"

KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"

FORTRAN_NEEDED="amd"

# FIXME: currently not included:
# Piro_Band, Skyline_SVD
# GraphBLAS and Mongoose are cmake based builds
# SuiteSparse_GPURuntime and GPUQREngine are part of spqr[cuda]
# FIXME: cuda is not compiling due to C/C++ mixing
# FIXME: testing
IUSE="cuda fortran tbb test"

RESTRICT="!test? ( test )"

# FIXME: Exclude the old packages. These could be removed once the package
# and revdeps are fully updated.
RDEPEND="
!<sci-libs/suitesparse-5
!sci-libs/amd
!sci-libs/btf
!sci-libs/camd
!sci-libs/ccolamd
!sci-libs/cholmod
!sci-libs/colamd
!sci-libs/cxsparse
!sci-libs/klu
!sci-libs/ldl
!sci-libs/spqr
!sci-libs/suitesparseconfig
!sci-libs/umfpack
|| ( >=sci-libs/metis-5.1.0-r3[openmp(+)] >=sci-libs/parmetis-4.0.3[openmp(+)] )
virtual/blas:=
virtual/lapack:=
cuda? (
>=dev-util/nvidia-cuda-toolkit-9.2.88:=
>=sci-libs/magma-2.4.0:=
)
tbb? ( >=dev-cpp/tbb-2017.20161128:= )
"

DEPEND="
${RDEPEND}
>=dev-util/indent-2.2.11-r1
>=sys-apps/grep-3.1
test? ( >=app-shells/tcsh-6.20.00 )
"

S=${WORKDIR}/${MY_PN}

PATCHES=(
"${FILESDIR}/${P}-config.patch"
"${FILESDIR}/${P}-Makefile.patch"
)

DOCS=( README.txt )

pkg_setup() {
# several of the packages need openmp support, so check for it early
tc-check-openmp || die "Need OpenMP to build ${P}"
}

src_compile() {
local myblas=$($(tc-getPKG_CONFIG) --libs blas)
local mylapack=$($(tc-getPKG_CONFIG) --libs lapack)
# FIXME: AUTOCC auto-enables intel compilers
local mymakeopts="OPTIMIZATION= AUTOCC=no"
mymakeopts="${mymakeopts} LAPACK=\"${mylapack}\" BLAS=\"${myblas}\""
mymakeopts="${mymakeopts} MY_METIS_LIB=-lmetis"
if use cuda; then
mymakeopts="${mymakeopts} CUDA=yes magma_inc=/usr magma_lib=/usr/$(get_libdir)"
else
mymakeopts="${mymakeopts} CUDA=no"
fi
if use fortran; then
local myf77=$(tc-getF77)
mymakeopts="${mymakeopts} F77=${myf77}"
fi
if use tbb; then
mymakeopts="${mymakeopts} TBB=-ltbb SPQR_CONFIG+=-DHAVE_TBB"
fi
use test && mymakeopts="${mymakeopts} TCOV=yes"
export LD_LIBRARY_PATH="${S}/lib"
emake ${mymakeopts} config # FIXME: remove on final ebuild
emake ${mymakeopts}
if use fortran; then
emake -C "${S}/AMD" fortran ${mymakeopts}
fi
}

src_test() {
local myblas=$($(tc-getPKG_CONFIG) --libs blas)
local mylapack=$($(tc-getPKG_CONFIG) --libs lapack)
local mytestargs="OPTIMIZATION= AUTOCC=no BLAS=${myblas} LAPACK=${mylapack}"
mytestargs="${mytestargs} MY_METIS_LIB=-lmetis"
if use cuda; then
mytestargs="${mytestargs} CUDA=yes magma_inc=/usr magma_lib=/usr/$(get_libdir)"
else
mytestargs="${mytestargs} CUDA=no"
fi
if use fortran; then
local myf77=$(tc-getF77)
mytestargs="${mytestargs} F77=${myf77}"
fi
if use tbb; then
mytestargs="${mytestargs} TBB=-ltbb SPQR_CONFIG+=-DHAVE_TBB"
fi
export LD_LIBRARY_PATH="${S}/lib"
emake ${mytestargs} cov
}

src_install() {
local myblas=$($(tc-getPKG_CONFIG) --libs blas)
local mylapack=$($(tc-getPKG_CONFIG) --libs lapack)
local myinstallargs="INSTALL=${ED%/}/usr INSTALL_LIB=${ED%/}/usr/$(get_libdir)"
myinstallargs="${myinstallargs} BLAS=${myblas} LAPACK=${mylapack} MY_METIS_LIB=-lmetis"
if use cuda; then
myinstallargs="${myinstallargs} CUDA=yes magma_inc=/usr magma_lib=/usr/$(get_libdir)"
else
myinstallargs="${myinstallargs} CUDA=no"
fi
if use fortran; then
local myf77=$(tc-getF77)
myinstallargs="${myinstallargs} F77=${myf77}"
fi
if use tbb; then
myinstallargs="${myinstallargs} TBB=-ltbb SPQR_CONFIG+=-DHAVE_TBB"
fi
emake ${myinstallargs} install
if use fortran; then
emake -C "${S}/AMD/Lib" ${myinstallargs} install-fortran
fi
}

0 comments on commit 181d4b7

Please sign in to comment.