diff --git a/.gitignore b/.gitignore index e69de29..277c383 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/superlu_4.3.tar.gz diff --git a/SuperLU-add-fpic.patch b/SuperLU-add-fpic.patch new file mode 100644 index 0000000..906e379 --- /dev/null +++ b/SuperLU-add-fpic.patch @@ -0,0 +1,13 @@ +diff -up SuperLU_4.3/MAKE_INC/make.linux.fpic SuperLU_4.3/MAKE_INC/make.linux +--- SuperLU_4.3/MAKE_INC/make.linux.fpic 2012-01-06 10:39:58.474356562 +0530 ++++ SuperLU_4.3/MAKE_INC/make.linux 2012-01-06 10:40:59.933356590 +0530 +@@ -46,7 +46,8 @@ ARCHFLAGS = cr + RANLIB = ranlib + + CC = gcc +-CFLAGS = -O3 ++FPIC = -fPIC ++CFLAGS = -O3 $(FPIC) + NOOPTS = + FORTRAN = g77 + FFLAGS = -O2 diff --git a/SuperLU-build-shared-lib3.patch b/SuperLU-build-shared-lib3.patch new file mode 100644 index 0000000..afaefe9 --- /dev/null +++ b/SuperLU-build-shared-lib3.patch @@ -0,0 +1,39 @@ +diff -up SuperLU_4.3/SRC/Makefile.fix SuperLU_4.3/SRC/Makefile +--- SuperLU_4.3/SRC/Makefile.fix 2012-02-01 17:15:17.711698876 +0530 ++++ SuperLU_4.3/SRC/Makefile 2012-02-01 17:17:07.794698927 +0530 +@@ -111,7 +111,7 @@ ZLUSRC = \ + ilu_zcolumn_dfs.o ilu_zpanel_dfs.o ilu_zcopy_to_ucol.o \ + ilu_zpivotL.o zdiagonal.o + +-all: single double complex complex16 ++all: sharedlib + + single: $(SLUSRC) $(ALLAUX) $(LAAUX) $(SLASRC) $(SCLAUX) + $(ARCH) $(ARCHFLAGS) $(SUPERLULIB) \ +@@ -133,17 +133,22 @@ complex16: $(ZLUSRC) $(ALLAUX) $(LAAUX) + $(ZLUSRC) $(ALLAUX) $(LAAUX) $(ZLASRC) $(DZLAUX) + $(RANLIB) $(SUPERLULIB) + ++sharedlib: $(ALLAUX) $(LAAUX) $(SLASRC) $(DLASRC) $(CLASRC) $(ZLASRC) $(SCLAUX) $(DZLAUX) $(SLUSRC) $(DLUSRC) $(CLUSRC) $(ZLUSRC) ++ $(CC) $(CFLAGS) $(LIBS) -shared -Wl,-soname,libsuperlu.so.4.3 -o libsuperlu.so.4.3 \ ++ $(ALLAUX) $(LAAUX) $(SLASRC) $(DLASRC) $(CLASRC) $(ZLASRC) $(SCLAUX) \ ++ $(DZLAUX) $(SLUSRC) $(DLUSRC) $(CLUSRC) $(ZLUSRC) ++ ln -sf libsuperlu.so.4.3 libsuperlu.so + + ################################## + # Do not optimize these routines # + ################################## +-slamch.o: slamch.c ; $(CC) -c $(NOOPTS) $(CDEFS) $< +-dlamch.o: dlamch.c ; $(CC) -c $(NOOPTS) $(CDEFS) $< +-superlu_timer.o: superlu_timer.c ; $(CC) -c $(NOOPTS) $< ++slamch.o: slamch.c ; $(CC) $(FPIC) $(LIBS) -c $(NOOPTS) $(CDEFS) $< ++dlamch.o: dlamch.c ; $(CC) $(FPIC) $(LIBS) -c $(NOOPTS) $(CDEFS) $< ++superlu_timer.o: superlu_timer.c ; $(CC) $(FPIC) $(LIBS) -c $(NOOPTS) $< + ################################## + + .c.o: +- $(CC) $(CFLAGS) $(CDEFS) $(BLASDEF) -c $< $(VERBOSE) ++ $(CC) $(CFLAGS) $(CDEFS) $(BLASDEF) $(LIBS) -c $< $(VERBOSE) + + .f.o: + $(FORTRAN) $(FFLAGS) -c $< diff --git a/SuperLU.spec b/SuperLU.spec new file mode 100644 index 0000000..a59a11f --- /dev/null +++ b/SuperLU.spec @@ -0,0 +1,86 @@ +Name: SuperLU +Version: 4.3 +Release: 3%{?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 +# Build with -fPIC +Patch0: %{name}-add-fpic.patch +# Build shared library +Patch1: %{name}-build-shared-lib3.patch + + +BuildRequires: atlas-devel +BuildRequires: csh + +%description +SuperLU contains a set of subroutines to solve a sparse linear system +A*X=B. It uses Gaussian elimination with partial pivoting (GEPP). +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 + +%description devel +The %{name}-devel package contains the header files +and libraries for use with CUnit package. + +%prep +%setup -q -n %{name}_%{version} +%patch0 -p1 +%patch1 -p1 +chmod a-x SRC/qselect.c +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 "s|-L/usr/lib -lblas|-L%{_libdir}/atlas -lf77blas|" make.inc + +%build +make %{?_smp_mflags} superlulib + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}%{_libdir} +mkdir -p %{buildroot}%{_includedir}/%{name} +install -p SRC/libsuperlu.so.%{version} %{buildroot}%{_libdir} +install -p SRC/*.h %{buildroot}%{_includedir}/%{name} +chmod -x %{buildroot}%{_includedir}/%{name}/*.h +cp -Pp SRC/libsuperlu.so %{buildroot}%{_libdir} + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root,-) +%doc README +%{_libdir}/libsuperlu.so.* + +%files devel +%defattr(-,root,root,-) +%doc DOC +%{_includedir}/%{name}/ +%{_libdir}/libsuperlu.so + +%changelog +* Sat Aug 25 2012 Shakthi Kannan 4.3-3 +- Use README in main package and DOC in devel package +- chmod a-x on SRC/qselect.c +- Remove -latlas linking in prep section +- Added Patch comments +- Use name RPM macro in patch name + +* Wed Feb 01 2012 Shakthi Kannan 4.3-2 +- Use atlas library instead of blas. +- Use RPM_OPT_FLAGS and LIBS when building sources. +- Use macros as required for name and version. + +* Fri Jan 06 2012 Shakthi Kannan 4.3-1 +- First release. diff --git a/sources b/sources index e69de29..a378cef 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +b72c6309f25e9660133007b82621ba7c superlu_4.3.tar.gz