libsuitesparse/libsuitesparse.spec

465 lines
15 KiB
RPMSpec

Name: libsuitesparse
Version: 5.11.0
Release: 1mamba
Summary: A collection of sparse matrix libraries
Group: System/Libraries
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://people.engr.tamu.edu/davis/suitesparse.html
Source: https://github.com/DrTimothyAldenDavis/SuiteSparse.git/v%{version}/SuiteSparse-%{version}.tar.bz2
License: GPL, LGPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libatlas-devel
BuildRequires: libgcc
BuildRequires: libgomp-devel
%ifnarch arm
BuildRequires: libopenblas-devel
%endif
BuildRequires: libstdc++6-devel
## AUTOBUILDREQ-END
Provides: libumfpack
Obsoletes: libumfpack
%description
suitesparse is a collection of libraries for computations involving sparse matrices. The package includes the following libraries:
AMD approximate minimum degree ordering
BTF permutation to block triangular form (beta)
CAMD constrained approximate minimum degree ordering
COLAMD column approximate minimum degree ordering
CCOLAMD constrained column approximate minimum degree ordering
CHOLMOD sparse Cholesky factorization
CSparse a concise sparse matrix package
CXSparse CSparse extended: complex matrix, int and long int support
KLU sparse LU factorization, primarily for circuit simulation
LDL a simple LDL' factorization
SQPR a multithread, multifrontal, rank-revealing sparse QR factorization method
UMFPACK sparse LU factorization
UFconfig configuration file for all the above packages.
RBio read/write files in Rutherford/Boeing format
%package devel
Group: Development/Libraries
Summary: Development files for %{name}
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Provides: libumfpack-devel
Obsoletes: libumfpack-devel
%description devel
This package contains libraries and header files for developing applications that use %{name}.
%debug_package
%prep
%setup -q -n SuiteSparse-%{version}
%ifarch arm
sed -i "/CHOLMOD/d" Makefile
%endif
%build
%make
:<< ___OBSOLETE
%define amd_version 2.2.2
%define amd_version_major 2
%define btf_version 1.1.2
%define btf_version_major 1
%define camd_version 2.2.2
%define camd_version_major 2
%define ccolamd_version 2.7.3
%define ccolamd_version_major 2
%define cholmod_version 1.7.3
%define cholmod_version_major 1
%define colamd_version 2.7.3
%define colamd_version_major 2
%define csparse_version 2.2.3
%define csparse_version_major 2
%define cxsparse_version 2.2.3
%define cxsparse_version_major 2
%define klu_version 1.1.3
%define klu_version_major 1
%define ldl_version 2.0.3
%define ldl_version_major 2
%define umfpack_version 5.5.1
%define umfpack_version_major 5
%define spqr_version 1.2.1
%define spqr_version_major 1
%define rbio_version 2.0.1
%define rbio_version_major 2
%define ufconfig_version 3.6.0
%define ufconfig_version_major 3
### 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.
%define 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
### enable_csparse as 1 below.
%define enable_csparse 0
mkdir -p Doc/{AMD,BTF,CAMD,CCOLAMD,CHOLMOD,COLAMD,KLU,LDL,UMFPACK,SPQR,RBio} Lib Include
pushd AMD
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS -fPIC"
popd
pushd ../Lib
gcc -shared -Wl,-soname,libamd.so.%{amd_version_major} -o \
libamd.so.%{amd_version} ../AMD/Lib/*.o -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 ./
popd
cp -p Include/*.h ../Include
cp -p README.txt Doc/License.txt Doc/ChangeLog Doc/*.pdf ../Doc/AMD
popd
pushd BTF
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS -fPIC"
popd
pushd ../Lib
gcc -shared -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 ./
popd
cp -p Include/*.h ../Include
cp -p README.txt Doc/* ../Doc/BTF
popd
pushd CAMD
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS -fPIC"
popd
pushd ../Lib
gcc -shared -Wl,-soname,libcamd.so.%{camd_version_major} -o \
libcamd.so.%{camd_version} ../CAMD/Lib/*.o -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 ./
popd
cp -p Include/*.h ../Include
cp -p README.txt Doc/ChangeLog Doc/*.pdf ../Doc/CAMD
popd
pushd CCOLAMD
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS -fPIC"
popd
pushd ../Lib
gcc -shared -Wl,-soname,libccolamd.so.%{ccolamd_version_major} -o \
libccolamd.so.%{ccolamd_version} ../CCOLAMD/Lib/*.o -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 ./
popd
cp -p Include/*.h ../Include
cp -p README.txt Doc/* ../Doc/CCOLAMD
popd
pushd COLAMD
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS -fPIC"
popd
pushd ../Lib
gcc -shared -Wl,-soname,libcolamd.so.%{colamd_version_major} -o \
libcolamd.so.%{colamd_version} ../COLAMD/Lib/*.o -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 ./
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 -fPIC"
%else
CHOLMOD_FLAGS="$RPM_OPT_FLAGS -DNPARTITION -fPIC"
%endif
pushd CHOLMOD
pushd Lib
make CFLAGS="$CHOLMOD_FLAGS"
popd
pushd ../Lib
gcc -shared -Wl,-soname,libcholmod.so.%{cholmod_version_major} -o \
libcholmod.so.%{cholmod_version} ../CHOLMOD/Lib/*.o \
-L%{_libdir}/atlas -lblas -llapack libamd.so.%{amd_version_major} \
libcamd.so.%{camd_version_major} libcolamd.so.%{colamd_version_major} \
libccolamd.so.%{ccolamd_version_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 ./
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
popd
%if "%{?enable_csparse}" == "1"
pushd CSparse
pushd Source
make CFLAGS="$RPM_OPT_FLAGS -fPIC"
cp -p cs.h ../../Include
popd
pushd ../Lib
gcc -shared -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
%else
pushd CXSparse
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS -fPIC"
popd
pushd ../Lib
gcc -shared -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 ./
popd
cp -p Include/cs.h ../Include
mkdir ../Doc/CXSparse/
cp -p Doc/* ../Doc/CXSparse
popd
%endif
pushd KLU
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS -fPIC"
popd
pushd ../Lib
gcc -shared -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} libcholmod.so.%{cholmod_version_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 ./
popd
cp -p Include/*.h ../Include
cp -p README.txt Doc/lesser.txt ../Doc/KLU
popd
pushd LDL
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS -fPIC"
popd
pushd ../Lib
gcc -shared -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 ./
popd
cp -p Include/*.h ../Include
cp -p README.txt Doc/ChangeLog Doc/lesser.txt Doc/*.pdf ../Doc/LDL
popd
pushd UMFPACK
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS -fPIC"
popd
pushd ../Lib
gcc -shared -Wl,-soname,libumfpack.so.%{umfpack_version_major} -o \
libumfpack.so.%{umfpack_version} ../UMFPACK/Lib/*.o \
-L%{_libdir}/atlas -lblas -llapack libamd.so.%{amd_version_major} \
libcholmod.so.%{cholmod_version_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 ./
popd
cp -p Include/*.h ../Include
cp -p README.txt Doc/License Doc/ChangeLog Doc/gpl.txt Doc/*.pdf ../Doc/UMFPACK
popd
pushd SPQR
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS %{?with_tbb:-DHAVE_TBB} -DNPARTITION -fPIC"
popd
pushd ../Lib
g++ -shared -Wl,-soname,libspqr.so.%{spqr_version_major} -o \
libspqr.so.%{spqr_version} ../SPQR/Lib/*.o \
-L%{_libdir}/atlas -L%{_libdir} -lblas -llapack %{?with_tbb:-ltbb -ltbbmalloc} \
libcholmod.so.%{cholmod_version_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 ./
popd
cp -p Include/*.h* ../Include
cp -p README{,_SPQR}.txt
cp -p README_SPQR.txt Doc/* ../Doc/SPQR
popd
pushd SuiteSparse_config
make CFLAGS="$RPM_OPT_FLAGS -fPIC"
#gcc $RPM_OPT_FLAGS -fPIC -c UFconfig.c
#pushd ../Lib
#gcc -shared -Wl,-soname,libufconfig.so.%{ufconfig_version_major} -o \
# libufconfig.so.%{ufconfig_version} ../UFconfig/*.o
#ln -sf libufconfig.so.%{ufconfig_version} libufconfig.so.%{ufconfig_version_major}
#ln -sf libufconfig.so.%{ufconfig_version} libufconfig.so
#cp -p ../UFconfig/*.a ./
#popd
cp -p *.h ../Include
popd
pushd RBio
pushd Lib
make CFLAGS="$RPM_OPT_FLAGS -fPIC"
popd
# pushd ../Lib
# gcc -shared -Wl,-soname,librbio.so.%{rbio_version_major} -o \
# librbio.so.%{rbio_version} ../RBio/Lib/*.o \
# libufconfig.so.%{ufconfig_version_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 ./
# popd
cp -p Include/*.h ../Include
cp -p README.txt Doc/ChangeLog ../Doc/RBio
popd
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
make install \
INSTALL_LIB=%{buildroot}%{_libdir} \
INSTALL_INCLUDE=%{buildroot}%{_includedir}/suitesparse
:<< __OBSOLETE
rm -rf ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}%{_libdir}
mkdir -p ${RPM_BUILD_ROOT}%{_includedir}/suitesparse
pushd Lib
for f in *.a *.so*; do
cp -a $f ${RPM_BUILD_ROOT}%{_libdir}/$f
done
popd
pushd Include
for f in *.h; do
install -D -m0644 $f %{buildroot}%{_includedir}/suitesparse/$f
done
popd
__OBSOLETE
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_libdir}/libamd.so.*
%{_libdir}/libbtf.so.*
%{_libdir}/libcamd.so.*
%{_libdir}/libccolamd.so.*
%{_libdir}/libcholmod.so.*
%{_libdir}/libcolamd.so.*
%{_libdir}/libcxsparse.so.*
%{_libdir}/libklu.so.*
%{_libdir}/libldl.so.*
%{_libdir}/librbio.so.*
%{_libdir}/libsliplu.so.*
%{_libdir}/libspqr.so.*
%{_libdir}/libsuitesparseconfig.so.*
%{_libdir}/libumfpack.so.*
%files devel
%defattr(-,root,root)
%dir %{_includedir}/suitesparse
%{_includedir}/suitesparse/*.h
%{_includedir}/suitesparse/*.hpp
%{_libdir}/libamd.so
%{_libdir}/libbtf.so
%{_libdir}/libcamd.so
%{_libdir}/libccolamd.so
%{_libdir}/libcholmod.so
%{_libdir}/libcolamd.so
%{_libdir}/libcxsparse.so
%{_libdir}/libklu.so
%{_libdir}/libldl.so
%{_libdir}/libmetis.so
%{_libdir}/librbio.so
%{_libdir}/librbio.so
%{_libdir}/libsliplu.so
%{_libdir}/libspqr.so
%{_libdir}/libsuitesparseconfig.so
%{_libdir}/libumfpack.so
%changelog
* Tue Mar 15 2022 Automatic Build System <autodist@mambasoft.it> 5.11.0-1mamba
- automatic version update by autodist
* Tue May 25 2021 Automatic Build System <autodist@mambasoft.it> 5.10.1-1mamba
- automatic version update by autodist
* Wed May 19 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 5.10.0-1mamba
- update to 5.10.0
* Thu Mar 04 2021 Automatic Build System <autodist@mambasoft.it> 5.9.0-1mamba
- automatic version update by autodist
* Wed Jul 22 2020 Automatic Build System <autodist@mambasoft.it> 5.8.1-1mamba
- automatic version update by autodist
* Thu Jul 02 2020 Automatic Build System <autodist@mambasoft.it> 5.8.0-1mamba
- automatic version update by autodist
* Thu Apr 09 2020 Automatic Build System <autodist@mambasoft.it> 5.7.2-1mamba
- automatic version update by autodist
* Tue Mar 03 2020 Automatic Build System <autodist@mambasoft.it> 5.7.1-1mamba
- automatic version update by autodist
* Wed Nov 06 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 5.6.0-1mamba
- update to 5.6.0
* Fri Dec 18 2015 Automatic Build System <autodist@mambasoft.it> 4.4.5-1mamba
- automatic version update by autodist
* Tue Apr 28 2015 Automatic Build System <autodist@mambasoft.it> 4.4.4-1mamba
- automatic version update by autodist
* Sat Feb 14 2015 Automatic Build System <autodist@mambasoft.it> 4.4.3-1mamba
- automatic update by autodist
* Sun Nov 23 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 4.4.1-1mamba
- update to 4.4.1
* Tue Aug 26 2014 Automatic Build System <autodist@mambasoft.it> 4.3.1-1mamba
- automatic version update by autodist
* Sat May 24 2014 Automatic Build System <autodist@mambasoft.it> 4.3.0-1mamba
- automatic update by autodist
* Sat Aug 03 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.1-2mamba
- fixed read permission of include files
* Sat May 11 2013 Automatic Build System <autodist@mambasoft.it> 4.2.1-1mamba
- automatic version update by autodist
* Sun Mar 31 2013 Automatic Build System <autodist@mambasoft.it> 4.1.0-1mamba
- automatic version update by autodist
* Fri Jan 25 2013 Automatic Build System <autodist@mambasoft.it> 4.0.2-1mamba
- automatic version update by autodist
* Mon Mar 05 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 3.7.0-1mamba
- package created by autospec