2014-04-30 17:05:39 +00:00
|
|
|
#
|
2023-10-26 10:32:32 +00:00
|
|
|
# spec file
|
2014-04-30 17:05:39 +00:00
|
|
|
#
|
2023-10-26 10:32:32 +00:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2014-04-30 17:05:39 +00:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2019-11-05 09:45:02 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2014-04-30 17:05:39 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2020-01-17 20:45:07 +00:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
|
|
|
|
%define pname quantum-espresso
|
|
|
|
|
2020-02-10 12:46:00 +00:00
|
|
|
%if 0%{?sle_version} >= 150200
|
2020-01-17 20:45:07 +00:00
|
|
|
%define DisOMPI1 ExclusiveArch: do_not_build
|
2020-02-10 12:46:00 +00:00
|
|
|
%endif
|
|
|
|
%if !0%{?is_opensuse} && 0%{?sle_version:1} && 0%{?sle_version} < 150200
|
2020-01-17 20:45:07 +00:00
|
|
|
%define DisOMPI3 ExclusiveArch: do_not_build
|
2014-04-30 17:05:39 +00:00
|
|
|
%endif
|
|
|
|
|
2020-01-17 20:45:07 +00:00
|
|
|
%if "%{flavor}" == ""
|
|
|
|
%define package_name %{pname}
|
|
|
|
ExclusiveArch: do_not_build
|
2020-02-10 12:46:00 +00:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if "%{flavor}" != "" && !0%{?DisOMPI1:1} && !0%{?DisOMPI2:1} && !0%{?DisOMPI3:1}
|
2020-01-17 20:45:07 +00:00
|
|
|
ExclusiveArch: x86_64
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if "%{flavor}" == "mvapich2"
|
|
|
|
%global mpi_flavor mvapich2
|
|
|
|
%endif
|
|
|
|
|
2021-11-22 08:49:13 +00:00
|
|
|
%if "%{flavor}" == "openmpi4"
|
|
|
|
%global mpi_flavor openmpi
|
|
|
|
%define mpi_vers 4
|
|
|
|
%{?DisOMPI4}
|
|
|
|
%endif
|
|
|
|
|
2023-10-26 10:32:32 +00:00
|
|
|
%if "%{flavor}" == "openmpi5"
|
|
|
|
%global mpi_flavor openmpi
|
|
|
|
%define mpi_vers 5
|
|
|
|
%{?DisOMPI5}
|
|
|
|
%endif
|
|
|
|
|
2020-01-17 20:45:07 +00:00
|
|
|
%{?mpi_flavor:%{bcond_without mpi}}%{!?mpi_flavor:%{bcond_with mpi}}
|
|
|
|
%{?with_mpi:%{!?mpi_flavor:error "No MPI family specified!"}}
|
2014-04-30 17:05:39 +00:00
|
|
|
|
2020-01-17 20:45:07 +00:00
|
|
|
%define mpi_ext %{?mpi_vers}
|
|
|
|
|
|
|
|
%if %{without mpi}
|
|
|
|
%define my_prefix %_prefix
|
|
|
|
%define my_bindir %_bindir
|
|
|
|
%define my_libdir %_libdir
|
|
|
|
%define my_incdir %_includedir
|
|
|
|
%else
|
|
|
|
%define my_prefix %{_libdir}/mpi/gcc/%{mpi_flavor}%{?mpi_ext}
|
|
|
|
%define my_bindir %{my_prefix}/bin
|
2021-11-22 08:49:13 +00:00
|
|
|
%define my_libdir %{my_prefix}/%{_lib}
|
2020-01-17 20:45:07 +00:00
|
|
|
%define my_suffix -%{mpi_flavor}%{?mpi_ext}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if 0%{!?package_name:1}
|
|
|
|
%define package_name %pname%{?my_suffix}
|
|
|
|
%endif
|
|
|
|
|
2021-11-22 08:49:13 +00:00
|
|
|
%global devlibx_version 0.1.0
|
|
|
|
# Unimportant rank mismatch issues that otherwise cause builds to fail for GCC >= 10
|
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%global extra_gfortran_flags -fallow-argument-mismatch
|
|
|
|
%else
|
|
|
|
%global extra_gfortran_flags %{nil}
|
|
|
|
%endif
|
|
|
|
# We need to turn off "-Werror=return-type" in optflags to avoid build failures
|
|
|
|
%global optflags %(echo "%{optflags}" | sed "s/ -Werror=return-type//")
|
2020-01-17 20:45:07 +00:00
|
|
|
Name: %{package_name}
|
2021-11-22 08:49:13 +00:00
|
|
|
Version: 6.8
|
2014-04-30 17:05:39 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: A suite for electronic-structure calculations and materials modeling
|
2019-11-05 09:45:02 +00:00
|
|
|
License: GPL-2.0-only
|
2014-04-30 17:05:39 +00:00
|
|
|
Group: Productivity/Scientific/Physics
|
2020-01-29 15:00:21 +00:00
|
|
|
URL: http://www.quantum-espresso.org
|
2019-11-07 10:46:51 +00:00
|
|
|
Source0: https://gitlab.com/QEF/q-e/-/archive/qe-%{version}/q-e-qe-%{version}.tar.bz2
|
2021-11-22 08:49:13 +00:00
|
|
|
Source1: https://gitlab.com/max-centre/components/devicexlib/-/archive/%{devlibx_version}/devicexlib-%{devlibx_version}.tar.gz
|
2022-09-03 11:14:03 +00:00
|
|
|
Source2: %{pname}-rpmlintrc
|
2021-11-22 08:49:13 +00:00
|
|
|
# PATCH-FEATURE-OPENSUSE quantum-espresso-devxlib-no-download.patch badshah400@gmail.com -- Do not try to download devxlib, use SOURCE1 instead.
|
|
|
|
Patch1: quantum-espresso-devxlib-no-download.patch
|
|
|
|
BuildRequires: blas-devel
|
2014-04-30 17:05:39 +00:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: gcc-fortran
|
|
|
|
BuildRequires: lapack-devel
|
2020-01-17 20:45:07 +00:00
|
|
|
%if %{with mpi}
|
|
|
|
BuildRequires: %{mpi_flavor}%{?mpi_ext}-devel
|
|
|
|
BuildRequires: fftw3-mpi-devel
|
2021-11-22 08:49:13 +00:00
|
|
|
BuildRequires: libscalapack2-%{mpi_flavor}%{?mpi_ext}-devel
|
2020-01-17 20:45:07 +00:00
|
|
|
%else
|
|
|
|
BuildRequires: fftw3-devel
|
2014-04-30 17:05:39 +00:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%description
|
|
|
|
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.
|
|
|
|
|
|
|
|
%package doc
|
|
|
|
Summary: Documentation files for Quantum Espresso
|
|
|
|
Group: Documentation/Other
|
|
|
|
|
|
|
|
%description doc
|
|
|
|
This package contains the documentation files for Quantum Espresso.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
%prep
|
2019-11-07 10:46:51 +00:00
|
|
|
%autosetup -p1 -n q-e-qe-%{version}
|
2021-11-22 08:49:13 +00:00
|
|
|
cp %{SOURCE1} ./external/devxlib/devxlib.tar.gz
|
|
|
|
# Need to pass -D__FFTW, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=980677
|
|
|
|
# Error: Symbol 'cft_2xy' at (1) has no IMPLICIT type
|
|
|
|
sed -i 's|MANUAL_DFLAGS =|MANUAL_DFLAGS = -D__FFTW %{extra_gfortran_flags}|' install/make.inc.in
|
2014-04-30 17:05:39 +00:00
|
|
|
|
|
|
|
%build
|
2021-11-22 08:49:13 +00:00
|
|
|
# Note: optflags should not be passed to fortran flags as they cause build failures
|
2020-01-17 20:45:07 +00:00
|
|
|
%if %{with mpi}
|
|
|
|
export CC="%{my_bindir}/mpicc"
|
2021-11-22 08:49:13 +00:00
|
|
|
export CFLAGS='%{extra_gfortran_flags} %{optflags}'
|
2020-01-17 20:45:07 +00:00
|
|
|
export FC="%{my_bindir}/mpif90"
|
2021-11-22 08:49:13 +00:00
|
|
|
export FCFLAGS='%{extra_gfortran_flags}'
|
|
|
|
export FFLAGS='%{extra_gfortran_flags}'
|
|
|
|
export BLAS_LIBS="-L%{_libdir} -lblas"
|
|
|
|
export LAPACK_LIBS="-L%{_libdir} -llapack"
|
|
|
|
export FFT_LIBS="-L%{_libdir} -lfftw3_mpi"
|
|
|
|
export SCALAPACK_LIBS="-L%{my_libdir} -lscalapack"
|
2014-04-30 17:05:39 +00:00
|
|
|
%configure --enable-parallel
|
2020-01-17 20:45:07 +00:00
|
|
|
%else
|
|
|
|
export CC=gcc
|
2021-11-22 08:49:13 +00:00
|
|
|
export CFLAGS='%{extra_gfortran_flags} %{optflags}'
|
2020-01-17 20:45:07 +00:00
|
|
|
export FC=gfortran
|
2021-11-22 08:49:13 +00:00
|
|
|
export FCFLAGS='%{extra_gfortran_flags}'
|
|
|
|
export FFLAGS='%{extra_gfortran_flags}'
|
|
|
|
export BLAS_LIBS="-L%{_libdir} -lblas"
|
|
|
|
export LAPACK_LIBS="-L%{_libdir} -llapack"
|
|
|
|
export FFT_LIBS="-lfftw3"
|
2020-01-17 20:45:07 +00:00
|
|
|
%configure --disable-parallel
|
|
|
|
%endif
|
2022-09-03 11:14:03 +00:00
|
|
|
%make_build -j1 all
|
2014-04-30 17:05:39 +00:00
|
|
|
|
|
|
|
%install
|
2020-01-17 20:45:07 +00:00
|
|
|
mkdir -p %{buildroot}%{my_bindir}
|
|
|
|
pushd bin
|
2014-04-30 17:05:39 +00:00
|
|
|
for bin in *.x; do
|
2020-01-17 20:45:07 +00:00
|
|
|
install -m 755 $bin %{buildroot}%{my_bindir}/qe_$bin
|
2014-04-30 17:05:39 +00:00
|
|
|
done
|
2020-01-17 20:45:07 +00:00
|
|
|
popd
|
2014-04-30 17:05:39 +00:00
|
|
|
|
2014-05-02 19:32:37 +00:00
|
|
|
%fdupes -s Doc/
|
2014-04-30 17:05:39 +00:00
|
|
|
|
|
|
|
%files
|
2019-11-07 10:46:51 +00:00
|
|
|
%doc README.md
|
|
|
|
%license License
|
2020-01-17 20:45:07 +00:00
|
|
|
%{my_bindir}/*.x
|
2014-04-30 17:05:39 +00:00
|
|
|
|
2020-01-17 20:45:07 +00:00
|
|
|
%if %{without mpi}
|
2014-04-30 17:05:39 +00:00
|
|
|
%files doc
|
|
|
|
%doc Doc/*
|
2020-01-17 20:45:07 +00:00
|
|
|
%endif
|
2014-04-30 17:05:39 +00:00
|
|
|
|
|
|
|
%changelog
|