diff --git a/SuperLU-fix-format-security.patch b/SuperLU-fix-format-security.patch new file mode 100644 index 0000000..5334a08 --- /dev/null +++ b/SuperLU-fix-format-security.patch @@ -0,0 +1,13 @@ +Index: SuperLU_4.3/SRC/util.c +=================================================================== +--- SuperLU_4.3.orig/SRC/util.c ++++ SuperLU_4.3/SRC/util.c +@@ -29,7 +29,7 @@ + + void superlu_abort_and_exit(char* msg) + { +- fprintf(stderr, msg); ++ fputs(stderr, msg); + exit (-1); + } + diff --git a/SuperLU-fix-testsuite.patch b/SuperLU-fix-testsuite.patch new file mode 100644 index 0000000..e358875 --- /dev/null +++ b/SuperLU-fix-testsuite.patch @@ -0,0 +1,52 @@ +Index: SuperLU_4.3/TESTING/Makefile +=================================================================== +--- SuperLU_4.3.orig/TESTING/Makefile ++++ SuperLU_4.3/TESTING/Makefile +@@ -52,9 +52,9 @@ testmat: + + single: ./stest stest.out + +-./stest: $(SLINTST) $(ALINTST) $(SUPERLULIB) $(TMGLIB) ++./stest: $(SLINTST) $(ALINTST) $(TMGLIB) + $(LOADER) $(LOADOPTS) $(SLINTST) $(ALINTST) \ +- $(TMGLIB) $(SUPERLULIB) $(BLASLIB) -lm -o $@ ++ $(TMGLIB) -Wl,-rpath,../SRC $(SUPERLULIB) $(BLASLIB) -lm -o $@ + + stest.out: stest stest.csh + @echo Testing SINGLE PRECISION linear equation routines +@@ -62,9 +62,9 @@ stest.out: stest stest.csh + + double: ./dtest dtest.out + +-./dtest: $(DLINTST) $(ALINTST) $(SUPERLULIB) $(TMGLIB) ++./dtest: $(DLINTST) $(ALINTST) $(TMGLIB) + $(LOADER) $(LOADOPTS) $(DLINTST) $(ALINTST) \ +- $(TMGLIB) $(SUPERLULIB) $(BLASLIB) -lm -o $@ ++ $(TMGLIB) -Wl,-rpath,../SRC $(SUPERLULIB) $(BLASLIB) -lm -o $@ + + dtest.out: dtest dtest.csh + @echo Testing DOUBLE PRECISION linear equation routines +@@ -72,9 +72,9 @@ dtest.out: dtest dtest.csh + + complex: ./ctest ctest.out + +-./ctest: $(CLINTST) $(ALINTST) $(SUPERLULIB) $(TMGLIB) ++./ctest: $(CLINTST) $(ALINTST) $(TMGLIB) + $(LOADER) $(LOADOPTS) $(CLINTST) $(ALINTST) \ +- $(TMGLIB) $(SUPERLULIB) $(BLASLIB) -lm -o $@ ++ $(TMGLIB) -Wl,-rpath,../SRC $(SUPERLULIB) $(BLASLIB) -lm -o $@ + + ctest.out: ctest ctest.csh + @echo Testing SINGLE COMPLEX linear equation routines +@@ -82,9 +82,9 @@ ctest.out: ctest ctest.csh + + complex16: ./ztest ztest.out + +-./ztest: $(ZLINTST) $(ALINTST) $(SUPERLULIB) $(TMGLIB) ++./ztest: $(ZLINTST) $(ALINTST) $(TMGLIB) + $(LOADER) $(LOADOPTS) $(ZLINTST) $(ALINTST) \ +- $(TMGLIB) $(SUPERLULIB) $(BLASLIB) -lm -o $@ ++ $(TMGLIB) -Wl,-rpath,../SRC $(SUPERLULIB) $(BLASLIB) -lm -o $@ + + ztest.out: ztest ztest.csh + @echo Testing DOUBLE COMPLEX linear equation routines diff --git a/SuperLU.spec b/SuperLU.spec index aa6cb03..18e2ea1 100644 --- a/SuperLU.spec +++ b/SuperLU.spec @@ -1,19 +1,24 @@ -Name: SuperLU -Version: 4.3 -Release: 7%{?dist} -Summary: Subroutines to solve sparse linear systems - -License: BSD -URL: http://crd-legacy.lbl.gov/~xiaoye/SuperLU/ -Source0: http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_%{version}.tar.gz +Name: SuperLU +Version: 4.3 +Release: 8%{?dist} +Summary: Subroutines to solve sparse linear systems +%{?el5:Group: System/Libraries} + +License: BSD +URL: http://crd-legacy.lbl.gov/~xiaoye/SuperLU/ +Source0: http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_%{version}.tar.gz # Build with -fPIC -Patch0: %{name}-add-fpic.patch +Patch0: %{name}-add-fpic.patch # Build shared library -Patch1: %{name}-build-shared-lib3.patch +Patch1: %{name}-build-shared-lib3.patch +# Fixes FTBFS if "-Werror=format-security" flag is used (#1037343) +Patch2: %{name}-fix-format-security.patch +# Fixes testsuite +Patch3: SuperLU-fix-testsuite.patch - -BuildRequires: atlas-devel -BuildRequires: csh +%{?el5:BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)} +BuildRequires: atlas-devel +BuildRequires: csh %description SuperLU contains a set of subroutines to solve a sparse linear system @@ -22,10 +27,10 @@ The columns of A may be preordered before factorization; the preordering for sparsity is completely separate from the factorization. %package devel -Summary: Header files and libraries for SuperLU development -Group: Development/Libraries -Requires: %{name} = %{version}-%{release} -Requires: pkgconfig +Summary: Header files and libraries for SuperLU development +%{?el5:Group: Development/Libraries} +Requires: %{name}%{?_isa} = %{version}-%{release} +%{?el5:Requires: pkgconfig} %description devel The %{name}-devel package contains the header files @@ -35,26 +40,33 @@ and libraries for use with CUnit package. %setup -q -n %{name}_%{version} %patch0 -p1 %patch1 -p1 -chmod a-x SRC/qselect.c EXAMPLE/cg20.cua +%patch2 -p1 +%patch3 -p1 +find . -type f | sed -e "/TESTING/d" | xargs chmod a-x # Remove the shippped executables from EXAMPLE find EXAMPLE -type f | while read file do [ "$(file $file | awk '{print $2}')" = ELF ] && rm $file || : done cp -p MAKE_INC/make.linux make.inc -sed -i "s|-O3|$RPM_OPT_FLAGS|" make.inc -sed -i "s|\$(SUPERLULIB) ||" make.inc -sed -i "s|\$(HOME)/Codes/%{name}_%{version}|%{_builddir}/%{name}_%{version}|" make.inc +sed -i -e "s|-O3|$RPM_OPT_FLAGS|" \ + -e "s|\$(SUPERLULIB) ||" \ + -e "s|\$(HOME)/Codes/%{name}_%{version}|%{_builddir}/%{name}_%{version}|" \ + -e 's!lib/libsuperlu_4.3.a$!SRC/libsuperlu.so!' \ + -e 's!-shared!& %{__global_ldflags}!' \ %if 0%{?fedora} >= 21 -sed -i "s|-L/usr/lib -lblas|-L%{_libdir}/atlas -lsatlas|" make.inc + -e "s|-L/usr/lib -lblas|-L%{_libdir}/atlas -lsatlas|" \ %else -sed -i "s|-L/usr/lib -lblas|-L%{_libdir}/atlas -lf77blas|" make.inc + -e "s|-L/usr/lib -lblas|-L%{_libdir}/atlas -lf77blas|" \ %endif + make.inc %build make %{?_smp_mflags} superlulib +make -C TESTING %install +%{?el5:rm -rf %{buildroot}} mkdir -p %{buildroot}%{_libdir} mkdir -p %{buildroot}%{_includedir}/%{name} install -p SRC/libsuperlu.so.%{version} %{buildroot}%{_libdir} @@ -62,6 +74,18 @@ install -p SRC/*.h %{buildroot}%{_includedir}/%{name} chmod -x %{buildroot}%{_includedir}/%{name}/*.h cp -Pp SRC/libsuperlu.so %{buildroot}%{_libdir} +%check +pushd TESTING +for _test in c d s z +do + chmod +x ${_test}test.csh + ./${_test}test.csh +done +popd + +%{?el5:%clean} +%{?el5:rm -rf %{buildroot}} + %post -p /sbin/ldconfig %postun -p /sbin/ldconfig @@ -76,6 +100,13 @@ cp -Pp SRC/libsuperlu.so %{buildroot}%{_libdir} %{_libdir}/libsuperlu.so %changelog +* Mon Jan 06 2014 Björn Esser - 4.3-8 +- fixed FTBFS if "-Werror=format-security" flag is used (#1037343) +- devel-pkg must Requires: %%{name}%%{?_isa} +- apply proper LDFLAGS +- added needed bits for el5 +- reenable testsuite using Patch3 + * Fri Oct 4 2013 Orion Poplawski - 4.3-7 - Rebuild for atlas 3.10 - Handle UnversionedDocDirs change