File superlu_mt.spec of Package superlu_mt
#
# spec file for package superlu_mt
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: superlu_mt
Summary: A general purpose library for the direct solution of linear equations
License: BSD-3-Clause
Group: Development/Libraries/C and C++
Version: 2.0
Release: 0
Source: ftp://ftp.netlib.org/scalapack/prototype/superlu_mt_%{version}.tar.gz
# PATCH-FEATURE-OPENSUSE superlu_mt-2.0-make.patch : add compiler and build flags in make.inc
Patch0: superlu_mt-2.0-make.patch
# PATCH-FIX-UPSTREAM superlu_mt-2.0-implicit-fortify-decl.patch
Patch1: superlu_mt-2.0-implicit-fortify-decl.patch
# PATCH-FIX-UPSTREAM superlu_mt-2.0-undefined-symbols.patch
Patch2: superlu_mt-2.0-undefined-symbols.patch
# PATCH-FIX-UPSTREAM superlu_mt-2.0-strcpy-overflow.patch
Patch3: superlu_mt-2.0-strcpy-overflow.patch
Url: http://crd.lbl.gov/~xiaoye/SuperLU/
BuildRequires: blas
BuildRequires: gcc-fortran
BuildRequires: tcsh
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
SuperLU is an algorithm that uses group theory to optimize LU
decomposition of sparse matrices. It's the fastest direct solver for
linear systems that the author is aware of.
Docu can be found on http://www.netlib.org.
%package -n libsuperlu_mt2
Summary: POSIX threaded SuperLU matrix solver
Group: System/Libraries
%description -n libsuperlu_mt2
SuperLU is an algorithm that uses group theory to optimize LU
decomposition of sparse matrices. It's the fastest direct solver for
linear systems that the author is aware of.
Docu can be found on http://www.netlib.org.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries/C and C++
Provides: superlu_mt = %{version}
Obsoletes: superlu_mt < %{version}
Requires: libsuperlu_mt2 = %{version}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%prep
%setup -q -n SuperLU_MT_%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build
# make %%{?_smp_mflags} does not work on some suse version
make lib
mkdir tmp
(cd tmp; ar -x ../lib/libsuperlu_mt.a)
gfortran -pthread -shared -Wl,-soname,libsuperlu_mt.so.2 -z muldefs -o lib/libsuperlu_mt.so tmp/*.o
%install
mkdir -p %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_includedir}
install -m644 SRC/*.h %{buildroot}%{_includedir}
install -m755 lib/libsuperlu_mt.so %{buildroot}%{_libdir}/libsuperlu_mt.so.%{version}
ln -s %{_libdir}/libsuperlu_mt.so.%{version} %{buildroot}%{_libdir}/libsuperlu_mt.so.2
ln -s %{_libdir}/libsuperlu_mt.so.2 %{buildroot}%{_libdir}/libsuperlu_mt.so
# For doc package
mv EXAMPLE example
find example -name '*.bak' -exec rm {} \;
sed -i 's/\r//' example/typescript
%check
ln -s example/ EXAMPLE
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
make testing
echo -ne "\nTest results\n"
for i in pstest pdtest pctest pztest; do
cat TESTING/$i.out
done
%post -n libsuperlu_mt2 -p /sbin/ldconfig
%postun -n libsuperlu_mt2 -p /sbin/ldconfig
%files -n libsuperlu_mt2
%defattr(-,root,root,-)
%doc README
%{_libdir}/*.so.*
%files devel
%defattr(-,root,root,-)
%doc example DOC/ug.pdf
%{_includedir}/*.h
%{_libdir}/*.so
%changelog