Commit c978e1b8 authored by Lorenz Huedepohl's avatar Lorenz Huedepohl

Cherry-pick SPEC file changes

This is a squash of the following cherry-picked commits from master that
correct some issues with the elpa.spec file:

  5c548fe6
  8285d13b
  b483df9b
  722ef865
  6e973ae5
  1acbcf5d
parent 2121b2e5
......@@ -19,6 +19,18 @@
# Set to 0 to disable
%define with_openmp 1
# Logic to figure out if we are on SLES-11-SP4, which need special
# treatment (custom compiler package name, old RPM macros)
%if 0%{suse_version} > 0
%if 0%{suse_version} <= 1110
%define sle_11_sp4 1
%else
%define sle_11_sp4 0
%endif
%else
%define sle_11_sp4 0
%endif
Name: elpa
Version: 2016.05.003
Release: 2
......@@ -28,19 +40,25 @@ Group: System/Libraries
Url: https://elpa.rzg.mpg.de/
Source0: https://elpa.mpcdf.mpg.de/html/Releases/%{version}/%{name}-%{version}.tar.gz
Requires: openmpi
BuildRequires: gcc-c++
BuildRequires: gcc-fortran
# For SLE_11_SP4:
%if %{sle_11_sp4} == 1
BuildRequires: gcc48-c++
BuildRequires: gcc48-fortran
%else
BuildRequires: gcc-c++ >= 4.8
BuildRequires: gcc-fortran >= 4.8
%endif
BuildRequires: strace
BuildRequires: openmpi-devel
BuildRequires: blas
BuildRequires: blas-devel
BuildRequires: lapack
BuildRequires: lapack-devel
BuildRequires: pkg-config
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
%if %{defined fedora}
BuildRequires: scalapack-openmpi
BuildRequires: scalapack-openmpi-devel
BuildRequires: blacs-openmpi
BuildRequires: blacs-openmpi-devel
BuildRequires: environment-modules
%endif
......@@ -51,6 +69,7 @@ BuildRequires: libscalapack2-openmpi-devel
# For make check, mpirun of openmpi needs an installed openssh
BuildRequires: openssh
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
A new efficient distributed parallel direct eigenvalue solver for
......@@ -176,16 +195,56 @@ that use %{name}_openmp.
%if %{defined fedora}
module load mpi/openmpi-%{_arch}
%endif
if [ ! -e configure ] ; then
# It is possible to use the Open Build Server to automatically
# checkout from git directly, extract this spec file and set the
# version of the extracted spec file to some autogenerated
# string based on the date and git hash of the checkout commit.
# This line ensures that the spec file in the tar-ball has
# that same version, so that autogen will insert that version
# in the configure script
perl -pi -e "s/^Version:.*/Version: %{version}/" elpa.spec
./autogen.sh
fi
# Set-up compilers for SLE_11_SP4
%if %{sle_11_sp4} == 1
mkdir compilers
pushd compilers
ln -s /usr/bin/gfortran-4.8 gfortran
ln -s /usr/bin/gcc-4.8 gcc
export PATH=$PWD:$PATH
pushd
%endif
# Normal build
mkdir build
pushd build
%define _configure ../configure
# ancient SLE_11_SP4 cannot deal with configure in sub-directory
# via _configure macro
%if %{sle_11_sp4} == 1
ln -s ../configure .
%endif
%configure --docdir=%{_docdir}/%{name}-%{version}
make %{?_smp_mflags} V=1
popd
# OpenMP build
%if %{defined with_openmp}
mkdir build_openmp
pushd build_openmp
# ancient SLE_11_SP4 cannot deal with configure in sub-directory
# via _configure macro
%if %{?suse_version:%{suse_version}}%{!?suse_version:1200} <= 1110
ln -s ../configure .
%endif
%configure --docdir=%{_docdir}/%{name}_openmp-%{version} --enable-openmp
make %{?_smp_mflags} V=1
popd
......@@ -229,10 +288,8 @@ popd
%files -n lib%{name}%{so_version}
# See http://en.opensuse.org/openSUSE:Shared_library_packaging_policy
# to explain this package's name
%defattr(0755,root,root)
%defattr(-,root,root)
%{_libdir}/lib%{name}.so.*
%doc
%defattr(0644,root,root)
%{_docdir}/%{name}-%{version}/*
%dir %{_docdir}/%{name}-%{version}
......@@ -241,7 +298,7 @@ popd
%attr(0644,root,root) %_mandir/man1/elpa2_print_kernels.1.gz
%files devel
%defattr(0644,root,root)
%defattr(-,root,root)
%{_libdir}/pkgconfig/%{name}-%{version}.pc
%{_includedir}/%{name}-%{version}
%{_libdir}/lib%{name}.so
......@@ -249,32 +306,30 @@ popd
%_mandir/man3/*
%files devel-static
%defattr(0644,root,root)
%defattr(-,root,root)
%{_libdir}/lib%{name}.a
%if %{defined with_openmp}
%files -n lib%{name}_openmp%{so_version}
%defattr(0755,root,root)
%defattr(-,root,root)
%{_libdir}/lib%{name}_openmp.so.*
%doc
%defattr(0644,root,root)
%{_docdir}/%{name}_openmp-%{version}/*
%dir %{_docdir}/%{name}_openmp-%{version}
%files -n %{name}_openmp-tools
%defattr(0755,root,root)
%defattr(-,root,root)
%{_bindir}/elpa2_print_kernels_openmp
%files -n %{name}_openmp-devel
%defattr(0644,root,root)
%defattr(-,root,root)
%{_libdir}/pkgconfig/%{name}_openmp-%{version}.pc
%{_includedir}/%{name}_openmp-%{version}
%{_libdir}/lib%{name}_openmp.so
%{_libdir}/lib%{name}_openmp.la
%files -n %{name}_openmp-devel-static
%defattr(0644,root,root)
%defattr(-,root,root)
%{_libdir}/lib%{name}_openmp.a
%endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment