# Warning: # Anyone editing this spec file please make sure the same spec file # works on other fedora and epel releases, which are supported by this software. # No quick Rawhide-only fixes will be allowed. # missing on el6 %{?!_fmoddir: %global _fmoddir %{_libdir}/gfortran/modules} %global nametag exciting %global versiontag carbon %global all serial mpi spacegroup stateinfo stateconvert species # versiontag to versionnumber conversion - just count releases %if "%{versiontag}" == "lithium" %global versionnumber 5 %endif %if "%{versiontag}" == "beryllium" %global versionnumber 6 %endif %if "%{versiontag}" == "boron" %global versionnumber 10 %endif %if "%{versiontag}" == "carbon" %global versionnumber 12 %endif %if 0%{?el6} # el6/ppc64 Error: No Package found for mpich-devel ExclusiveArch: x86_64 %{ix86} %else %if 0%{?fedora} == 28 ExclusiveArch: x86_64 %{ix86} aarch64 %{power64} %else ExclusiveArch: x86_64 %{ix86} aarch64 %{arm} %{power64} %endif %endif %global ARPACK -L%{_libdir} -larpack %global BLASLAPACK -L%{_libdir} -lopenblas %global FFTW -L%{_libdir} -lfftw3 %if 0%{?fedora} >= 25 %global LIBXC -L%{_libdir} -lxc -lxcf90 %else %global LIBXC -L%{_libdir} -lxc %endif # FoX-config --libs --shared --pretty %global FOX -lFoX_wkml -lFoX_dompp -lFoX_sax -lFoX_wcml -lFoX_wxml -lFoX_common -lFoX_utils -lFoX_fsys Name: %{nametag} Version: %{versionnumber} Release: 13%{?dist} Summary: A full-potential all-electron density-functional-theory package License: GPLv2+ URL: http://exciting-code.org/ Source0: http://exciting.wdfiles.com/local--files/%{versiontag}/%{name}.%{versiontag}.tar.gz Patch0: %{name}.fftw3.zfftifc.f90.patch # handle license on el{6,7}: global must be defined after the License field above %{!?_licensedir: %global license %doc} BuildRequires: lynx %if 0%{?fedora} BuildRequires: perl-interpreter %else BuildRequires: perl %endif %if 0%{?fedora} || 0%{?el7} BuildRequires: perl-Data-Dumper %endif BuildRequires: time BuildRequires: libxslt BuildRequires: gcc-gfortran BuildRequires: arpack-devel BuildRequires: openblas-devel BuildRequires: fftw3-devel BuildRequires: libxc-devel BuildRequires: FoXlibf-devel # /etc/profile.d is owned by setup Requires: setup Requires: %{name}-species = %{version}-%{release} %global desc_base \ exciting is a full-potential all-electron density-functional-theory (DFT)\ package implementing the families of linearized augmented planewave (LAPW)\ methods. It can be applied to all kinds of materials, irrespective of the\ atomic species involved, and also allows for exploring the physics of core\ electrons. A particular focus are excited states within many-body perturbation\ theory (MBPT). %description %{desc_base} %package openmpi Summary: %{name} - openmpi version BuildRequires: openmpi-devel Requires: %{name}-species = %{version}-%{release} %description openmpi %{desc_base} This package contains the openmpi version. %package mpich Summary: %{name} - mpich version BuildRequires: mpich-devel Requires: %{name}-species = %{version}-%{release} %description mpich %{desc_base} This package contains the mpich version. %package species Summary: %{name} - species files Requires: %{name}-common = %{version}-%{release} BuildArch: noarch %description species %{desc_base} This package contains the species files. %package common Summary: %{name} - common files %description common %{desc_base} This package contains the common binaries. %prep %setup -q -n %{name} # create common make.inc # serial echo "F90 = gfortran -ffree-line-length-none" > make.inc.serial echo "F90_OPTS = -I%{_fmoddir} -I/usr/include/FoX %{optflags}" >> make.inc.serial echo "F77 = \$(F90)" >> make.inc.serial echo "F77_OPTS = \$(F90_OPTS)" >> make.inc.serial echo "CPP_ON_OPT = -cpp -DXS -DISO -DLIBXC -DFFTW" >> make.inc.serial echo "AR = ar" >> make.inc.serial echo "LIB_ARP = %ARPACK" >> make.inc.serial echo "USE_SYS_LAPACK=true" >> make.inc.serial echo "LIB_LPK = %BLASLAPACK" >> make.inc.serial echo "LIB_FFT = %FFTW" >> make.inc.serial echo "LIB_BZINT = libbzint.a" >> make.inc.serial echo "LIBS = \$(LIB_ARP) \$(LIB_LPK) \$(LIB_FFT) \$(LIB_BZINT)" >> make.inc.serial echo "F90_DEBUGOPTS = \$(F90_OPTS)" >> make.inc.serial echo "F77_DEBUGOPTS = \$(F90_OPTS)" >> make.inc.serial # mpi echo "MPIF90 = mpif90 -ffree-line-length-none" > make.inc.mpi echo "MPIF90_OPTS = -I\$(MPIMODDIR) \$(F90_OPTS) \$(CPP_ON_OPT) -DMPI -DMPIRHO -DMPISEC" >> make.inc.mpi # smp echo "F77MT = \$(F77)" > make.inc.smp echo "F90MT = \$(F90)" >> make.inc.smp echo "SMP_LIBS = \$(LIBS)" >> make.inc.smp echo "SMPF90_OPTS = -fopenmp \$(F90_OPTS)" >> make.inc.smp echo "SMPF77_OPTS = \$(SMPF90_OPTS)" >> make.inc.smp # mpismp echo "MPIF90MT = \$(MPIF90)" > make.inc.mpismp echo "MPISMPF90_OPTS = \$(SMPF90_OPTS) -DMPI -DMPIRHO -DMPISECBUILDMPI=false" >> make.inc.mpismp # fix species/Makefile when linking fftw (uses zfftifc.f90) sed -i "s|\$(LIB_LPK)|\$(LIB_LPK) \$(LIB_FFT)|" src/species/template # remove bundling of BLAS/LAPACK/FFTW/LIBXC/ERF/ARPACK/FOX %patch0 -p0 sed -i "s/blas lapack fft exciting/exciting/" src/Makefile sed -i "s|LIBXCMOD=.*|LIBXCMOD=|" build/Make.common sed -i "s/ libxc.a / /" build/Make.common sed -i "s/ libfox/ /" build/Make.common sed -i "s/ -lFoX_dom -lFoX_sax -lFoX_utils -lFoX_wcml -lFoX_wxml -lFoX_fsys -lFoX_common//" build/libraries.inc sed -i "s/ fox//" src/species/Makefile sed -i "s|INTLIBS=-lxc|INTLIBS=%BLASLAPACK %FFTW %LIBXC %FOX|" build/libraries.inc sed -i "s/erf.f90//" src/Makefile sed -i "s/, erf//" src/src_lib/stheta_mp.f90 sed -i "s/external erf//" src/genrmesh.f90 # remove bundled sources rm -rf src/LAPACK src/BLAS src/fftlib src/libXC src/ARPACK src/FoX rm -f src/src_lib/erf.f90 %build # Have to do off-root builds to be able to build many versions at once mv src src.orig # To avoid replicated code define a macro %global dobuild() \ cat make.inc.serial make.inc.smp make.inc.mpi make.inc.mpismp > make.inc&& \ echo "MPIMODDIR = $MPI_FORTRAN_MOD_DIR" | tac make.inc - | tac > make.inc$MPI_SUFFIX&& \ echo "BUILDMPI = true" >> make.inc$MPI_SUFFIX&& \ echo "BUILDMPISMP = true" >> make.inc$MPI_SUFFIX&& \ cp -fp make.inc$MPI_SUFFIX build/make.inc&& \ cat build/make.inc&& \ %{__make} %{all}&& \ cd bin&& \ for f in %{name}mpi*; do cp -pv $f ../bin.save/${f}$MPI_SUFFIX; done&& \ cd ..&& \ %{__make} clean # build serial/openmp version export MPI_SUFFIX=_openmp # keep executables in a separate directory mkdir bin.save cp -rp src.orig src cat make.inc.serial make.inc.smp > make.inc$MPI_SUFFIX echo "BUILDSMP = true" >> make.inc$MPI_SUFFIX cp -fp make.inc$MPI_SUFFIX build/make.inc cat build/make.inc %{__make} %{all} mv bin/%{name}ser bin.save cd bin for f in *; do cp -pv $f ../bin.save/%{name}-${f}; done cd .. %{__make} clean rm -rf src # build openmpi version cp -rp src.orig src %{_openmpi_load} %dobuild %{_openmpi_unload} rm -rf src cp -rp src.orig src # build mpich version %{_mpich_load} %dobuild %{_mpich_unload} # leave last src build for debuginfo # clean (dir incomplete - only last mpi build is there) rm -rf bin # all executables go to bin (bin will be used for test) # note that excitingdebug will be created in bin! # Moreover due to the fact (i guess) we are moving binaries # around a new excitingser is generated by tests cp -rp bin.save bin cat < %{name}.sh # NOTE: This is an automatically-generated file! (generated by the # %%{name} RPM). Any changes made here will be lost if the RPM is # uninstalled or upgraded. PA=%{_datadir}/%{name} case \$EXCITINGROOT in *\${PA}*);; *?*) EXCITINGROOT=\${PA}:\${EXCITINGROOT};; *) EXCITINGROOT=\${PA};; esac export EXCITINGROOT EOF cat < %{name}.csh # NOTE: This is an automatically-generated file! (generated by the # %%{name} RPM). Any changes made here will be lost if the RPM is # uninstalled or upgraded. # must end with slash! set PA=%{_datadir}/%{name} if (\$?EXCITINGROOT) then if ("\$EXCITINGROOT" !~ *\${PA}*) then setenv EXCITINGROOT \${PA}:\${EXCITINGROOT} endif else setenv EXCITINGROOT \${PA} endif unset PA EOF %install mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} # To avoid replicated code define a macro %global doinstall() \ mkdir -p $RPM_BUILD_ROOT/$MPI_BIN&& \ install -p -m 755 bin.save/%{name}*$MPI_SUFFIX $RPM_BUILD_ROOT/$MPI_BIN&& \ rm -fv bin.save/%{name}*$MPI_SUFFIX # install openmpi version %{_openmpi_load} %doinstall %{_openmpi_unload} # install mpich version %{_mpich_load} %doinstall %{_mpich_unload} # install serial version mkdir -p $RPM_BUILD_ROOT%{_bindir} install -p -m 755 bin.save/* $RPM_BUILD_ROOT%{_bindir} mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name} # don't copy tools - they trigger dependency on perl, python ... cp -rp species xml $RPM_BUILD_ROOT%{_datadir}/%{name} cp -p build/Make.common build/libraries.inc make.inc* $RPM_BUILD_ROOT%{_datadir}/%{name} # don't copy test - it provides perl(XML::Simple), perl(XML::Writer), ... # env scripts install -p -m 444 %{name}*.*sh $RPM_BUILD_ROOT%{_datadir}/%{name} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/profile.d install -p -m 444 %{name}*.*sh $RPM_BUILD_ROOT%{_sysconfdir}/profile.d %check # Warning: make test compiles debug executables # One should be testing only already built and installed binaries! export NPROC=2 # test on 1 core export OMP_NUM_THREADS=$NPROC # To avoid replicated code define a macro %global docheck() \ cp -rp test.orig test&& \ sed -i "s|EXE = ../bin/excitingmpi|EXE = $EXCITING_EXECUTABLE|" test/Makefile &&\ time %{__make} test 2>&1 | tee tests.${NPROC}$MPI_SUFFIX.log&& \ cd test/report&& \ for f in report*{html,xml}; do if test -r $f; then cp -pv $f ../../${f}$MPI_SUFFIX; fi; done&& \ cd -&& \ ln -s report.html$MPI_SUFFIX report.html${MPI_SUFFIX}.html&& \ if test -r report.html$MPI_SUFFIX.html; then lynx -dump report.html$MPI_SUFFIX.html; fi&& \ rm -rf test mv test test.orig # http://exciting-code.org/forum/t-1980337/exciting-carbon-tar-gz:how-to-run-make-test-in-parallel-on-m sed -i 's|../../$(EXE)|$(EXE)|' test.orig/Makefile # check openmpi version %{_openmpi_load} EXCITING_EXECUTABLE="mpiexec -np ${NPROC} ../../../bin/%{name}mpi$MPI_SUFFIX" %docheck %{_openmpi_unload} # this will fail for mpich2 on el6 - mpd would need to be started ... # check mpich version %{_mpich_load} EXCITING_EXECUTABLE="mpiexec -np ${NPROC} ../../../bin/%{name}mpi$MPI_SUFFIX" %docheck %{_mpich_unload} # restore test mv test.orig test # compare bin after make test - make sure exit status is 0! diff -r --brief bin.save bin || /bin/true %files %{_bindir}/%{name}ser %files common %license COPYING README %{_bindir}/%{name}-* %{_datadir}/%{name} %exclude %{_datadir}/%{name}/species %config(noreplace) %{_sysconfdir}/profile.d/%{name}*.*sh %files species %{_datadir}/%{name}/species %files openmpi %{_libdir}/openmpi%{?_opt_cc_suffix}/bin/%{name}*_openmpi %files mpich %{_libdir}/mpich%{?_opt_cc_suffix}/bin/%{name}*_mpich %changelog * Mon Nov 26 2018 Orion Poplawski - 12-13 - Rebuild for openmpi 4.0 * Fri Jul 13 2018 Fedora Release Engineering - 12-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Wed Feb 07 2018 Fedora Release Engineering - 12-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Mon Oct 23 2017 Susi Lehtola - 12-10 - Rebuild against libxc 4. * Wed Aug 02 2017 Fedora Release Engineering - 12-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild * Wed Jul 26 2017 Fedora Release Engineering - 12-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Fri Feb 10 2017 Fedora Release Engineering - 12-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Mon Oct 31 2016 Marcin Dulak 12-6 - new upstream release - libxc 3 on fedora >= 25 - no mpich-devel on el6/ppc64 - -DTETRA removed - no more smp and mpiandsmp defined in src/Makefile - make all no longer includes all targets, like eos etc. * Thu Jul 14 2016 Peter Robinson 10-5 - openblas supported on Power64 * Wed Jul 13 2016 Peter Robinson 10-4 - aarch64 now has openblas * Thu Apr 21 2016 Susi Lehtola 10-3 - Rebuild against libxc 3.0.0. * Sat Feb 13 2016 Marcin Dulak 10-2 - removed defattr - added armv7hl ppc64le * Wed Dec 16 2015 Marcin Dulak 10-1 - initial build