Name: mpb Version: 1.6.1 Release: 1%{?dist} Summary: Unofficial MPB RPM package #Group: License: MIT URL: https://mpb.readthedocs.io/en/latest/ Source0: %{name}-%{version}.tar.gz BuildRequires: autoconf BuildRequires: automake BuildRequires: blas-devel BuildRequires: fftw BuildRequires: fftw-devel BuildRequires: guile-devel BuildRequires: hdf5-devel BuildRequires: lapack-devel BuildRequires: libctl-devel BuildRequires: libgfortran BuildRequires: libquadmath-devel BuildRequires: libtool Requires: libctl Requires: h5utils Requires: harminv %global mpi_list openmpi mpich %description MPB is a free and open-source software package for computing the band structures, or dispersion relations, and electromagnetic modes of periodic dielectric structures, on both serial and parallel computers. MPB is an acronym for MIT Photonic Bands. MPB computes definite-frequency eigenstates, or harmonic modes, of Maxwell's equations in periodic dielectric structures for arbitrary wavevectors, using fully-vectorial and three-dimensional methods. It is applicable to many problems in optics, such as waveguides and resonator systems, and photonic crystals. %package static Summary: Static libraries files for mpb Requires: %{name}-devel%{?_isa} = %{version}-%{release} %description static Static libraries files for MPB %package devel Summary: Developer files for MPB Requires: %{name}-devel%{?_isa} = %{version}-%{release} %description devel Developer files for MPB %package mpich Summary: Unofficial MPB RPM package with mpich support BuildRequires: mpich-devel BuildRequires: fftw-mpich-devel %description mpich The MIT Photonic-Bands (MPB) with MPI (mpich). %package mpich-devel Summary: Unofficial MPB RPM package with mpich support development library Requires: %{name}-mpich{?_isa} = %{version}-%{release} %description mpich-devel The MIT Photonic-Bands (MPB) with MPI (mpich) development libraries. %package openmpi Summary: Unofficial MPB RPM package with openmpi support BuildRequires: openmpi-devel BuildRequires: fftw-openmpi-devel %description openmpi The MIT Photonic-Bands (MPB) with MPI (openmpi). %package openmpi-devel Summary: Unofficial MPB RPM package with openmpi support development library Requires: %{name}-openmpi{?_isa} = %{version}-%{release} %description openmpi-devel %prep %setup -q %{name}-%{version} %build old_CXXFLAGS=$CXXFLAGS export CXXFLAGS="$CXXFLAGS -fPIC" %configure \ --enable-shared \ -disable-static \ --enable-fast-install\ --enable-dependency-tracking\ --enable-long-double \ --enable-prof \ --enable-kottke \ --with-gnu-ld \ --with-inv-symmetry \ --with-hermitian-eps \ --with-blas \ --with-lapack \ # --enable-debug \ # --enable-debug-malloc \ make %{?_smp_mflags} for mpi in %{mpi_list} do cd .. rm -rf %{name}-%{version}-build-$mpi cp -p -R %{name}-%{version} %{name}-%{version}-build-$mpi pushd %{name}-%{version}-build-$mpi module load mpi/${mpi}-%{_arch} export LDFLAGS=-L%{_libdir}/$mpi/lib if [$mpi == "mpich"] then mpilib = "mpi" fi if [$mpi == "openmpi"] then mpilib = "openmpi" fi %configure \ --enable-shared \ --with-$mpi \ --disable-static \ --enable-fast-install\ --enable-dependency-tracking\ --enable-long-double \ --enable-prof \ --enable-kottke \ --with-gnu-ld \ --with-inv-symmetry \ --with-hermitian-eps \ --with-blas \ --with-lapack \ --with-libctl # --enable-debug \ # --enable-debug-malloc \ # --with-efence \ make %{?_smp_mflags} module purge done popd export LDFLAGS=%{previous_LDFLAGS} export CXXFLAGS=%{old_CXXFLAGS} %install ##%##%#%#%#%#%make_install cd .. for mpi in %{mpi_list} do module load mpi/${mpi}-%{_arch} mkdir -p %{buildroot}/%{_libdir}/$mpi/bin/ #pushd %{name}-%{version}-build-$mpi make -C %{name}-%{version}-build-${mpi} install DESTDIR=%{buildroot} # seems some binaries are being installed in the wrong place mv %{buildroot}/%{_bindir}/* %{buildroot}/%{_libdir}/$mpi/bin/ module purge done #popd make -C %{name}-%{version} install DESTDIR=%{buildroot} find ${RPM_BUILD_ROOT} -type f -name "*.la" -exec rm -f {} ';' # Get rid of the Makefile.am and Makefile.in for the doc find ${RPM_BUILD_DIR} -type f -name "Makefile.am" -exec rm -f {} ';' find ${RPM_BUILD_DIR} -type f -name "Makefile.in" -exec rm -f {} ';' %post /sbin/ldconfig %postun /sbin/ldconfig %files %doc COPYING COPYRIGHT README.md NEWS TODO AUTHORS examples %{_mandir}/man1/* %{_bindir}/* %{_datadir}/mpb %{_libdir}/*.so.* # %%files static # %%{_libdir}/*.a %files devel %{_libdir}/*.so %{_includedir}/*.h %{_includedir}/mpb %files mpich %doc COPYING COPYRIGHT README.md NEWS TODO AUTHORS examples %{_libdir}/mpich/bin/* # %%{_libdir}/mpich/lib/*.so.* # %%{_libdir}/mpich/share/man/man1/* %files mpich-devel # %%{_libdir}/mpich/lib/*.so ### %%{_includedir}/mpich-%{_arch}/*.h #### %%{_includedir}/mpich-%{_arch}/mpb # %%files mpich-static # %%{_libdir}/mpich/lib/*.a %files openmpi %doc COPYING COPYRIGHT README.md NEWS TODO AUTHORS examples %{_libdir}/openmpi/bin/* # %%{_libdir}/openmpi/lib/*.so.* # %%{_libdir}/openmpi/share/man/man1/* %files openmpi-devel # %%{_libdir}/openmpi/lib/*.so # %%{_includedir}/openmpi-%{_arch}/*.h # %%{_includedir}/openmpi-%{_arch}/mpb # %%files openmpi-static # %%{_libdir}/openmpi/lib/*.a %changelog * Fri Sep 21 2018 Subimal Deb - 1.6.1-1 - Installing version 1.6.1.