Accepting request 534290 from home:eeich:branches:multimedia:libs

- For HPC build package static libraries as well.

- Generate baselib.conf dynamically and only for the non-HPC
  build: this avoids issues with the source validator.

- removed unnedded dependency packages 

- rewrote for hpc library support
  * added environment modules
  * reduced number of hpc realted packages to two

OBS-URL: https://build.opensuse.org/request/show/534290
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/fftw3?expand=0&rev=46
This commit is contained in:
Takashi Iwai 2017-10-16 18:57:55 +00:00 committed by Git OBS Bridge
parent a384802d44
commit 223049c390
5 changed files with 335 additions and 73 deletions

6
_multibuild Normal file
View File

@ -0,0 +1,6 @@
<multibuild>
<package>standard</package>
<package>gnu-hpc</package>
<package>gnu-openmpi-hpc</package>
<package>gnu-mvapich2-hpc</package>
</multibuild>

View File

@ -1,4 +0,0 @@
libfftw3-3
libfftw3_threads3
libfftw3_omp3
libfftw3_mpi3

View File

@ -1,3 +1,9 @@
# See spec file for the reason(s)
addFilter('shlib-fixed-dependency')
# This line is mandatory to access the configuration functions
from Config import *
# See spec file for the reason(s)
addFilter("libfftw3.* devel-file-in-non-devel-package")
addFilter("libfftw3.* hidden-file-or-dir")
addFilter('shlib-fixed-dependency')
addFilter('libfftw3.* shlib-policy-nonversioned-dir /usr/lib/hpc')
addFilter('libfftw3.* shlib-policy-nonversioned-dir /usr/share/lmod')

View File

@ -1,3 +1,27 @@
-------------------------------------------------------------------
Sat Oct 14 17:13:06 UTC 2017 - eich@suse.com
- For HPC build package static libraries as well.
-------------------------------------------------------------------
Thu Oct 12 05:46:35 UTC 2017 - eich@suse.com
- Generate baselib.conf dynamically and only for the non-HPC
build: this avoids issues with the source validator.
-------------------------------------------------------------------
Mon Sep 25 09:36:55 UTC 2017 - cgoll@suse.com
- removed unnedded dependency packages
-------------------------------------------------------------------
Thu Sep 7 07:46:53 UTC 2017 - cgoll@suse.com
- rewrote for hpc library support
* added environment modules
* reduced number of hpc realted packages to two
-------------------------------------------------------------------
Mon Aug 1 22:03:49 UTC 2016 - mardnh@gmx.de

View File

@ -1,7 +1,7 @@
#
# spec file for package fftw3
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,9 +16,84 @@
#
Name: fftw3
%global flavor @BUILD_FLAVOR@%{nil}
%define bname fftw
%define BNAME FFTW
%define pname fftw3
%define vers 3.3.5
%define _ver 3_3_5
%if "%flavor" == ""
ExclusiveArch: do_not_build
%define package_name %pname
%endif
%if "%{flavor}" == "standard"
%define mpi_flavor standard
%bcond_without mpi
%bcond_with hpc
%bcond_without system_packages
%endif
%if "%flavor" == "gnu-hpc"
%define compiler_family gnu
%undefine c_f_ver
%bcond_with mpi
%bcond_without hpc
%endif
%if "%{flavor}" == "gnu-openmpi-hpc"
%global compiler_family gnu
%undefine c_f_ver
%global mpi_flavor openmpi
%define mpi_vers 1
%bcond_without hpc
%bcond_without mpi
%endif
%if "%{flavor}" == "gnu-mvapich2-hpc"
%global compiler_family gnu
%undefine c_f_ver
%define mpi_flavor mvapich2
%bcond_without hpc
%bcond_without mpi
%endif
# now exchange the paths
%if %{with hpc}
%{?mpi_flavor:%{bcond_without mpi}}%{!?mpi_flavor:%{bcond_with mpi}}
%{?with_hpc:%{!?compiler_family:%global compiler_family gnu}}
%{?with_mpi:%{!?mpi_flavor:%global mpi_flavor openmpi}}
# needed by the hpc tools
%{hpc_init -c %compiler_family %{?c_f_ver:-v %{c_f_ver}} %{?with_mpi:-m {%mpi_flavor}} %{?mpi_ver:-V %{mpi_ver}} %{?ext:-e %{ext}}}
%define package_base %{hpc_install_path_base}
%define package_prefix %hpc_prefix
%define package_bindir %hpc_bindir
%define package_libdir %hpc_libdir
%define package_datadir %hpc_datadir
%define package_includedir %hpc_includedir
%define package_mandir %hpc_mandir
%define package_docdir %hpc_docdir
%define package_infodir %hpc_infodir
%define package_name %{hpc_package_name %_ver}
%define package_libname lib%{package_name}
%else
%define package_base %{_prefix}
%define package_prefix %{_prefix}
%define package_bindir %{_bindir}
%define package_libdir %{_libdir}
%define package_datadir %{_datadir}
%define package_includedir %{_includedir}
%define package_mandir %{_mandir}
%define package_docdir %{_docdir}
%define package_infodir %{_infodir}
%define package_name %pname%{?my_suffix}
%define package_libname lib%{pname}-3
%endif
Name: %package_name
BuildRequires: fdupes
BuildRequires: gcc-fortran
BuildRequires: pkgconfig
%ifnarch s390 s390x
BuildRequires: openmpi-devel
@ -30,39 +105,71 @@ License: GPL-2.0+
Group: Productivity/Scientific/Math
Url: http://www.fftw.org
Source: http://www.fftw.org/fftw-%{version}.tar.gz
Source1: %{name}-rpmlintrc
Source1000: baselibs.conf
Source1: %{pname}-rpmlintrc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires(pre): %install_info_prereq
%if %{with hpc}
BuildRequires: %{compiler_family}%{?c_f_ver}-compilers-hpc-macros-devel
BuildRequires: lua-lmod
BuildRequires: suse-hpc
%if %{with mpi}
BuildRequires: %{mpi_flavor}%{?mpi_vers}-%{compiler_family}%{?c_f_ver}-hpc-macros-devel
Requires: %{mpi_flavor}_%{?mpi_ver}-%{compiler_family}%{?c_f_ver}-hpc
%endif
%else
BuildRequires: gcc-c++
BuildRequires: gcc-fortran
Requires: %{package_name}-libs = %{version}
%endif
%description
FFTW is a C subroutine library for computing the Discrete Fourier
Transform (DFT) in one or more dimensions, of both real and complex
data, and of arbitrary input size.
%if %{with hpc}
%%{hpc_master_package -L}
%{hpc_master_package -l}
%{hpc_master_package -a devel}
%endif
%package devel
Summary: Include Files and Libraries mandatory for Development
Group: Development/Libraries/C and C++
Requires: glibc-devel
Requires: libfftw3-3 = %{version}-%{release}
%if %{without hpc}
Requires: %package_libname = %{version}-%{release}
%else
#Requires: %%hpc_package_name = %%{version}-%%{release}
Requires: %{pname}-%{flavor}-devel = %{version}-%{release}
%endif
Provides: fftw-devel
%description devel
This package contains all necessary include files and libraries needed
to develop applications that require these.
%package -n libfftw3-3
%package devel-static
Summary: Static libraries for %{pname}
Group: Development/Libraries/C and C++
Requires: %{name}-devel
%description devel-static
Libraries to build statically linked applications with fftw3.
%package -n %package_libname
Summary: Discrete Fourier Transform (DFT) C Subroutine Library
Group: System/Libraries
# Remove Prov/Obs when appropriate; were added 2011-Nov-21 (post-openSUSE-12.1)
Group: System/Libraries
Provides: fftw3 = %{version}-%{release}
Obsoletes: fftw3 < 3.3
%description -n libfftw3-3
%description -n %package_libname
FFTW is a C subroutine library for computing the Discrete Fourier
Transform (DFT) in one or more dimensions, of both real and complex
data, and of arbitrary input size.
%if %{without hpc}
%package -n libfftw3_threads3
Summary: Discrete Fourier Transform (DFT) C subroutine library
Group: Productivity/Scientific/Math
@ -113,6 +220,7 @@ Requires: libfftw3_omp3 = %{version}-%{release}
FFTW is a C subroutine library for computing the Discrete Fourier
Transform (DFT) in one or more dimensions, of both real and complex
data, and of arbitrary input size.
%endif
%ifnarch s390 s390x
@ -145,39 +253,78 @@ data, and of arbitrary input size.
%endif
%prep
%setup -q -n fftw-%{version}
%setup -q -n %{bname}-%{version}
%if %{without hpc}
cat > %{_sourcedir}/baselibs.conf <<EOF
%{package_libname}
lib%{name}_threads3
lib%{name}_omp3
lib%{name}_mpi3
EOF
%endif
%build
%if %{with hpc}
%hpc_setup
%endif
%ifnarch s390 s390x
%if "%{mpi_flavor}" == "standard"
source %_libdir/mpi/gcc/openmpi/bin/mpivars.sh
%endif
%configure --enable-shared --enable-threads --enable-openmp \
%endif
%if %{without hpc}
%configure \
--disable-static \
%else
%hpc_configure \
--enable-static \
%endif
%ifnarch s390 s390x
%if %{with mpi}
--enable-mpi \
%endif
%ifarch %ix86 x86_64
--enable-sse2 \
--enable-avx \
%endif
--disable-static
%endif
--enable-shared \
--enable-threads \
--enable-openmp
make %{?_smp_mflags}
%install
%if %{with hpc}
%{hpc_setup}
%endif
%makeinstall
# remove unneeded files
rm -f %{buildroot}%{_libdir}/lib*.*a
%{!?with_hpc:rm -f %{buildroot}%{package_libdir}/lib*.*a}
# hack to also compile/install single-precision version:
make distclean
%ifnarch s390 s390x
%if "%{mpi_flavor}" == "standard"
source %_libdir/mpi/gcc/openmpi/bin/mpivars.sh
%endif
%configure --enable-shared --enable-threads --enable-float --enable-openmp \
%endif
%if %{without hpc}
%configure \
%else
%hpc_configure \
%endif
--enable-shared --enable-threads --enable-float --enable-openmp \
%ifnarch s390 s390x
%if %{with mpi}
--enable-mpi \
%endif
%endif
%ifarch %ix86 x86_64
--enable-sse2 \
%endif
@ -190,11 +337,20 @@ make %{?_smp_mflags}
make distclean
%ifnarch s390 s390x
%if "%{mpi_flavor}" == "standard"
source %_libdir/mpi/gcc/openmpi/bin/mpivars.sh
%endif
%configure --enable-shared --enable-threads --enable-long-double --enable-openmp \
%endif
%if %{without hpc}
%configure \
%else
%hpc_configure \
%endif
--enable-shared --enable-threads --enable-long-double --enable-openmp \
%ifnarch s390 s390x
%if %{with mpi}
--enable-mpi \
%endif
%endif
--disable-static
@ -202,26 +358,64 @@ make %{?_smp_mflags}
%makeinstall
# remove unneeded files
rm -f %{buildroot}%{_libdir}/lib*.*a
%{!?with_hpc:rm -f %{buildroot}%{package_libdir}/lib*.*a}
# gzip -9nf %%{buildroot}%%{_infodir}/*.info*
rm -f %{buildroot}%{_infodir}/dir
gzip -9nf %{buildroot}%{package_infodir}/*.info*
# remove Makefiles in doc directory at last
find doc -name 'Makefile*' | xargs rm
%if %{with hpc}
%hpc_write_modules_files
#%%Module1.0#####################################################################
proc ModulesHelp { } {
puts stderr " "
puts stderr "This module loads the %{pname} library built with the %{compiler_family} toolchain."
puts stderr "\nVersion %{version}\n"
}
module-whatis "Name: %{pname} built with %{compiler_family} toolchain"
module-whatis "Version: %{version}"
module-whatis "Category: runtime library"
module-whatis "Description: %{summary:0}"
module-whatis "URL: %{url}"
set version %{version}
prepend-path PATH %{hpc_bindir}
prepend-path MANPATH %{hpc_mandir}
prepend-path LD_LIBRARY_PATH %{hpc_libdir}
prepend-path MODULEPATH %{hpc_modulepath}/%pname
setenv %{BNAME}_DIR %{hpc_path}
setenv %{BNAME}_DIR %{hpc_libdir}
setenv %{BNAME}_INC %{hpc_includedir}
if ([file isdirectory %{hpc_includedir}]) {
# should work also for fortran
prepend-path LIBRARY_PATH %{hpc_libdir}
prepend-path CPATH %{hpc_includedir}
prepend-path C_INCLUDE_PATH %{hpc_includedir}
prepend-path CPLUS_INCLUDE_PATH %{hpc_includedir}
}
%{hpc_modulefile_add_pkgconfig_path}
EOF
%endif
%fdupes -s doc
%postun devel
%install_info_delete --info-dir=%{_infodir} %{_infodir}/fftw3.info.gz
%install_info_delete --info-dir=%{package_infodir} %{package_infodir}/fftw3.info.gz
%post devel
%install_info --info-dir=%{_infodir} %{_infodir}/fftw3.info.gz
%install_info --info-dir=%{package_infodir} %{package_infodir}/fftw3.info.gz
%post -n libfftw3-3 -p /sbin/ldconfig
%post -n %package_libname -p /sbin/ldconfig
%postun -n libfftw3-3 -p /sbin/ldconfig
%postun -n %package_libname -p /sbin/ldconfig
%if %{without hpc}
%post -n libfftw3_threads3 -p /sbin/ldconfig
%postun -n libfftw3_threads3 -p /sbin/ldconfig
@ -236,68 +430,104 @@ find doc -name 'Makefile*' | xargs rm
%postun -n libfftw3_mpi3 -p /sbin/ldconfig
%endif
%endif
%files -n libfftw3-3
%files -n %package_libname
%defattr(-,root,root)
%{_libdir}/libfftw3.so.3*
%{_libdir}/libfftw3f.so.3*
%{_libdir}/libfftw3l.so.3*
%{package_libdir}/libfftw3.so.3*
%{package_libdir}/libfftw3f.so.3*
%{package_libdir}/libfftw3l.so.3*
%if %{without hpc}
%files -n libfftw3_threads3
%defattr(-,root,root)
%endif #%%{without hpc}
%{package_libdir}/libfftw3_threads.so.3*
%{package_libdir}/libfftw3f_threads.so.3*
%{package_libdir}/libfftw3l_threads.so.3*
%if %{without hpc}
%files -n libfftw3_omp3
%defattr(-,root,root)
%else
%hpc_modules_files
%endif #%%{without hpc}
%{package_libdir}/libfftw3_omp.so.3*
%{package_libdir}/libfftw3f_omp.so.3*
%{package_libdir}/libfftw3l_omp.so.3*
%ifnarch s390 s390x
%if %{with mpi}
%if %{without hpc}
%files -n libfftw3_mpi3
%defattr(-,root,root)
%endif #%%{without hpc}
%{package_libdir}/libfftw3_mpi.so.3*
%{package_libdir}/libfftw3f_mpi.so.3*
%{package_libdir}/libfftw3l_mpi.so.3*
%endif #%%(with mpi)
%endif #%%(s390 s390x)
%files devel
%defattr(-,root,root)
%if %{with hpc}
%{package_infodir}/dir
%hpc_dirs
%dir %package_libdir/pkgconfig
%dir %package_includedir
%dir %package_mandir
%dir %package_mandir/man1
%dir %package_infodir
%dir %package_bindir
%dir %package_datadir
%endif
%doc AUTHORS CONVENTIONS COPYING COPYRIGHT ChangeLog NEWS README TODO
%doc doc/*
%doc %{_mandir}/man?/*
%{_infodir}/*.info*
%{_includedir}/fftw3.*
%{_includedir}/fftw3q.f03
%{_includedir}/fftw3l.f03
%{_libdir}/libfftw3.so
%{_libdir}/libfftw3f.so
%{_libdir}/libfftw3l.so
%{_libdir}/pkgconfig/*.pc
%{_bindir}/*
%files -n libfftw3_threads3
%defattr(-,root,root)
%{_libdir}/libfftw3_threads.so.3*
%{_libdir}/libfftw3f_threads.so.3*
%{_libdir}/libfftw3l_threads.so.3*
%doc %{package_mandir}/man?/*
%{package_infodir}/*.info*
%{package_includedir}/fftw3.*
%{package_includedir}/fftw3q.f03
%{package_includedir}/fftw3l.f03
%{package_libdir}/libfftw3.so
%{package_libdir}/libfftw3f.so
%{package_libdir}/libfftw3l.so
%{package_libdir}/pkgconfig/*.pc
%{package_bindir}/*
%if %{without hpc}
%files threads-devel
%defattr(-,root,root)
%{_libdir}/libfftw3_threads.so
%{_libdir}/libfftw3f_threads.so
%{_libdir}/libfftw3l_threads.so
%files -n libfftw3_omp3
%defattr(-,root,root)
%{_libdir}/libfftw3_omp.so.3*
%{_libdir}/libfftw3f_omp.so.3*
%{_libdir}/libfftw3l_omp.so.3*
%endif #%%{without hpc}
%{package_libdir}/libfftw3_threads.so
%{package_libdir}/libfftw3f_threads.so
%{package_libdir}/libfftw3l_threads.so
%if %{without hpc}
%files openmp-devel
%defattr(-,root,root)
%{_libdir}/libfftw3_omp.so
%{_libdir}/libfftw3f_omp.so
%{_libdir}/libfftw3l_omp.so
%endif #%%{without hpc}
%{package_libdir}/libfftw3_omp.so
%{package_libdir}/libfftw3f_omp.so
%{package_libdir}/libfftw3l_omp.so
%ifnarch s390 s390x
%files -n libfftw3_mpi3
%defattr(-,root,root)
%{_libdir}/libfftw3_mpi.so.3*
%{_libdir}/libfftw3f_mpi.so.3*
%{_libdir}/libfftw3l_mpi.so.3*
%if %{with mpi}
%if %{without hpc}
%files mpi-devel
%defattr(-,root,root)
%{_libdir}/libfftw3_mpi.so
%{_libdir}/libfftw3f_mpi.so
%{_libdir}/libfftw3l_mpi.so
%{_includedir}/fftw3-mpi.*
%{_includedir}/fftw3l-mpi.f03
%{_includedir}/fftw3l-mpi.f03
%endif #%%{without hpc}
%{package_libdir}/libfftw3_mpi.so
%{package_libdir}/libfftw3f_mpi.so
%{package_libdir}/libfftw3l_mpi.so
%{package_includedir}/fftw3-mpi.*
%{package_includedir}/fftw3l-mpi.f03
%endif #%%(with mpi)
%endif #%%(s390 s390x)
%if %{with hpc}
%files devel-static
%defattr(-,root,root)
%{package_libdir}/*.*a
%endif
%changelog