Blob Blame History Raw
Name:           gasnet
Version:        1.28.2
Release:        7%{?dist}
Summary:        A Portable High-Performance Communication Layer for GAS Languages
License:        PostgreSQL
Url:            https://bitbucket.org/berkeleylab/gasnet/
Source0:        https://bitbucket.org/berkeleylab/gasnet/downloads/GASNet-%{version}.tar.gz
#Patch from OpenSuse to support s390 - https://upc-bugs.lbl.gov/bugzilla/show_bug.cgi?id=3523
Patch0:         gasnet-s390-support.patch
BuildRequires:  automake
Requires:       %{name}-common%{?_isa} = %{version}-%{release}

%description
GASNet is a language-independent, low-level networking layer that provides
network-independent, high-performance communication primitives tailored for
implementing parallel global address space SPMD languages
such as UPC, Titanium, and Co-Array Fortran.

%package common
Summary:        GASNet shared binaries and libraries
Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))

%description common
GASNet is a language-independent, low-level networking layer that provides
network-independent, high-performance communication primitives tailored for
implementing parallel global address space SPMD languages
such as UPC, Titanium, and Co-Array Fortran.

GASNet files shared between serial and parallel versions

%package openmpi
Summary:        GASNet Open MPI binaries and libraries
Requires:       %{name}-common%{?_isa} = %{version}-%{release}
BuildRequires:  openmpi-devel

%description openmpi
GASNet is a language-independent, low-level networking layer that provides
network-independent, high-performance communication primitives tailored for
implementing parallel global address space SPMD languages
such as UPC, Titanium, and Co-Array Fortran.

GASNet compiled with Open MPI, package incl. binaries and libraries

%package mpich
Summary:        GASNet MPICH binaries and libraries
Requires:       %{name}-common%{?_isa} = %{version}-%{release}
BuildRequires:  mpich-devel

%description mpich
GASNet is a language-independent, low-level networking layer that provides
network-independent, high-performance communication primitives tailored for
implementing parallel global address space SPMD languages
such as UPC, Titanium, and Co-Array Fortran.

GASNet compiled with MPICH, package incl. binaries and libraries

%package devel
Summary:        Development package for GASNet
Requires:       %{name}%{?_isa} = %{version}
Requires:       %{name}-openmpi%{?_isa} = %{version}
Requires:       %{name}-mpich%{?_isa} = %{version}
Requires:       mpich-devel
Requires:       openmpi-devel

%description devel
GASNet is a language-independent, low-level networking layer that provides
network-independent, high-performance communication primitives tailored for
implementing parallel global address space SPMD languages
such as UPC, Titanium, and Co-Array Fortran.

Development package for GASNet. Including header files and libraries.

%package doc
Summary:        Documentation package for GASNet
BuildArch:      noarch

%description doc
GASNet is a language-independent, low-level networking layer that provides
network-independent, high-performance communication primitives tailored for
implementing parallel global address space SPMD languages
such as UPC, Titanium, and Co-Array Fortran.

Documentation package for GASNet.

%prep
%setup -q -n GASNet-%{version}
%patch0 -p0

%build
mkdir serial openmpi mpich
%global dconfigure %(printf %%s '%configure' | sed 's!\./configure!../configure!g')

pushd serial
%dconfigure --enable-udp --disable-mpi --enable-par --disable-aligned-segments  --enable-segment-fast --with-segment-mmap-max=4GB CC="gcc -fPIC" CXX="g++ -fPIC"
%make_build MANUAL_CFLAGS="%optflags -fPIC" MANUAL_MPICFLAGS="%optflags -fPIC" MANUAL_CXXFLAGS="%optflags -fPIC" -j3
popd

pushd openmpi
%{_openmpi_load}
%dconfigure --enable-udp --enable-mpi --enable-par --disable-aligned-segments  --enable-segment-fast --with-segment-mmap-max=4GB --bindir="${MPI_BIN}"  --includedir="${MPI_INCLUDE}" --libdir="${MPI_LIB}" CC="gcc -fPIC" CXX="g++ -fPIC"
%make_build MANUAL_CFLAGS="%optflags -fPIC" MANUAL_MPICFLAGS="%optflags -fPIC" MANUAL_CXXFLAGS="%optflags -fPIC" -j3
%{_openmpi_unload}
popd

pushd mpich
%{_mpich_load}
%dconfigure --enable-udp --enable-mpi --enable-par --disable-aligned-segments  --enable-segment-fast --with-segment-mmap-max=4GB --bindir="${MPI_BIN}"  --includedir="${MPI_INCLUDE}" --libdir="${MPI_LIB}" CC="gcc -fPIC" CXX="g++ -fPIC"
%make_build MANUAL_CFLAGS="%optflags -fPIC" MANUAL_MPICFLAGS="%optflags -fPIC" MANUAL_CXXFLAGS="%optflags -fPIC" -j3
%{_mpich_unload}
popd

%check
make -C serial check MANUAL_CFLAGS="%optflags -fPIC" MANUAL_MPICFLAGS="%optflags -fPIC" MANUAL_CXXFLAGS="%optflags -fPIC"
%{_openmpi_load}
make -C openmpi check MANUAL_CFLAGS="%optflags -fPIC" MANUAL_MPICFLAGS="%optflags -fPIC" MANUAL_CXXFLAGS="%optflags -fPIC"
%{_openmpi_unload}
%{_mpich_load}
make -C mpich check MANUAL_CFLAGS="%optflags -fPIC" MANUAL_MPICFLAGS="%optflags -fPIC" MANUAL_CXXFLAGS="%optflags -fPIC"
%{_mpich_unload}

%install
%make_install -C serial
%make_install -C openmpi
%make_install -C mpich

#shared between serial and parallel
rm -f %{buildroot}/%{_libdir}/*mpi*/bin/gasnet_trace

chmod +x %{buildroot}/%{_bindir}/*.pl
sed -i '1s@env @@' %{buildroot}/%{_bindir}/*.pl
chmod +x %{buildroot}/%{_libdir}/*mpi*/bin/*.pl
sed -i '1s@env @@' %{buildroot}/%{_libdir}/*mpi*/bin/*.pl

#Upstream doesn't want to support shared libs: https://bitbucket.org/berkeleylab/gasnet/pull-requests/36
#mind the order for link deps, libgasnet_tools-seq first then libam* then the rest
for l in %{buildroot}/%{_libdir}/{,*mpi*/lib}/lib{gasnet_tools-seq,am*,*}.a; do \
    [[ -f $l ]] || continue; \
    soname=`basename $l .a`; \
    libdir=`dirname $l`; \
    libs= ; \
    [[ ${soname} = libgasnet-*-par* ]] && libs+=" -lpthread"; \
    [[ ${soname} = libamudp ]] && libs+=" -L${libdir} -lgasnet_tools-seq"; \
    [[ ${l} = *el7*mpich* ]] && mpi="mpich" || mpi="mpi"; \
    [[ ${soname} = libammpi ]] && libs+=" -L${libdir#%{buildroot}} -l${mpi}"; \
    [[ ${soname} = libgasnet-udp-* ]] && libs+=" -L${libdir} -lamudp"; \
    [[ ${soname} = libgasnet-mpi-* ]] && libs+=" -L${libdir} -lammpi"; \
    [[ ${soname} = libgasnet-*-* ]] && libs+=" -lrt"; \
    g++ -shared -Wl,-soname=${soname}-%{version}.so \
        -Wl,--as-needed -Wl,-z,defs -Wl,-z,relro -Wl,--rpath-link=. \
        -Wl,--whole-archive ${l} -Wl,--no-whole-archive \
        ${libs} -o ${libdir}/${soname}-%{version}.so && \
    ln -s ${soname}-%{version}.so ${libdir}/${soname}.so && \
    rm ${l} ; \
done

# MPI subpackages don't need the ldconfig magic.  They are hidden by
# default, in MPI back-end-specific directory, and only show to the
# user after the relevant environment module has been loaded.
# rpmlint will report that as errors, but it is fine.
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%{_bindir}/amudprun
%{_libdir}/lib*-%{version}.so
%doc ChangeLog README README-tools
%license license.txt

%files common
%{_bindir}/gasnet_trace*

%files openmpi
%{_libdir}/openmpi*/bin/*
%{_libdir}/openmpi*/lib/lib*-%{version}.so

%files mpich
%{_libdir}/mpich*/bin/*
%{_libdir}/mpich*/lib/lib*-%{version}.so

%files doc
%{_datadir}/doc/GASNet

%files devel
%doc ChangeLog
%{_includedir}/*.h
%{_includedir}/*.mak
%{_includedir}/*-conduit
%{_libdir}/lib*[a-z].so
%{_libdir}/pkgconfig/*.pc
%{_libdir}/valgrind
%{_includedir}/openmpi-*/*
%{_libdir}/openmpi*/lib/lib*[a-z].so
%{_libdir}/openmpi*/lib/pkgconfig/*.pc
%{_libdir}/openmpi*/lib/valgrind
%{_includedir}/mpich-*/*
%{_libdir}/mpich*/lib/lib*[a-z].so
%{_libdir}/mpich*/lib/pkgconfig/*.pc
%{_libdir}/mpich*/lib/valgrind

%changelog
* Thu Aug 03 2017 Christoph Junghans <junghans@votca.org> - 1.28.2-7
- Added patch from OpenSuse to support s390x (bug #1453092)
- limit to -j3 due to parallel make error

* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.28.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.28.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sun Jun 04 2017 Jitka Plesnikova <jplesnik@redhat.com> - 1.28.2-4
- Perl 5.26 rebuild

* Sun Jun 04 2017 Jitka Plesnikova <jplesnik@redhat.com> - 1.28.2-3
- Perl 5.26 rebuild

* Mon May 22 2017 Christoph Junghans <junghans@votca.org> - 1.28.2-2
- Exclude s390x (not supported by upstream) - #1453092

* Sat Mar 18 2017 Christoph Junghans <junghans@votca.org> - 1.28.2-1
- Update to 1.28.2 (#1433545)

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.28.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Oct 24 2016 Christoph Junghans <junghans@votca.org> - 1.28.0-1
- Version bump (bug #1388084)

* Fri Oct 21 2016 Orion Poplawski <orion@cora.nwra.com> - 1.26.4-7
- Rebuild for openmpi 2.0

* Tue Oct 18 2016 Christoph Junghans <junghans@votca.org> - 1.26.4-6
- Link libamudp against gasnet_tools-seq as suggested by Paul
  Hargrove (upstream), fix broken links in devel package

* Mon Oct 03 2016 Christoph Junghans <junghans@votca.org> - 1.26.4-5
- Added -z,-relro to link flags

* Wed Sep 28 2016 Christoph Junghans <junghans@votca.org> - 1.26.4-4
- Drop --disable-pshm as recommended by Dan Bonachea (upstream) on
  https://bitbucket.org/berkeleylab/gasnet/pull-requests/36

* Mon Sep 26 2016 Christoph Junghans <junghans@votca.org> - 1.26.4-3
- More changes from review (bug #1375744)

* Thu Sep 22 2016 Christoph Junghans <junghans@votca.org> - 1.26.4-2
- Minor changes from review (bug #1375744)

* Mon Sep 12 2016 Christoph Junghans <junghans@votca.org> - 1.26.4-1
- First release.