Update to 5.4.0

Use upstream shared library builds
Build with metis
Explicitly list libraries and soname versions
This commit is contained in:
Orion Poplawski 2019-09-29 17:51:51 -06:00
parent 47757639a9
commit a2da4c20ad
2 changed files with 60 additions and 175 deletions

View File

@ -1 +1 @@
131a3a5e2dee784cd946284e44ce9af2 SuiteSparse-4.4.6.tar.gz
SHA512 (SuiteSparse-5.4.0.tar.gz) = 8328bcc2ef5eb03febf91b9c71159f091ff405c1ba7522e53714120fcf857ceab2d2ecf8bf9a2e1fc45e1a934665a341e3a47f954f87b59934f4fce6164775d6

View File

@ -1,35 +1,18 @@
%global amd_version 2.4.1
%global amd_version_major 2
%global btf_version 1.2.1
%global btf_version_major 1
%global camd_version 2.4.1
%global camd_version_major 2
%global ccolamd_version 2.9.1
%global ccolamd_version_major 2
%global cholmod_version 3.0.6
%global cholmod_version_major 3
%global colamd_version 2.9.1
%global colamd_version_major 2
%global csparse_version 3.1.4
%global csparse_version_major 3
%global cxsparse_version 3.1.4
%global cxsparse_version_major 3
%global klu_version 1.3.3
%global klu_version_major 1
%global ldl_version 2.2.1
%global ldl_version_major 2
%global rbio_version 2.2.1
%global rbio_version_major 2
%global spqr_version 2.0.1
%global spqr_version_major 2
%global SuiteSparse_config_ver 4.4.4
%global SuiteSparse_config_major 4
%global umfpack_version 5.7.1
%global SuiteSparse_config_major 5
%global umfpack_version_major 5
### CHOLMOD can also be compiled to use the METIS library, but it is not
### used here because its licensing terms exclude it from Fedora Extras.
### To compile with METIS, define enable_metis as 1 below.
%global enable_metis 0
### CXSparse is a superset of CSparse, and the two share common header
### names, so it does not make sense to build both. CXSparse is built
### by default, but CSparse can be built instead by defining
@ -37,8 +20,8 @@
%global enable_csparse 0
Name: suitesparse
Version: 4.4.6
Release: 20%{?dist}
Version: 5.4.0
Release: 1%{?dist}
Summary: A collection of sparse matrix libraries
License: (LGPLv2+ or BSD) and LGPLv2+ and GPLv2+
@ -48,6 +31,7 @@ Source0: http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-%{vers
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: metis-devel
BuildRequires: openblas-devel
BuildRequires: tbb-devel
BuildRequires: hardlink
@ -109,6 +93,7 @@ This package contains documentation files for %{name}.
%prep
%setup -q -n SuiteSparse
rm -r metis*
# Fix pragma ivdep so gcc understands it.
for fil in $(grep -Frl 'pragma ivdep' .); do
@ -121,33 +106,22 @@ done
sed -i -e '/^ CF =/ s/ -O3 -fexceptions//' SuiteSparse_config/SuiteSparse_config.mk
%build
mkdir -p Doc/{AMD,BTF,CAMD,CCOLAMD,CHOLMOD,COLAMD,KLU,LDL,UMFPACK,SPQR,RBio} Lib Include
export AUTOCC=no
export CC=gcc
# Makefiles look for metis.h specifically
ln -s %{_includedir}/metis/*.h include/
# TODO - Try to use upstream makefile - will build more components
mkdir -p Doc/{AMD,BTF,CAMD,CCOLAMD,CHOLMOD,COLAMD,KLU,LDL,UMFPACK,SPQR,RBio} Include
# SuiteSparse_config needs to come first
pushd SuiteSparse_config
make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
ar x libsuitesparseconfig.a
pushd ../Lib
gcc -shared %{?__global_ldflags} -Wl,-soname,libsuitesparseconfig.so.%{SuiteSparse_config_major} -o \
libsuitesparseconfig.so.%{SuiteSparse_config_ver} ../SuiteSparse_config/*.o -lm
ln -sf libsuitesparseconfig.so.%{SuiteSparse_config_ver} libsuitesparseconfig.so.%{SuiteSparse_config_major}
ln -sf libsuitesparseconfig.so.%{SuiteSparse_config_ver} libsuitesparseconfig.so
cp -p ../SuiteSparse_config/*.a ./
popd
%make_build CFLAGS="$RPM_OPT_FLAGS" LAPACK=-lopenblas
cp -p *.h ../Include
popd
pushd AMD
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
popd
pushd ../Lib
gcc -shared %{?__global_ldflags} -Wl,-soname,libamd.so.%{amd_version_major} -o \
libamd.so.%{amd_version} ../AMD/Lib/*.o \
libsuitesparseconfig.so.%{SuiteSparse_config_major} -lm
ln -sf libamd.so.%{amd_version} libamd.so.%{amd_version_major}
ln -sf libamd.so.%{amd_version} libamd.so
cp -p ../AMD/Lib/*.a ./
%make_build CFLAGS="$RPM_OPT_FLAGS" LAPACK=-lopenblas
popd
cp -p Include/*.h ../Include
cp -p README.txt Doc/License.txt Doc/lesser.txt Doc/ChangeLog Doc/*.pdf ../Doc/AMD
@ -155,14 +129,7 @@ popd
pushd BTF
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
popd
pushd ../Lib
gcc -shared %{?__global_ldflags} -Wl,-soname,libbtf.so.%{btf_version_major} -o \
libbtf.so.%{btf_version} ../BTF/Lib/*.o
ln -sf libbtf.so.%{btf_version} libbtf.so.%{btf_version_major}
ln -sf libbtf.so.%{btf_version} libbtf.so
cp -p ../BTF/Lib/*.a ./
%make_build CFLAGS="$RPM_OPT_FLAGS" LAPACK=-lopenblas
popd
cp -p Include/*.h ../Include
cp -p README.txt Doc/* ../Doc/BTF
@ -170,31 +137,15 @@ popd
pushd CAMD
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
popd
pushd ../Lib
gcc -shared %{?__global_ldflags} -Wl,-soname,libcamd.so.%{camd_version_major} -o \
libcamd.so.%{camd_version} ../CAMD/Lib/*.o \
libsuitesparseconfig.so.%{SuiteSparse_config_major} -lm
ln -sf libcamd.so.%{camd_version} libcamd.so.%{camd_version_major}
ln -sf libcamd.so.%{camd_version} libcamd.so
cp -p ../CAMD/Lib/*.a ./
%make_build CFLAGS="$RPM_OPT_FLAGS" LAPACK=-lopenblas
popd
cp -p Include/*.h ../Include
cp -p README.txt Doc/ChangeLog Doc/License Doc/*.pdf ../Doc/CAMD
cp -p README.txt Doc/ChangeLog Doc/License.txt Doc/*.pdf ../Doc/CAMD
popd
pushd CCOLAMD
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
popd
pushd ../Lib
gcc -shared %{?__global_ldflags} -Wl,-soname,libccolamd.so.%{ccolamd_version_major} -o \
libccolamd.so.%{ccolamd_version} ../CCOLAMD/Lib/*.o \
libsuitesparseconfig.so.%{SuiteSparse_config_major} -lm
ln -sf libccolamd.so.%{ccolamd_version} libccolamd.so.%{ccolamd_version_major}
ln -sf libccolamd.so.%{ccolamd_version} libccolamd.so
cp -p ../CCOLAMD/Lib/*.a ./
%make_build CFLAGS="$RPM_OPT_FLAGS" LAPACK=-lopenblas
popd
cp -p Include/*.h ../Include
cp -p README.txt Doc/* ../Doc/CCOLAMD
@ -202,63 +153,32 @@ popd
pushd COLAMD
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
popd
pushd ../Lib
gcc -shared %{?__global_ldflags} -Wl,-soname,libcolamd.so.%{colamd_version_major} -o \
libcolamd.so.%{colamd_version} ../COLAMD/Lib/*.o \
libsuitesparseconfig.so.%{SuiteSparse_config_major} -lm
ln -sf libcolamd.so.%{colamd_version} libcolamd.so.%{colamd_version_major}
ln -sf libcolamd.so.%{colamd_version} libcolamd.so
cp -p ../COLAMD/Lib/*.a ./
%make_build CFLAGS="$RPM_OPT_FLAGS" LAPACK=-lopenblas
popd
cp -p Include/*.h ../Include
cp -p README.txt Doc/* ../Doc/COLAMD
popd
%if "%{?enable_metis}" == "1"
CHOLMOD_FLAGS="$RPM_OPT_FLAGS -I%{_includedir}/metis"
%else
CHOLMOD_FLAGS="$RPM_OPT_FLAGS -DNPARTITION"
%endif
pushd CHOLMOD
pushd Lib
make CFLAGS="$CHOLMOD_FLAGS" %{?_smp_mflags}
popd
pushd ../Lib
gcc -shared %{?__global_ldflags} -Wl,-soname,libcholmod.so.%{cholmod_version_major} -o \
libcholmod.so.%{cholmod_version} ../CHOLMOD/Lib/*.o \
-lopenblas \
libamd.so.%{amd_version_major} \
libcamd.so.%{camd_version_major} libcolamd.so.%{colamd_version_major} \
libccolamd.so.%{ccolamd_version_major} \
libsuitesparseconfig.so.%{SuiteSparse_config_major} -lm
ln -sf libcholmod.so.%{cholmod_version} libcholmod.so.%{cholmod_version_major}
ln -sf libcholmod.so.%{cholmod_version} libcholmod.so
cp -p ../CHOLMOD/Lib/*.a ./
%make_build CFLAGS="$CHOLMOD_FLAGS" LAPACK=-lopenblas
popd
cp -p Include/*.h ../Include
cp -p README.txt Doc/*.pdf ../Doc/CHOLMOD
cp -p Cholesky/License.txt ../Doc/CHOLMOD/Cholesky_License.txt
cp -p Core/License.txt ../Doc/CHOLMOD/Core_License.txt
cp -p MatrixOps/License.txt ../Doc/CHOLMOD/MatrixOps_License.txt
cp -p Partition/License.txt ../Doc/CHOLMOD/Partition_License.txt
cp -p Supernodal/License.txt ../Doc/CHOLMOD/Supernodal_License.txt
cp -p Cholesky/lesser.txt ../Doc/CHOLMOD/Cholesky_License.txt
cp -p Core/lesser.txt ../Doc/CHOLMOD/Core_License.txt
cp -p MatrixOps/gpl.txt ../Doc/CHOLMOD/MatrixOps_License.txt
cp -p Partition/lesser.txt ../Doc/CHOLMOD/Partition_License.txt
cp -p Supernodal/gpl.txt ../Doc/CHOLMOD/Supernodal_License.txt
popd
%if "%{?enable_csparse}" == "1"
pushd CSparse
pushd Source
make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
%make_build CFLAGS="$RPM_OPT_FLAGS" LAPACK=-lopenblas
cp -p cs.h ../../Include
popd
pushd ../Lib
gcc -shared %{?__global_ldflags} -Wl,-soname,libcsparse.so.%{csparse_version_major} -o \
libcsparse.so.%{csparse_version} ../CSparse/Source/*.o -lm
ln -sf libcsparse.so.%{csparse_version} libcsparse.so.%{csparse_version_major}
ln -sf libcsparse.so.%{csparse_version} libcsparse.so
cp -p ../CSparse/Source/*.a ./
popd
mkdir ../Doc/CSparse/
cp -p Doc/* ../Doc/CSparse
popd
@ -266,14 +186,7 @@ popd
%else
pushd CXSparse
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
popd
pushd ../Lib
gcc -shared %{?__global_ldflags} -Wl,-soname,libcxsparse.so.%{cxsparse_version_major} -o \
libcxsparse.so.%{cxsparse_version} ../CXSparse/Lib/*.o -lm
ln -sf libcxsparse.so.%{cxsparse_version} libcxsparse.so.%{cxsparse_version_major}
ln -sf libcxsparse.so.%{cxsparse_version} libcxsparse.so
cp -p ../CXSparse/Lib/*.a ./
%make_build CFLAGS="$RPM_OPT_FLAGS" LAPACK=-lopenblas
popd
cp -p Include/cs.h ../Include
mkdir ../Doc/CXSparse/
@ -283,17 +196,7 @@ popd
pushd KLU
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
popd
pushd ../Lib
gcc -shared %{?__global_ldflags} -Wl,-soname,libklu.so.%{klu_version_major} -o \
libklu.so.%{klu_version} ../KLU/Lib/*.o \
libamd.so.%{amd_version_major} libcolamd.so.%{colamd_version_major} \
libbtf.so.%{btf_version_major} \
libsuitesparseconfig.so.%{SuiteSparse_config_major}
ln -sf libklu.so.%{klu_version} libklu.so.%{klu_version_major}
ln -sf libklu.so.%{klu_version} libklu.so
cp -p ../KLU/Lib/*.a ./
%make_build CFLAGS="$RPM_OPT_FLAGS" LAPACK=-lopenblas
popd
cp -p Include/*.h ../Include
cp -p README.txt Doc/lesser.txt ../Doc/KLU
@ -301,14 +204,7 @@ popd
pushd LDL
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
popd
pushd ../Lib
gcc -shared %{?__global_ldflags} -Wl,-soname,libldl.so.%{ldl_version_major} -o \
libldl.so.%{ldl_version} ../LDL/Lib/*.o
ln -sf libldl.so.%{ldl_version} libldl.so.%{ldl_version_major}
ln -sf libldl.so.%{ldl_version} libldl.so
cp -p ../LDL/Lib/*.a ./
%make_build CFLAGS="$RPM_OPT_FLAGS" LAPACK=-lopenblas
popd
cp -p Include/*.h ../Include
cp -p README.txt Doc/ChangeLog Doc/lesser.txt Doc/*.pdf ../Doc/LDL
@ -316,37 +212,15 @@ popd
pushd UMFPACK
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
popd
pushd ../Lib
gcc -shared %{?__global_ldflags} -Wl,-soname,libumfpack.so.%{umfpack_version_major} -o \
libumfpack.so.%{umfpack_version} ../UMFPACK/Lib/*.o \
-lopenblas \
libamd.so.%{amd_version_major} \
libcholmod.so.%{cholmod_version_major} \
libsuitesparseconfig.so.%{SuiteSparse_config_major} -lm
ln -sf libumfpack.so.%{umfpack_version} libumfpack.so.%{umfpack_version_major}
ln -sf libumfpack.so.%{umfpack_version} libumfpack.so
cp -p ../UMFPACK/Lib/*.a ./
%make_build CFLAGS="$RPM_OPT_FLAGS" LAPACK=-lopenblas
popd
cp -p Include/*.h ../Include
cp -p README.txt Doc/License Doc/ChangeLog Doc/gpl.txt Doc/*.pdf ../Doc/UMFPACK
cp -p README.txt Doc/License.txt Doc/ChangeLog Doc/gpl.txt Doc/*.pdf ../Doc/UMFPACK
popd
pushd SPQR
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS -DHAVE_TBB -DNPARTITION" %{?_smp_mflags}
popd
pushd ../Lib
g++ -shared %{?__global_ldflags} -Wl,-soname,libspqr.so.%{spqr_version_major} -o \
libspqr.so.%{spqr_version} ../SPQR/Lib/*.o \
-lopenblas \
-ltbb \
libcholmod.so.%{cholmod_version_major} \
libsuitesparseconfig.so.%{SuiteSparse_config_major} -lm
ln -sf libspqr.so.%{spqr_version} libspqr.so.%{spqr_version_major}
ln -sf libspqr.so.%{spqr_version} libspqr.so
cp -p ../SPQR/Lib/*.a ./
%make_build CFLAGS="$RPM_OPT_FLAGS -DHAVE_TBB -DNPARTITION" LAPACK=-lopenblas TBB=-ltbb
popd
cp -p Include/*.h* ../Include
cp -p README{,_SPQR}.txt
@ -355,15 +229,7 @@ popd
pushd RBio
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
popd
pushd ../Lib
gcc -shared %{?__global_ldflags} -Wl,-soname,librbio.so.%{rbio_version_major} -o \
librbio.so.%{rbio_version} ../RBio/Lib/*.o \
libsuitesparseconfig.so.%{SuiteSparse_config_major}
ln -sf librbio.so.%{rbio_version} librbio.so.%{rbio_version_major}
ln -sf librbio.so.%{rbio_version} librbio.so
cp -p ../RBio/Lib/*.a ./
%make_build CFLAGS="$RPM_OPT_FLAGS" LAPACK=-lopenblas
popd
cp -p Include/*.h ../Include
cp -p README.txt Doc/ChangeLog Doc/License.txt ../Doc/RBio
@ -372,11 +238,7 @@ popd
%install
mkdir -p ${RPM_BUILD_ROOT}%{_libdir}
mkdir -p ${RPM_BUILD_ROOT}%{_includedir}/%{name}
pushd Lib
for f in *.a *.so*; do
cp -a $f ${RPM_BUILD_ROOT}%{_libdir}/$f
done
popd
cp -a */Lib/*.a lib/*.so* ${RPM_BUILD_ROOT}%{_libdir}/
chmod 755 ${RPM_BUILD_ROOT}%{_libdir}/*.so.*
pushd Include
for f in *.h *.hpp; do
@ -399,6 +261,8 @@ find */ -iname lesser.txt -o -iname license.txt -o -iname gpl.txt -o \
hardlink -cv Docs/ Licenses/
%check
export AUTOCC=no
export CC=gcc
TESTDIRS="AMD CAMD CCOLAMD CHOLMOD COLAMD KLU LDL SPQR RBio UMFPACK"
%if "%{?enable_csparse}" == "1"
TESTDIRS="$TESTDIRS CSparse"
@ -406,12 +270,27 @@ TESTDIRS="$TESTDIRS CSparse"
TESTDIRS="$TESTDIRS CXSparse"
%endif
for d in $TESTDIRS ; do
make -C $d/Demo CFLAGS="$RPM_OPT_FLAGS" LIB="%{?__global_ldflags} -lm -lrt" LAPACK="" SPQR_CONFIG=-DHAVE_TBB TBB=-ltbb
%make_build -C $d/Demo CFLAGS="$RPM_OPT_FLAGS" LIB="%{?__global_ldflags} -lm -lrt" LAPACK="" SPQR_CONFIG=-DHAVE_TBB TBB=-ltbb
done
%files
%license Licenses
%{_libdir}/lib*.so.*
%{_libdir}/libamd.so.%{amd_version_major}*
%{_libdir}/libbtf.so.%{btf_version_major}*
%{_libdir}/libcamd.so.%{camd_version_major}*
%{_libdir}/libccolamd.so.%{ccolamd_version_major}*
%{_libdir}/libcholmod.so.%{cholmod_version_major}*
%{_libdir}/libcolamd.so.%{colamd_version_major}*
%if "%{?enable_csparse}" == "1"
%{_libdir}/libcsparse.so.%{csparse_version_major}*
%endif
%{_libdir}/libcxsparse.so.%{cxsparse_version_major}*
%{_libdir}/libklu.so.%{klu_version_major}*
%{_libdir}/libldl.so.%{ldl_version_major}*
%{_libdir}/librbio.so.%{rbio_version_major}*
%{_libdir}/libspqr.so.%{spqr_version_major}*
%{_libdir}/libsuitesparseconfig.so.%{SuiteSparse_config_major}*
%{_libdir}/libumfpack.so.%{umfpack_version_major}*
%files devel
%{_includedir}/%{name}
@ -424,6 +303,12 @@ done
%doc Doc/*
%changelog
* Sun Sep 29 2019 Orion Poplawski <orion@nwra.com> - 5.4.0-1
- Update to 5.4.0
- Use upstream shared library builds
- Build with metis
- Explicitly list libraries and soname versions
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.4.6-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild