%if 0%{?rhel} < 7 %{!?__global_ldflags: %global __global_ldflags -Wl,-z,relro} %endif Name: qrmumps Version: 2.0 Release: 4%{?dist} Summary: A multithreaded multifrontal QR solver License: LGPLv3+ Group: Development/Libraries URL: http://buttari.perso.enseeiht.fr/qr_mumps/ # This is a private source link provided by upstream directly Source0: http://buttari.perso.enseeiht.fr/qr_mumps/releases/%{version}/qr_mumps-%{version}.tgz # Custom Makefile changed for Fedora and built from Make.inc/Makefile.gfortran.PAR in the source. Source1: %{name}-Makefile.inc # Files for testing Source2: http://www.cise.ufl.edu/research/sparse/MM/vanHeukelum/cage6.tar.gz Source3: http://www.cise.ufl.edu/research/sparse/MM/Meszaros/pltexpa.tar.gz Source4: http://www.cise.ufl.edu/research/sparse/MM/Yoshiyasu/image_interp.tar.gz BuildRequires: gcc-gfortran BuildRequires: blas-devel BuildRequires: lapack-devel BuildRequires: metis-devel >= 5.1.0-12 BuildRequires: scotch-devel BuildRequires: perl-devel %if 0%{?fedora} BuildRequires: perl-generators %endif Requires: gcc-gfortran%{?_isa} Provides: qr_mumps = 0:%{version}-%{release} Obsoletes: qr_mumps < 0:2.0-4 %description qr_mumps is a software package for the solution of sparse, linear systems on multicore computers. It implements a direct solution method based on the QR factorization of the input matrix. Therefore, it is suited to solving sparse least-squares problems and to computing the minimum-norm solution of sparse, underdetermined problems. It can obviously be used for solving square problems in which case the stability provided by the use of orthogonal transformations comes at the cost of a higher operation count with respect to solvers based on, e.g., the LU factorization. qr_mumps supports real and complex, single or double precision arithmetic. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Shared links and header files of %{name}. %package doc Summary: PDF documentation files of %{name} Group: Development/Libraries BuildArch: noarch %description doc PDF documentation files of %{name}. ######################################################## %prep %setup -q -n qr_mumps-%{version} cp -p %{SOURCE1} makeincs/Make.inc.fedora %build # Parallel Make is not supported make BUILD=build PLAT=fedora ARITH='d s c z' \ topdir=$PWD \ CC=gcc \ FC=gfortran \ FCFLAGS="%{optflags} -I%{_fmoddir} -fopenmp -fPIC -Wl,-z,now" \ CFLAGS="%{optflags} -fopenmp -fPIC -Wl,-z,now" \ CDEFS=" -Dhave_metis -Dhave_scotch" \ FDEFS=" -Dhave_metis -Dhave_scotch" \ LCOLAMD="" \ ICOLAMD="" \ LBLAS=-lblas \ LLAPACK=-llapack \ LMETIS=" -lmetis" \ IMETIS=" -I%{_includedir}" \ LSCOTCH=" -lscotch -lscotcherr" \ ISCOTCH=" -I%{_includedir}" # Make shared libraries pushd build/lib gfortran -shared %{__global_ldflags} -fPIC -Wl,-z,now -Wl,--whole-archive libqrm_common.a -Wl,-no-whole-archive -Wl,--as-needed -L%{_libdir} -lmetis -lgfortran -lm -lrt -Wl,-soname,libqrm_common.so.%{version} -o libqrm_common.so.%{version} gfortran -shared %{__global_ldflags} -fPIC -Wl,-z,now -Wl,--whole-archive libdqrm.a libqrm_common.a -Wl,-no-whole-archive -L./ -lqrm_common -Wl,--as-needed -L%{_libdir} -lblas -llapack -lscotch -lscotcherr -lmetis -lgfortran -lm -lrt -Wl,-soname,libdqrm.so.%{version} -o libdqrm.so.%{version} gfortran -shared %{__global_ldflags} -fPIC -Wl,-z,now -Wl,--whole-archive libcqrm.a libqrm_common.a -Wl,-no-whole-archive -L./ -lqrm_common -Wl,--as-needed -L%{_libdir} -lblas -llapack -lscotch -lscotcherr -lmetis -lgfortran -lm -lrt -Wl,-soname,libcqrm.so.%{version} -o libcqrm.so.%{version} gfortran -shared %{__global_ldflags} -fPIC -Wl,-z,now -Wl,--whole-archive libzqrm.a libqrm_common.a -Wl,-no-whole-archive -L./ -lqrm_common -Wl,--as-needed -L%{_libdir} -lblas -llapack -lscotch -lscotcherr -lmetis -lgfortran -lm -lrt -Wl,-soname,libzqrm.so.%{version} -o libzqrm.so.%{version} gfortran -shared %{__global_ldflags} -fPIC -Wl,-z,now -Wl,--whole-archive libsqrm.a libqrm_common.a -Wl,-no-whole-archive -L./ -lqrm_common -Wl,--as-needed -L%{_libdir} -lblas -llapack -lscotch -lscotcherr -lmetis -lgfortran -lm -lrt -Wl,-soname,libsqrm.so.%{version} -o libsqrm.so.%{version} popd %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %check pushd build/testing make \ topdir=../../ \ CC=gcc \ FC=gfortran \ FCFLAGS="%{optflags} -I%{_fmoddir} -fopenmp -fPIC -Wl,-z,now" \ CFLAGS="%{optflags} -fopenmp -fPIC -Wl,-z,now" \ CDEFS=" -Dhave_metis -Dhave_scotch" \ FDEFS=" -Dhave_metis -Dhave_scotch" \ LCOLAMD="" \ ICOLAMD="" \ LBLAS=-lblas \ LLAPACK=-llapack \ LMETIS=" -lmetis" \ IMETIS=" -I%{_includedir}" \ LSCOTCH=" -lscotch -lscotcherr" \ ISCOTCH=" -I%{_includedir}" echo 3 > matfile.txt tar -zxf %{SOURCE2}; echo cage6/cage6.mtx >> matfile.txt tar -zxf %{SOURCE3}; echo pltexpa/pltexpa.mtx >> matfile.txt tar -zxf %{SOURCE4}; echo image_interp/image_interp.mtx >> matfile.txt export LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir}:%{_libdir} export QRM_NUM_THREADS=2 ./dqrm_testing %install mkdir -p $RPM_BUILD_ROOT%{_includedir}/%{name} mkdir -p $RPM_BUILD_ROOT%{_fmoddir}/%{name} pushd build/lib install -pm 755 *.so.%{version} $RPM_BUILD_ROOT%{_libdir} ln -sf %{_libdir}/libqrm_common.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libqrm_common.so.2 ln -sf %{_libdir}/libqrm_common.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libqrm_common.so ln -sf %{_libdir}/libdqrm.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libdqrm.so.2 ln -sf %{_libdir}/libdqrm.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libdqrm.so ln -sf %{_libdir}/libcqrm.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libcqrm.so.2 ln -sf %{_libdir}/libcqrm.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libcqrm.so ln -sf %{_libdir}/libzqrm.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libzqrm.so.2 ln -sf %{_libdir}/libzqrm.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libzqrm.so ln -sf %{_libdir}/libsqrm.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libsqrm.so.2 ln -sf %{_libdir}/libsqrm.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libsqrm.so popd install -pm 644 build/include/*.h $RPM_BUILD_ROOT%{_includedir}/%{name} install -pm 644 build/include/*.mod $RPM_BUILD_ROOT%{_fmoddir}/%{name} %files %license doc/COPYING.LESSER %doc Changelog.org %{_libdir}/lib*qrm.so.* %{_libdir}/libqrm_common.so.* %files devel %{_includedir}/%{name}/ %{_fmoddir}/%{name}/ %{_libdir}/lib*qrm.so %{_libdir}/libqrm_common.so %files doc %license doc/COPYING.LESSER %doc doc/pdf/*.pdf %changelog * Sun Dec 04 2016 Antonio Trande - 2.0-4 - Package renamed as qrmumps for packaging needs - Set Provides Obsoletes tags - License changed to LGPLv3+ * Thu Jul 07 2016 Antonio Trande - 2.0-3 - Fix symbolic links - Fix unused-direct-shlib-dependency warnings * Thu Jul 07 2016 Antonio Trande - 2.0-2 - Fix %%doc line * Thu Jul 07 2016 Antonio Trande - 2.0-1 - Update to 2.0 * Mon Mar 07 2016 Antonio Trande - 1.2-3 - Fixed ln commands * Fri Feb 19 2016 Antonio Trande - 1.2-2 - Use Conditional Builds macro - Remove pkgconfig BR * Sat Feb 13 2016 Antonio Trande - 1.2-1 - Initial package