Blame SPECS/mpich.spec

a93d5f
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
a93d5f
a93d5f
Summary:	A high-performance implementation of MPI
a93d5f
Name:		mpich
a93d5f
Version:	3.0.4
fa9456
Release:	8%{?dist}
a93d5f
License:	MIT
a93d5f
Group:		Development/Libraries
a93d5f
URL:		http://www.mpich.org
a93d5f
a93d5f
# Source0 derived from
a93d5f
# Source0:	http://www.mpich.org/static/downloads/%{version}/%{name}-%{version}.tar.gz
a93d5f
# by
a93d5f
# rm -r src/mpid/pamid
a93d5f
# vi src/mpid/Makefile*
a93d5f
#  and remove references to pamid
a93d5f
# rm -r src/mpid/ch3/channels/nemesis/netmod/scif
a93d5f
# vi src/src/mpid/ch3/channels/nemesis/netmod/Makefile*
a93d5f
#  and remove references to scif
a93d5f
# rm -r src/pm/hydra/tools/topo/hwloc/hwloc
a93d5f
# vi src/pm/hydra/tools/topo/hwloc/Makefile.mk
a93d5f
#  and remove references to hwloc
a93d5f
# rm `find * -name 'Makefile.in' -print | grep -v doc/ | grep -v src/mpi/romio/mpi2-other/`
a93d5f
# rm -r contrib www
a93d5f
# rm src/mpi/romio/test/external32.c
a93d5f
# rm `find * -name ar-lib -o -name compile -o -name config.guess -o -name config.sub -o -name depcomp -o -name missing -o -name configure -o -name .state-cache -o -name aclocal.mp -o -name libtool.m4`
a93d5f
# rm README.envvar maint/createcoverage maint/getcoverage src/include/mpichconf.h.in src/include/mpich_param_vals.h src/pm/hydra/include/hydra_config.h.in src/util/logging/common/state_names.h src/util/param/param_vals.c subsys_include.m4
a93d5f
#  more extensive changes need to actually build are included in the mpich-3.0.4-rh.patch file
a93d5f
Source0: %{name}-%{version}-rh.tar.gz
a93d5f
Source1:	mpich.macros
a93d5f
# Patch0:		mpich-modules.patch
a93d5f
Patch0: mpich-3.0.4-rh.patch
a93d5f
Patch1: mpich-3.0.4-module.patch
a93d5f
a93d5f
BuildRequires:	libXt-devel, bison, flex, libuuid-devel
a93d5f
BuildRequires:	gcc-gfortran
a93d5f
BuildRequires:  hwloc-devel >= 1.5
a93d5f
BuildRequires:	perl, python, perl-Digest-MD5, hwloc-devel
a93d5f
BuildRequires:	automake autoconf libtool gettext
a93d5f
%ifnarch s390 s390x %{arm}
a93d5f
BuildRequires:	valgrind-devel
a93d5f
%endif
a93d5f
Provides:	mpi
a93d5f
Obsoletes:	mpich2
a93d5f
Obsoletes:	%{name}-libs < 1.1.1
a93d5f
Obsoletes:	%{name}-mpd < 1.4.1
a93d5f
Requires:	environment-modules
a93d5f
Requires:	chkconfig
a93d5f
#Requires chkconfig for /usr/sbin/alternatives
a93d5f
a93d5f
%description
a93d5f
MPICH is a high-performance and widely portable implementation of the
a93d5f
MPI standard (MPI-1, MPI-2 and MPI-3). This release has all MPI-2.2 functions
a93d5f
and features required by the standard with the exeption of support for the
a93d5f
"external32" portable I/O format and user-defined data representations for I/O.
a93d5f
a93d5f
The mpich binaries in this RPM packages were configured to use the default
a93d5f
process manager (Hydra) using the default device (ch3). The ch3 device
a93d5f
was configured with support for the nemesis channel that allows for
a93d5f
shared-memory and TCP/IP sockets based communication.
a93d5f
a93d5f
This build also include support for using the 'module environment' to select
a93d5f
which MPI implementation to use when multiple implementations are installed.
a93d5f
If you want MPICH2 support to be automatically loaded, you need to install the
a93d5f
mpich-autoload package.
a93d5f
a93d5f
%package autoload
a93d5f
Summary:	Load mpich automatically into profile
a93d5f
Group:		System Environment/Base
a93d5f
Requires:	mpich = %{version}-%{release}
a93d5f
a93d5f
%description autoload
a93d5f
This package contains profile files that make mpich automatically loaded.
a93d5f
a93d5f
%package devel
a93d5f
Summary:	Development files for mpich
a93d5f
Group:		Development/Libraries
a93d5f
Provides:	%{name}-devel-static = %{version}-%{release}
a93d5f
Requires:	%{name} = %{version}-%{release}
a93d5f
Requires:	pkgconfig
a93d5f
Requires:	gcc-gfortran
a93d5f
Requires(pre):	chkconfig
a93d5f
#Requires chkconfig for /usr/sbin/alternatives
a93d5f
a93d5f
%description devel
a93d5f
Contains development headers and libraries for mpich
a93d5f
a93d5f
%package doc
a93d5f
Summary:	Documentations and examples for mpich
a93d5f
Group:		Documentation
a93d5f
BuildArch:	noarch
a93d5f
Requires:	%{name}-devel = %{version}-%{release}
a93d5f
a93d5f
%description doc
a93d5f
Contains documentations, examples and manpages for mpich
a93d5f
a93d5f
# We only compile with gcc, but other people may want other compilers.
a93d5f
# Set the compiler here.
a93d5f
%{!?opt_cc: %global opt_cc gcc}
a93d5f
%{!?opt_fc: %global opt_fc gfortran}
a93d5f
%{!?opt_f77: %global opt_f77 gfortran}
a93d5f
# Optional CFLAGS to use with the specific compiler...gcc doesn't need any,
a93d5f
# so uncomment and undefine to NOT use
a93d5f
%{!?opt_cc_cflags: %global opt_cc_cflags %{optflags}}
a93d5f
%{!?opt_fc_fflags: %global opt_fc_fflags %{optflags}}
a93d5f
#%{!?opt_fc_fflags: %global opt_fc_fflags %{optflags} -I%{_fmoddir}}
a93d5f
%{!?opt_f77_fflags: %global opt_f77_fflags %{optflags}}
a93d5f
a93d5f
%ifarch s390
a93d5f
%global m_option -m31
a93d5f
%else
a93d5f
%global m_option -m%{__isa_bits}
a93d5f
%endif
a93d5f
fa9456
%ifarch %{arm} aarch64
a93d5f
%global m_option ""
a93d5f
%endif
a93d5f
a93d5f
%ifarch %{ix86} x86_64
a93d5f
%global selected_channels ch3:nemesis
a93d5f
%else
a93d5f
%global selected_channels ch3:sock
a93d5f
%endif
a93d5f
a93d5f
%ifarch x86_64 ia64 ppc64 s390x sparc64
a93d5f
%global priority 41
a93d5f
%else
a93d5f
%global priority 40
a93d5f
%endif
a93d5f
a93d5f
%ifarch %{ix86} x86_64 s390 %{arm}
a93d5f
%global XFLAGS -fPIC
a93d5f
%endif
a93d5f
a93d5f
%prep
a93d5f
%setup -q
a93d5f
# % patch0 -p0 -b .modu
a93d5f
%patch0 -p1 -b .rh
a93d5f
%patch1 -p1 -b .module
a93d5f
./autogen.sh
a93d5f
cd src/pm/hydra && ./autogen.sh && cd ../../..
a93d5f
a93d5f
%build
a93d5f
%configure	\
a93d5f
	--enable-sharedlibs=gcc					\
a93d5f
	--enable-shared						\
a93d5f
	--enable-lib-depend					\
a93d5f
	--disable-rpath						\
a93d5f
	--enable-fc						\
a93d5f
	--with-device=%{selected_channels}			\
a93d5f
	--with-pm=hydra:gforker					\
a93d5f
	--sysconfdir=%{_sysconfdir}/%{name}-%{_arch}		\
a93d5f
	--includedir=%{_includedir}/%{name}-%{_arch}		\
a93d5f
	--bindir=%{_libdir}/%{name}/bin				\
a93d5f
	--libdir=%{_libdir}/%{name}/lib				\
a93d5f
	--datadir=%{_datadir}/%{name}				\
a93d5f
	--mandir=%{_mandir}/%{name}				\
a93d5f
	--docdir=%{_datadir}/%{name}/doc			\
a93d5f
	--htmldir=%{_datadir}/%{name}/doc			\
a93d5f
	--with-hwloc-prefix=system				\
a93d5f
	FC=%{opt_fc}						\
a93d5f
	F77=%{opt_f77}						\
ef580b
	CFLAGS="%{m_option} %{optflags} %{?XFLAGS}"			\
ef580b
	CXXFLAGS="%{m_option} %{optflags} %{?XFLAGS}"			\
ef580b
	FCFLAGS="%{m_option} %{optflags} %{?XFLAGS}"			\
ef580b
	FFLAGS="%{m_option} %{optflags} %{?XFLAGS}"			\
a93d5f
	LDFLAGS='-Wl,-z,noexecstack'				\
a93d5f
	MPICH2LIB_CFLAGS="%{?opt_cc_cflags}"			\
a93d5f
	MPICH2LIB_CXXFLAGS="%{optflags}"			\
a93d5f
	MPICH2LIB_FCFLAGS="%{?opt_fc_fflags}"			\
a93d5f
	MPICH2LIB_FFLAGS="%{?opt_f77_fflags}"
a93d5f
#	MPICH2LIB_LDFLAGS='-Wl,-z,noexecstack'			\
a93d5f
#	MPICH2_MPICC_FLAGS="%{m_option} -O2 %{?XFLAGS}"	\
a93d5f
#	MPICH2_MPICXX_FLAGS="%{m_option} -O2 %{?XFLAGS}"	\
a93d5f
#	MPICH2_MPIFC_FLAGS="%{m_option} -O2 %{?XFLAGS}"	\
a93d5f
#	MPICH2_MPIF77_FLAGS="%{m_option} -O2 %{?XFLAGS}"
a93d5f
#	--with-openpa-prefix=embedded				\
a93d5f
a93d5f
#	FCFLAGS="%{?opt_fc_fflags} -I%{_fmoddir}/%{name} %{?XFLAGS}"	\
a93d5f
#make %{?_smp_mflags} doesn't work
a93d5f
make VERBOSE=1
a93d5f
a93d5f
%install
a93d5f
make DESTDIR=%{buildroot} install
a93d5f
a93d5f
# Workaround 1.4.1 broken destdir
a93d5f
for fichier in mpif77 mpif90 mpicxx mpicc ; do
a93d5f
  sed -i 's#'%{buildroot}'##' %{buildroot}%{_libdir}/%{name}/bin/$fichier
a93d5f
  sed -i 's#'%{buildroot}'##' %{buildroot}%{_sysconfdir}/%{name}-%{_arch}/$fichier.conf
a93d5f
done
a93d5f
a93d5f
mv %{buildroot}%{_libdir}/%{name}/lib/pkgconfig %{buildroot}%{_libdir}/
a93d5f
chmod -x %{buildroot}%{_libdir}/pkgconfig/*.pc
a93d5f
a93d5f
mkdir -p %{buildroot}/%{_fmoddir}/%{name}-%{_arch}
a93d5f
#mv  %{buildroot}%{_includedir}/%{name}/*.mod %{buildroot}/%{_fmoddir}/%{name}/
a93d5f
a93d5f
# Install the module file
a93d5f
mkdir -p %{buildroot}%{_sysconfdir}/modulefiles/mpi
a93d5f
mkdir -p %{buildroot}%{python_sitearch}/%{name}
a93d5f
sed -e 's#@LIBDIR@#%{_libdir}/%{name}#g;s#@ETCDIR@#%{_sysconfdir}/%{name}-%{_arch}#g;s#@FMODDIR@#%{_fmoddir}/%{name}-%{_arch}#g;s#@INCDIR@#%{_includedir}/%{name}-%{_arch}#g;s#@MANDIR@#%{_mandir}/%{name}#g;s#@PYSITEARCH@#%{python_sitearch}/%{name}#g;s#@COMPILER@#%{name}-%{_arch}%{?_cc_name_suffix}#g;s#@SUFFIX@#%{?_cc_name_suffix}_%{name}#g' src/packaging/envmods/mpich.module > %{buildroot}%{_sysconfdir}/modulefiles/mpi/%{name}-%{_arch}
a93d5f
a93d5f
mkdir -p %{buildroot}%{_sysconfdir}/profile.d
a93d5f
cat << EOF > %{buildroot}%{_sysconfdir}/profile.d/mpich-%{_arch}.sh
a93d5f
# Load mpich environment module
a93d5f
module load mpi/%{name}-%{_arch}
a93d5f
EOF
a93d5f
cp -p %{buildroot}%{_sysconfdir}/profile.d/mpich-%{_arch}.{sh,csh}
a93d5f
a93d5f
# Install the RPM macro
a93d5f
mkdir -p %{buildroot}%{_sysconfdir}/rpm
a93d5f
cp -pr %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/macros.%{name}
a93d5f
a93d5f
# Silence rpmlint
a93d5f
sed -i '/^#! \//,1 d' %{buildroot}%{_sysconfdir}/%{name}-%{_arch}/mpi*.conf
a93d5f
a93d5f
# The uninstall script here is not needed/necesary for rpm packaging
a93d5f
rm -rf %{buildroot}%{_sbindir}/mpe*
a93d5f
a93d5f
find %{buildroot} -type f -name "*.la" -exec rm -f {} ';'
a93d5f
rm -f %{buildroot}%{_libdir}/%{name}/lib/lib{*mpich*,opa,mpl}.a
a93d5f
a93d5f
%post
a93d5f
/sbin/ldconfig
a93d5f
a93d5f
%postun
a93d5f
/sbin/ldconfig
a93d5f
a93d5f
%pre
a93d5f
if [ $1 -gt 1 ] ; then
a93d5f
	if [ -e %{_bindir}/mpiexec.py ] ; then
a93d5f
		/usr/sbin/alternatives --remove mpi-run %{_bindir}/mpiexec.py
a93d5f
	fi
a93d5f
fi
a93d5f
a93d5f
%pre devel
a93d5f
if [ $1 -gt 1 ] ; then
a93d5f
# Remove the old alternative
a93d5f
	if [ -e %{_bindir}/mp%{__isa_bits}-mpicc ] ; then
a93d5f
	/usr/sbin/alternatives --remove mpicc %{_bindir}/mp%{__isa_bits}-mpicc
a93d5f
	fi
a93d5f
fi
a93d5f
a93d5f
%files
a93d5f
%defattr(-,root,root,-)
a93d5f
%doc CHANGES COPYRIGHT README RELEASE_NOTES
a93d5f
%dir %{_libdir}/%{name}
a93d5f
%dir %{_libdir}/%{name}/lib
a93d5f
%dir %{_libdir}/%{name}/bin
a93d5f
%{_libdir}/%{name}/lib/*.so.*
a93d5f
%{_libdir}/%{name}/bin/hydra*
a93d5f
%{_libdir}/%{name}/bin/mpichversion
a93d5f
%{_libdir}/%{name}/bin/mpiexec*
a93d5f
%{_libdir}/%{name}/bin/mpirun
a93d5f
%dir %{python_sitearch}/%{name}
a93d5f
%dir %{_fmoddir}/%{name}-%{_arch}
a93d5f
%{_libdir}/%{name}/bin/parkill
a93d5f
%dir %{_mandir}/%{name}
a93d5f
%dir %{_mandir}/%{name}/man1
a93d5f
%{_mandir}/%{name}/man1/mpiexec*
a93d5f
%dir %{_sysconfdir}/modulefiles/mpi
a93d5f
%{_sysconfdir}/modulefiles/mpi/%{name}-%{_arch}
a93d5f
a93d5f
%files autoload
a93d5f
%defattr(-,root,root,-)
a93d5f
%{_sysconfdir}/profile.d/mpich-%{_arch}.*
a93d5f
a93d5f
%files devel
a93d5f
%defattr(-,root,root,-)
a93d5f
%{_libdir}/%{name}/bin/mpicc
a93d5f
%{_libdir}/%{name}/bin/mpicxx
a93d5f
%{_libdir}/%{name}/bin/mpic++
a93d5f
%{_libdir}/%{name}/bin/mpif*
a93d5f
%{_mandir}/%{name}/man1/mpic*
a93d5f
%{_mandir}/%{name}/man1/mpif*
a93d5f
%config %{_sysconfdir}/%{name}-%{_arch}/
a93d5f
%{_includedir}/%{name}-%{_arch}/
a93d5f
#%{_fmoddir}/%{name}/
a93d5f
%{_libdir}/%{name}/lib/*.so
a93d5f
%{_libdir}/pkgconfig/%{name}.pc
a93d5f
%{_libdir}/pkgconfig/openpa.pc
a93d5f
%config %{_sysconfdir}/rpm/macros.%{name}
a93d5f
a93d5f
%files doc
a93d5f
%defattr(-,root,root,-)
a93d5f
%dir %{_datadir}/%{name}
a93d5f
%{_datadir}/%{name}/doc/
a93d5f
%{_mandir}/%{name}/man3/
a93d5f
a93d5f
%changelog
fa9456
* Wed Sep 10 2014 Yaakov Selkowitz <yselkowi@redhat.com> - 3.0.4-8
fa9456
- Do not use -m64 on AArch64
fa9456
  Resolves: rhbz1077315
fa9456
ef580b
* Mon Mar 3 2014 Jay Fenlason <fenlason@redhat.com> - 3.0.4-7
ef580b
- Update build flags to fix
ef580b
  Resolves: rhbz1070778
ef580b
ef580b
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 3.0.4-6
ef580b
- Mass rebuild 2014-01-24
ef580b
ef580b
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 3.0.4-5
ef580b
- Mass rebuild 2013-12-27
ef580b
a93d5f
* Fri Oct 4 2013 Jay Fenlason <fenlason@redhat.com> 3.0.4-4.el7
a93d5f
- Fix the module file to contain all the definitions we expect.
a93d5f
  Resolves: rhbz1001469
a93d5f
a93d5f
* Wed Oct 2 2013 Jay Fenlason <fenlason@redhat.com> 3.0.4-3.el7
a93d5f
- Fix macros.mpich
a93d5f
  Resolves: rhbz1001469
a93d5f
a93d5f
* Fri Sep 6 2013 Jay Fenlason <fenlason@redhat.com> 3.0.4-1.el7
a93d5f
- Initial import for RHEL, using sanitized source tarball.
a93d5f