extra/suitesparse to 4.5.3-1

This commit is contained in:
Kevin Mihelich 2016-09-25 15:32:28 +00:00
parent f0b48ad90f
commit d425bcb843
2 changed files with 31 additions and 63 deletions

View file

@ -2,10 +2,10 @@
# Maintainer: Ronald van Haren <ronald.archlinux.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - drop intel-tbb depend, remove -DHAVE_TBB
# - drop intel-tbb depend, remove TBB=-ltbb SPQR_CONFIG=-DHAVE_TBB
pkgname=suitesparse
pkgver=4.4.5
pkgver=4.5.3
pkgrel=1
pkgdesc="A collection of sparse matrix libraries"
url="http://faculty.cse.tamu.edu/davis/suitesparse.html"
@ -14,79 +14,36 @@ conflicts=('umfpack')
provides=('umfpack')
replaces=('umfpack')
depends=('blas' 'lapack')
makedepends=('gcc-fortran')
makedepends=('gcc-fortran' 'cmake' 'chrpath')
license=('GPL')
options=('staticlibs')
source=("http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-$pkgver.tar.gz")
sha1sums=('7666883423f56de760546a8be8795d5ac9d66c19')
source=("http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-$pkgver.tar.gz" suitesparse-link-tbb.patch)
sha1sums=('2403007be38266e3607edfbf3833bee7f6bcb0f1'
'4f0b3836e8c3c1ec5be01f988f136cee4a2cb936')
prepare() {
export CFLAGS=" ${CFLAGS} -DNPARTITION -fPIC"
# Fix linking with intel-tbb
cd SuiteSparse
patch -p1 -i ../suitesparse-link-tbb.patch
}
build() {
cd "$srcdir"/SuiteSparse
make -C SuiteSparse_config/xerbla
make -C SuiteSparse_config
for _lib in AMD CAMD COLAMD BTF KLU LDL CCOLAMD UMFPACK CHOLMOD CXSparse SPQR; do
make -C ${_lib} library
done
mkdir shared
# version numbers can be found in individual changelog files
ld -shared -soname libsuitesparseconfig.so.4 -o \
shared/libsuitesparseconfig.so.4.4.4 --whole-archive \
SuiteSparse_config/libsuitesparseconfig.a -lm && \
ln -sf libsuitesparseconfig.so.4.4.4 shared/libsuitesparseconfig.so
ld -shared -soname libamd.so.2 -o shared/libamd.so.2.4.1 \
--whole-archive AMD/Lib/libamd.a -L./shared -lsuitesparseconfig -lm && \
ln -sf libamd.so.2.4.1 shared/libamd.so
ld -shared -soname libcamd.so.2 -o shared/libcamd.so.2.4.1 \
--whole-archive CAMD/Lib/libcamd.a -L./shared -lsuitesparseconfig -lm && \
ln -sf libcamd.so.2.4.1 shared/libcamd.so
ld -shared -soname libcolamd.so.2 -o shared/libcolamd.so.2.9.1 \
--whole-archive COLAMD/Lib/libcolamd.a -L./shared -lsuitesparseconfig -lm \
&& ln -sf libcolamd.so.2.9.1 shared/libcolamd.so
ld -shared -soname libccolamd.so.2 -o shared/libccolamd.so.2.9.1 \
--whole-archive CCOLAMD/Lib/libccolamd.a -L./shared -lsuitesparseconfig -lm \
&& ln -sf libccolamd.so.2.9.1 shared/libccolamd.so
ld -shared -soname libbtf.so.1 -o shared/libbtf.so.1.2.1 \
--whole-archive BTF/Lib/libbtf.a && \
ln -sf libbtf.so.1.2.1 shared/libbtf.so
ld -shared -soname libldl.so.2 -o shared/libldl.so.2.2.1 \
--whole-archive LDL/Lib/libldl.a && \
ln -sf libldl.so.2.2.1 shared/libldl.so
ld -shared -soname libcholmod.so.3 -o shared/libcholmod.so.3.0.5 \
--whole-archive CHOLMOD/Lib/libcholmod.a -lblas -llapack \
-L./shared -lamd -lcamd -lcolamd -lccolamd -lsuitesparseconfig -lm && \
ln -sf libcholmod.so.3.0.5 shared/libcholmod.so
ld -shared -soname libspqr.so.2 -o shared/libspqr.so.2.0.1 \
--whole-archive SPQR/Lib/libspqr.a -lblas -llapack \
-L./shared -lcholmod -lsuitesparseconfig -lm && \
ln -sf libspqr.so.2.0.1 shared/libspqr.so
ld -shared -soname libcxsparse.so.3 -o shared/libcxsparse.so.3.1.4 \
--whole-archive CXSparse/Lib/libcxsparse.a && \
ln -sf libcxsparse.so.3.1.4 shared/libcxsparse.so
ld -shared -soname libklu.so.1 -o shared/libklu.so.1.3.2 \
--whole-archive KLU/Lib/libklu.a -L./shared -lamd -lbtf \
-lsuitesparseconfig -lm && ln -sf libklu.so.1.3.2 shared/libklu.so
ld -shared -soname libumfpack.so.5 -o shared/libumfpack.so.5.7.1 \
--whole-archive UMFPACK/Lib/libumfpack.a -lblas -llapack -L./shared \
-lamd -lcholmod -lsuitesparseconfig -lm && \
ln -sf libumfpack.so.5.7.1 shared/libumfpack.so
BLAS=-lblas make
}
package() {
cd "${srcdir}"/SuiteSparse
install -dm755 "${pkgdir}"/usr/{lib,include}
for _lib in SuiteSparse_config AMD CAMD COLAMD BTF KLU LDL CCOLAMD UMFPACK CHOLMOD CXSparse SPQR; do
make -C ${_lib} INSTALL_LIB="${pkgdir}"/usr/lib INSTALL_INCLUDE="${pkgdir}"/usr/include install
done
install -dm755 "${pkgdir}"/usr
rm -f "${pkgdir}"/usr/lib/*.a
cp -d shared/*.so* "${pkgdir}"/usr/lib/
ldconfig -n "${pkgdir}"/usr/lib/
chmod 644 "${pkgdir}"/usr/include/*.{h,hpp}
pushd metis-5.1.0
make install DESTDIR="$pkgdir"
mv "$pkgdir"/build/suitesparse/src/SuiteSparse/* "$pkgdir"/usr && rm -r "$pkgdir"/build
popd
BLAS=-lblas make INSTALL_LIB="${pkgdir}"/usr/lib INSTALL_INCLUDE="${pkgdir}"/usr/include install
# fix RPATH
chrpath -d "$pkgdir"/usr/lib/*
}

View file

@ -0,0 +1,11 @@
--- SuiteSparse/SPQR/Lib/Makefile.orig 2016-09-24 09:36:59.588640845 +0000
+++ SuiteSparse/SPQR/Lib/Makefile 2016-09-24 09:37:14.248588339 +0000
@@ -13,7 +13,7 @@
include ../../SuiteSparse_config/SuiteSparse_config.mk
# SPQR depends on CHOLMOD, AMD, COLAMD, LAPACK, the BLAS and SuiteSparse_config
-LDLIBS += -lamd -lcolamd -lcholmod -lsuitesparseconfig $(LAPACK) $(BLAS)
+LDLIBS += -lamd -lcolamd -lcholmod -lsuitesparseconfig $(LAPACK) $(BLAS) $(TBB)
# compile and install in SuiteSparse/lib
library: