# 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} %if 0%{?el6} # el6/ppc64 Error: No Package found for mpich-devel ExclusiveArch: x86_64 %{ix86} %else %{!?openblas_arches:%global openblas_arches x86_64 %{ix86} armv7hl %{power64} aarch64} ExclusiveArch: %{openblas_arches} %endif # disable compilation warnings %global wnoflags -Wno-unused-variable -Wno-conversion -Wno-unused-dummy-argument -Wno-character-truncation -Wno-missing-include-dirs -Wno-unused-function -Wno-maybe-unitialized Name: quantum-espresso Version: 5.4.0 Release: 19%{?dist} Summary: A suite for electronic-structure calculations and materials modeling License: GPLv2+ # BSD: PP/src/bgw2pw.f90 # BSD: PP/src/pw2bgw.f90 # LGPLv2+: Modules/bspline.f90 # LGPLv2+: Modules/libxc.f90 # LGPLv2+: install/iotk_config.h # MIT: install/install-sh # zlib/libpng: clib/md5.c # zlib/libpng: clib/md5.h URL: http://www.quantum-espresso.org/ Source0: http://www.qe-forge.org/gf/download/frsrelease/211/968/espresso-5.4.0.tar.gz Source1: http://www.qe-forge.org/gf/download/frsrelease/211/962/PHonon-5.4.0.tar.gz Source2: http://www.qe-forge.org/gf/download/frsrelease/211/958/xspectra-5.4.0.tar.gz Source3: http://www.qe-forge.org/gf/download/frsrelease/211/961/PWgui-5.4.0.tar.gz Source4: http://www.qe-forge.org/gf/download/frsrelease/211/957/GWW-5.4.0.tar.gz Source5: http://www.qe-forge.org/gf/download/frsrelease/211/956/tddfpt-5.4.0.tar.gz Source6: http://www.qe-forge.org/gf/download/frsrelease/211/960/pwcond-5.4.0.tar.gz Source7: http://www.qe-forge.org/gf/download/frsrelease/211/954/atomic-5.4.0.tar.gz Source8: http://www.qe-forge.org/gf/download/frsrelease/211/959/neb-5.4.0.tar.gz Source9: http://www.qe-forge.org/gf/download/frsrelease/211/963/test-suite-5.4.0.tar.gz # pseudopotentials not included in the source and needed by PW/tests Source21: http://www.quantum-espresso.org/wp-content/uploads/upf_files/Ag.pbe-dn-rrkjus_psl.0.1.UPF Source22: http://www.quantum-espresso.org/wp-content/uploads/upf_files/Al.pz-vbc.UPF Source23: http://www.quantum-espresso.org/wp-content/uploads/upf_files/As.pz-bhs.UPF Source24: http://www.quantum-espresso.org/wp-content/uploads/upf_files/C.pbe-mt_gipaw.UPF Source25: http://www.quantum-espresso.org/wp-content/uploads/upf_files/C.pbe-n-kjpaw_psl.0.1.UPF Source26: http://www.quantum-espresso.org/wp-content/uploads/upf_files/C.pbe-rrkjus.UPF Source27: http://www.quantum-espresso.org/wp-content/uploads/upf_files/C.pbe-van_ak.UPF Source28: http://www.quantum-espresso.org/wp-content/uploads/upf_files/C.pbe-van_bm.UPF Source29: http://www.quantum-espresso.org/wp-content/uploads/upf_files/C.pz-rrkjus.UPF Source30: http://www.quantum-espresso.org/wp-content/uploads/upf_files/C.pz-vbc.UPF Source31: http://www.quantum-espresso.org/wp-content/uploads/upf_files/C.tpss-mt.UPF Source32: http://www.quantum-espresso.org/wp-content/uploads/upf_files/Cu.pbe-kjpaw.UPF Source33: http://www.quantum-espresso.org/wp-content/uploads/upf_files/Cu.pz-d-rrkjus.UPF Source34: http://www.quantum-espresso.org/wp-content/uploads/upf_files/Fe.pz-nd-rrkjus.UPF Source35: http://www.quantum-espresso.org/wp-content/uploads/upf_files/Ge.pbe-kjpaw.UPF Source36: http://www.quantum-espresso.org/wp-content/uploads/upf_files/H.blyp-vbc.UPF Source37: http://www.quantum-espresso.org/wp-content/uploads/upf_files/H.coulomb-ae.UPF Source38: http://www.quantum-espresso.org/wp-content/uploads/upf_files/H.pbe-kjpaw.UPF Source39: http://www.quantum-espresso.org/wp-content/uploads/upf_files/H.pbe-rrkjus.UPF Source40: http://www.quantum-espresso.org/wp-content/uploads/upf_files/H.pbe-van_ak.UPF Source41: http://www.quantum-espresso.org/wp-content/uploads/upf_files/H.pbe-vbc.UPF Source42: http://www.quantum-espresso.org/wp-content/uploads/upf_files/H.pz-rrkjus.UPF Source43: http://www.quantum-espresso.org/wp-content/uploads/upf_files/H.pz-vbc.UPF Source44: http://www.quantum-espresso.org/wp-content/uploads/upf_files/H.tpss-mt.UPF Source45: http://www.quantum-espresso.org/wp-content/uploads/upf_files/Ni.pbe-nd-rrkjus.UPF Source46: http://www.quantum-espresso.org/wp-content/uploads/upf_files/Ni.pz-nd-rrkjus.UPF Source47: http://www.quantum-espresso.org/wp-content/uploads/upf_files/N.pbe-kjpaw.UPF Source48: http://www.quantum-espresso.org/wp-content/uploads/upf_files/O.blyp-mt.UPF Source49: http://www.quantum-espresso.org/wp-content/uploads/upf_files/O.pbe-kjpaw.UPF Source50: http://www.quantum-espresso.org/wp-content/uploads/upf_files/O.pbe-rrkjus.UPF Source51: http://www.quantum-espresso.org/wp-content/uploads/upf_files/O.pz-kjpaw.UPF Source52: http://www.quantum-espresso.org/wp-content/uploads/upf_files/O.pz-mt.UPF Source53: http://www.quantum-espresso.org/wp-content/uploads/upf_files/O.pz-rrkjus.UPF Source54: http://www.quantum-espresso.org/wp-content/uploads/upf_files/O.pz-van_ak.UPF Source55: http://www.quantum-espresso.org/wp-content/uploads/upf_files/Pb.pz-d-van.UPF Source56: http://www.quantum-espresso.org/wp-content/uploads/upf_files/Pt.rel-pz-n-rrkjus.UPF Source57: http://www.quantum-espresso.org/wp-content/uploads/upf_files/Si.pbe-n-van.UPF Source58: http://www.quantum-espresso.org/wp-content/uploads/upf_files/Si.pbe-rrkj.UPF Source59: http://www.quantum-espresso.org/wp-content/uploads/upf_files/Si.pz-vbc.UPF Source60: http://www.quantum-espresso.org/wp-content/uploads/upf_files/Ti.pz-sp-van_ak.UPF # handle license on el{6,7}: global must be defined after the License field above %{!?_licensedir: %global license %doc} BuildRequires: make BuildRequires: python2 BuildRequires: gcc-gfortran BuildRequires: openblas-devel BuildRequires: fftw3-devel BuildRequires: openssh-clients Requires: openssh-clients %global desc_base \ QUANTUM ESPRESSO is an integrated suite of Open-Source computer codes for\ electronic-structure calculations and materials modeling at the nanoscale.\ It is based on density-functional theory, plane waves, and pseudopotentials. %description %{desc_base} Serial version. Includes iotk executables. %package devel Summary: %{name} - devel %description devel %{desc_base} This package contains modules and headers. %package static Summary: %{name} - static libraries %description static %{desc_base} This package contains static libraries. %package openmpi Summary: %{name} - openmpi version BuildRequires: openmpi-devel BuildRequires: scalapack-openmpi-devel Requires: openmpi %if 0%{?el6} BuildRequires: scalapack-openmpi BuildRequires: blacs-openmpi %endif %description openmpi %{desc_base} This package contains the openmpi version. %package openmpi-devel Summary: %{name} - devel openmpi version BuildRequires: openmpi Requires: openmpi %description openmpi-devel %{desc_base} This package contains modules and headers for openmpi. %package openmpi-static Summary: %{name} - static libraries openmpi version BuildRequires: openmpi Requires: openmpi %description openmpi-static %{desc_base} This package contains static libraries for openmpi. %package mpich Summary: %{name} - mpich version BuildRequires: mpich-devel BuildRequires: scalapack-mpich-devel Requires: mpich %if 0%{?el6} BuildRequires: scalapack-mpich BuildRequires: blacs-mpich %endif %description mpich %{desc_base} This package contains the mpich version. %package mpich-devel Summary: %{name} - devel mpich version BuildRequires: mpich Requires: mpich %description mpich-devel %{desc_base} This package contains modules and headers for mpich. %package mpich-static Summary: %{name} - static libraries mpich version BuildRequires: mpich Requires: mpich %description mpich-static %{desc_base} This package contains static libraries for mpich. %prep %setup -q -n espresso-%{version} %setup -q -n espresso-%{version} -a1 -a2 -a3 -a4 -a4 -a5 -a6 -a7 -a8 -a9 # remove bundled libraries rm -rf archive/lapack-*.tar.gz rm -rf archive/blas-*.tar.gz rm -rf archive/ELPA-*.tar.gz # fix fatal error: fft_defs.h: No such file or directory sed -i 's|MANUAL_DFLAGS =|MANUAL_DFLAGS = -I../../include|' install/make.sys.in # build exx sed -i 's|MANUAL_DFLAGS =|MANUAL_DFLAGS = -DEXX|' install/make.sys.in # use specified compiler flags sed -i 's|@fflags@|@cflags@|' install/make.sys.in # Horror! Tests use $HOME/tmp or /tmp by default! sed -i 's#TMP_DIR=.*#TMP_DIR=./tmp#' environment_variables sed -i 's#ESPRESSO_TMPDIR=.*#ESPRESSO_TMPDIR=./tmp#' test-suite/ENVIRONMENT # NO network access during build! sed -i 's#NETWORK_PSEUDO=.*#NETWORK_PSEUDO=/dev/null#' environment_variables sed -i 's#NETWORK_PSEUDO=.*#NETWORK_PSEUDO=/dev/null#' test-suite/ENVIRONMENT # must set ESPRESSO_ROOT explicitly sed -i "s#ESPRESSO_ROOT=.*#ESPRESSO_ROOT=${PWD}#" test-suite/ENVIRONMENT # bash uses source and not include sed -i "s#include #source #" test-suite/run-cp.sh sed -i "s#include #source #" test-suite/run-pw.sh # remove -D__XLF on ppc64 # http://qe-forge.org/pipermail/pw_forum/2009-January/085834.html sed -i '/D__XLF/d' install/configure # remove -D__LINUX_ESSL on ppc64 sed -i 's/try_dflags -D__LINUX_ESSL/try_dflags/' install/configure sed -i 's/have_essl=1/have_essl=0/' install/configure %build # Have to do off-root builds to be able to build many versions at once mv install install.orig # To avoid replicated code define a macro %global dobuild() \ mkdir -p bin$MPI_SUFFIX&& \ mkdir -p iotk$MPI_SUFFIX&& \ if test -z "$MPI_SUFFIX"; then MPIF90='gfortran'; CONFIGURE='--disable-parallel'; fi&& \ if test -n "$MPI_SUFFIX"; then MPIF90='mpif90'; CONFIGURE='--enable-parallel --with-scalapack=yes --with-elpa=no'; fi&& \ if [ "$MPI_SUFFIX" == "_openmpi" ] && [ -r "$MPI_LIB/libmpi_f90.so" ]; then export LIBMPI='-lmpi -lmpi_f90 -lmpi_f77'; fi&& \ if [ "$MPI_SUFFIX" == "_openmpi" ] && [ -r "$MPI_LIB/libmpi_usempi.so" ]; then export LIBMPI='-lmpi -lmpi_usempi -lmpi_mpifh'; fi&& \ if [ "$MPI_SUFFIX" == "_openmpi" ] && [ -r "$MPI_LIB/libmpi_usempif08.so" ]; then export LIBMPI='-lmpi -lmpi_usempif08 -lmpi_mpifh'; fi&& \ if [ "$MPI_SUFFIX" == "_mpich2" ]; then export LIBMPI='-lmpich'; fi&& \ if [ "$MPI_SUFFIX" == "_mpich" ]; then export LIBMPI='-lmpich'; fi&& \ CC=gcc CXX=c++ FC=gfortran \ MPIF90=$MPIF90 \ FCFLAGS='%{optflags}' \ CFLAGS='%{optflags} %{wnoflags}' \ FFLAGS='%{optflags}' \ BLAS_LIBS='-lopenblas' \ LAPACK_LIBS='-lopenblas' \ FFT_LIBS='-lfftw3' \ MPI_LIBS="-L${MPI_LIB} $LIBMPI" \ SCALAPACK_LIBS="-L${MPI_LIB} -lscalapack" \ %{_configure} $CONFIGURE&& \ %{__make} all&& \ for f in bin/*; do cp -pL $f bin$MPI_SUFFIX/`basename ${f}`; done&& \ if test -d upftools; then for f in upftools/*.x; do cp -pL $f bin$MPI_SUFFIX/`basename ${f}`; done; fi&& \ cp -pL iotk/src/libiotk.a iotk/src/*.mod iotk$MPI_SUFFIX&& \ %{__make} clean # build openmpi version cp -rp install.orig install %{_openmpi_load} %dobuild %{_openmpi_unload} rm -rf install # build mpich version cp -rp install.orig install %{_mpich_load} %dobuild %{_mpich_unload} rm -rf install # build serial version cp -rp install.orig install MPI_SUFFIX=_serial %dobuild %install # To avoid replicated code define a macro %global doinstall() \ mkdir -p $RPM_BUILD_ROOT/$MPI_BIN&& \ mkdir -p $RPM_BUILD_ROOT/$MPI_LIB&& \ mkdir -p $RPM_BUILD_ROOT/$MPI_FORTRAN_MOD_DIR&& \ for f in bin$MPI_SUFFIX/*; do install -p -m 755 ${f} $RPM_BUILD_ROOT/$MPI_BIN/`basename ${f}`$EXE_SUFFIX; done&& \ install -p -m 755 iotk$MPI_SUFFIX/*.a $RPM_BUILD_ROOT/$MPI_LIB&& \ install -p -m 755 iotk$MPI_SUFFIX/*.mod $RPM_BUILD_ROOT/$MPI_FORTRAN_MOD_DIR # install openmpi version %{_openmpi_load} EXE_SUFFIX=$MPI_SUFFIX %doinstall %{_openmpi_unload} # install mpich version %{_mpich_load} EXE_SUFFIX=$MPI_SUFFIX %doinstall # https://bugzilla.redhat.com/show_bug.cgi?id=1154991 mkdir -p $RPM_BUILD_ROOT%{_fmoddir}/mpich%{?_cc_name_suffix} if test -d $RPM_BUILD_ROOT%{_includedir}/mpich-%{_arch}%{?_cc_name_suffix}; then mv -f $RPM_BUILD_ROOT%{_includedir}/mpich-%{_arch}%{?_cc_name_suffix}/* $RPM_BUILD_ROOT%{_fmoddir}/mpich%{?_cc_name_suffix} rm -rf $RPM_BUILD_ROOT%{_includedir} fi %{_mpich_unload} # install serial version EXE_SUFFIX="" MPI_SUFFIX="_serial" MPI_BIN=%{_bindir} MPI_LIB=%{_libdir} MPI_FORTRAN_MOD_DIR=%{_fmoddir} %doinstall %check # clean removes all extra pseudo - must copy them now cp -p %{expand: %{lua: for i=21,60 do print("%{SOURCE"..i.."} ") end}} pseudo/ # To avoid replicated code define a macro %global docheck() \ cp -rp test-suite.orig test-suite&& \ pushd test-suite&& \ sed -i "s&1 | tee ../tests$MPI_SUFFIX.log&& \ popd&& \ rm -rf test-suite mv test-suite test-suite.orig # check serial version MPI_SUFFIX=_serial %docheck NPROC=1 # all parallel tests use mpirun sed -i '/unset PARA_PREFIX/d' environment_variables sed -i "s - 5.4.0-19 - Rebuild for openmpi 4.0 * Sat Jul 14 2018 Fedora Release Engineering - 5.4.0-18 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Wed May 02 2018 Iryna Shcherbina - 5.4.0-17 - Update Python 2 dependency declarations to new packaging standards (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) * Wed Mar 07 2018 Adam Williamson - 5.4.0-16 - Rebuild to fix GCC 8 mis-compilation See https://da.gd/YJVwk ("GCC 8 ABI change on x86_64") * Fri Feb 09 2018 Fedora Release Engineering - 5.4.0-15 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Thu Aug 03 2017 Fedora Release Engineering - 5.4.0-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild * Thu Jul 27 2017 Fedora Release Engineering - 5.4.0-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Sat Feb 11 2017 Fedora Release Engineering - 5.4.0-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Fri Oct 21 2016 Orion Poplawski - 5.4.0-11 - Rebuild for openmpi 2.0 * Fri Sep 16 2016 Marcin Dulak - 5.4.0-10 - upsteam update - speedup the tests by running on single core so koji %%{arm} builds finish within the timeout (bug #1356620) - get rid of D__XLF and D__LINUX_ESSL on ppc64 * Tue Sep 6 2016 Peter Robinson 5.3.0-9 - Sync openblas ExclusiveArch * Thu Feb 18 2016 Marcin Dulak - 5.3.0-8 - use only 2 cores for tests (bug #1308481) - defattr removed * Sat Feb 13 2016 Marcin Dulak - 5.3.0-7 - explicit Requires are needed for scalapack, blacs on el6 (bug #1301922) * Thu Feb 04 2016 Fedora Release Engineering - 5.3.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Tue Jan 12 2016 Marcin Dulak 5.3.0-5 - upsteam update - switch to test-suite - no more upftools? * Mon Jan 4 2016 Marcin Dulak 5.2.1-4 - disable compilation warnings - use lua for copying pseudos - removed common package * Sat Dec 19 2015 Marcin Dulak 5.2.1-3 - fix ExclusiveArch - license is GPLv2+ - OMP_NUM_THREADS removed - use %%{optflags} * Fri Dec 18 2015 Dave Love - 5.2.1-2 - Require %%{name}-common, not %%{name}-common%%{?_isa} * Wed Dec 16 2015 Marcin Dulak 5.1.2-1 - initial build