From 62dc87390f2a9d5f5f7b3b239156d94e108a367d Mon Sep 17 00:00:00 2001 From: Deji Akingunola Date: Sun, 21 Dec 2008 04:00:02 +0000 Subject: [PATCH] - Also build SPQR - Further fixes for BZ #475411 --- suitesparse.spec | 37 ++++++++++++++++--- suitesparse_build.patch | 79 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+), 4 deletions(-) create mode 100644 suitesparse_build.patch diff --git a/suitesparse.spec b/suitesparse.spec index d09a320..bee6c36 100644 --- a/suitesparse.spec +++ b/suitesparse.spec @@ -1,12 +1,13 @@ Name: suitesparse Version: 3.2.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A collection of sparse matrix libraries Group: System Environment/Libraries License: LGPLv2+ URL: http://www.cise.ufl.edu/research/sparse/SuiteSparse Source0: http://www.cise.ufl.edu/research/sparse/SuiteSparse/SuiteSparse-%{version}.tar.gz +Patch0: suitesparse_build.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: atlas-devel @@ -27,6 +28,8 @@ matrices. The package includes the following libraries: 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. @@ -58,6 +61,7 @@ version of the suitesparse libraries. %prep %setup -q -n SuiteSparse +%patch0 -p0 -b .build %build %define amd_version 2.2 @@ -82,6 +86,8 @@ version of the suitesparse libraries. %define ldl_version_major 2 %define umfpack_version 5.2.0 %define umfpack_version_major 5 +%define spqr_version 1.1.0 +%define spqr_version_major 1 ### 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. @@ -94,7 +100,7 @@ version of the suitesparse libraries. mkdir Devel Devel/AMD Devel/CHOLMOD Devel/KLU Devel/LDL Devel/UMFPACK \ Doc Doc/AMD Doc/BTF Doc/CAMD Doc/CCOLAMD Doc/CHOLMOD Doc/COLAMD \ - Doc/KLU Doc/LDL Doc/UMFPACK Lib Include + Doc/KLU Doc/LDL Doc/UMFPACK Doc/SPQR Lib Include pushd AMD pushd Lib @@ -243,7 +249,9 @@ pushd KLU popd pushd ../Lib gcc -shared -Wl,-soname,libklu.so.%{klu_version_major} -o \ - libklu.so.%{klu_version} ../KLU/Lib/*.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 ./ @@ -275,7 +283,7 @@ pushd UMFPACK pushd ../Lib gcc -shared -Wl,-soname,libumfpack.so.%{umfpack_version_major} -o \ libumfpack.so.%{umfpack_version} ../UMFPACK/Lib/*.o \ - -L%{_libdir}/atlas -lcblas -lm + -L%{_libdir}/atlas -lcblas libamd.so.%{amd_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 ./ @@ -285,6 +293,23 @@ pushd UMFPACK cp -p Doc/*.pdf ../Devel/UMFPACK popd +pushd SPQR + pushd Lib + make CFLAGS="$RPM_OPT_FLAGS -DNPARTITION -fPIC" + popd + pushd ../Lib + gcc -shared -Wl,-soname,libspqr.so.%{spqr_version_major} -o \ + libspqr.so.%{spqr_version} ../SPQR/Lib/*.o \ + -L%{_libdir}/atlas -lcblas -lclapack -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 + cp -p UFconfig/UFconfig.h Include %install @@ -327,6 +352,10 @@ rm -rf ${RPM_BUILD_ROOT} %{_libdir}/lib*.a %changelog +* Sat Dec 20 2008 Deji Akingunola - 3.2.0-4 +- Also build SPQR +- Further fixes for BZ #475411 + * Wed Dec 17 2008 Deji Akingunola - 3.2.0-3 - Rearrange the spec - Link in necessary libs when making shared CHOLMOD lib (BZ #475411) diff --git a/suitesparse_build.patch b/suitesparse_build.patch new file mode 100644 index 0000000..2179669 --- /dev/null +++ b/suitesparse_build.patch @@ -0,0 +1,79 @@ +--- SPQR/Include/spqr.hpp 2008-09-18 09:20:48.000000000 -0400 ++++ SPQR/Include/spqr.hpp.new 2008-12-20 21:05:49.000000000 -0500 +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + + #include + typedef std::complex Complex ; +--- UFconfig/UFconfig.mk 2008-09-22 14:19:37.000000000 -0400 ++++ UFconfig/UFconfig.mk.new 2008-12-20 21:18:19.000000000 -0500 +@@ -48,7 +48,7 @@ + MV = mv -f + + # Fortran compiler (not normally required) +-F77 = f77 ++F77 = gfortran + F77FLAGS = -O + F77LIB = + +@@ -89,13 +89,17 @@ + # BLAS = -lgoto -lgfortran -lgfortranbegin -lg2c + + # This is probably slow ... it might connect to the Standard Reference BLAS: +-BLAS = -lblas -lgfortran -lgfortranbegin -lg2c +-LAPACK = -llapack ++#BLAS = -lblas -lgfortran -lgfortranbegin -lg2c ++#LAPACK = -llapack + + # Using non-optimized versions: + # BLAS = -lblas_plain -lgfortran -lgfortranbegin -lg2c + # LAPACK = -llapack_plain + ++# Using ATLAS optimized BLAS and Lapack: Fedora specific addition ++BLAS = -lcblas ++LAPACK = -lclapack ++ + # The BLAS might not contain xerbla, an error-handling routine for LAPACK and + # the BLAS. Also, the standard xerbla requires the Fortran I/O library, and + # stops the application program if an error occurs. A C version of xerbla +@@ -146,7 +150,7 @@ + # -DNRECIPROCAL do not multiply by the reciprocal + # -DNO_DIVIDE_BY_ZERO do not divide by zero + +-UMFPACK_CONFIG = ++UMFPACK_CONFIG = -DNPARTITION + + #------------------------------------------------------------------------------ + # CHOLMOD configuration +@@ -184,7 +188,7 @@ + # -DNSUNPERF for Solaris only. If defined, do not use the Sun + # Performance Library + +-CHOLMOD_CONFIG = ++CHOLMOD_CONFIG = -DNPARTITION + + #------------------------------------------------------------------------------ + # SuiteSparseQR configuration: +@@ -198,7 +202,7 @@ + # -DHAVE_TBB enable the use of Intel's Threading Building Blocks (TBB) + + # default, without timing, without TBB: +-SPQR_CONFIG = ++SPQR_CONFIG = -DNPARTITION + # with timing and TBB: + # SPQR_CONFIG = -DTIMING -DHAVE_TBB + # with timing +@@ -263,6 +267,10 @@ + # F77 = gfortran + # BLAS = -lgoto -lgfortran + ++# Fedora, with ATLAS Blas ++F77 = gfortran ++BLAS = -lf77blas -lgfortran ++ + #------------------------------------------------------------------------------ + # Solaris + #------------------------------------------------------------------------------