9322b7e
%global soname 2
9322b7e
9322b7e
Name:    xcfun
9322b7e
Version: 2.1.1
8005d1e
Release: 4%{?dist}
9322b7e
Summary: A library of approximate exchange-correlation functionals
9322b7e
License: MPLv2.0
9322b7e
URL:     https://xcfun.readthedocs.io
9322b7e
Source0: https://github.com/dftlibs/xcfun/archive/v%{version}/%{name}-%{version}.tar.gz
9322b7e
8005d1e
# Patch out potential array overflow
8005d1e
Patch0:  https://github.com/dftlibs/xcfun/pull/154.patch
8005d1e
# Fix build on 32-bit architectures
8005d1e
Patch1:  https://github.com/dftlibs/xcfun/pull/155.patch
7c914b6
9322b7e
BuildRequires: cmake
9322b7e
BuildRequires: gcc-c++
9322b7e
BuildRequires: gcc-gfortran
9322b7e
BuildRequires: make
9322b7e
BuildRequires: python3-devel
9322b7e
BuildRequires: pybind11-devel
9322b7e
9322b7e
# For tests
9322b7e
BuildRequires: python3-numpy
9322b7e
BuildRequires: python3-pytest
9322b7e
9322b7e
%description
9322b7e
XCFun is a library of approximate exchange-correlation functionals,
9322b7e
used in the Density Functional Theory description of electronic
9322b7e
structure. Because XCFun is based on automatic differentiation the
9322b7e
library can provide arbitrary order derivatives of all supported
9322b7e
functionals. Only the exchange-correlation energy expression needs to
9322b7e
be implemented, which is a huge gain in productivity (and also
9322b7e
efficiency). For this reason the library is very well suited for high
9322b7e
order time dependent DFT or for the development of new functionals.
9322b7e
9322b7e
%package devel
9322b7e
Summary:  Development headers and libraries for XCFun
9322b7e
Requires: %{name}%{?_isa} = %{version}-%{release}
9322b7e
# For dir ownership
9322b7e
Requires: cmake
9322b7e
9322b7e
%description devel
9322b7e
XCFun is a library of approximate exchange-correlation functionals,
9322b7e
used in the Density Functional Theory description of electronic
9322b7e
structure. Because XCFun is based on automatic differentiation the
9322b7e
library can provide arbitrary order derivatives of all supported
9322b7e
functionals. Only the exchange-correlation energy expression needs to
9322b7e
be implemented, which is a huge gain in productivity (and also
9322b7e
efficiency). For this reason the library is very well suited for high
9322b7e
order time dependent DFT or for the development of new functionals.
9322b7e
9322b7e
This package contains the development headers and libraries necessary
9322b7e
to compile code against XCFun.
9322b7e
9322b7e
%package -n python3-xcfun
9322b7e
Summary:  Python bindings for XCFun
9322b7e
9322b7e
%description -n python3-xcfun
9322b7e
XCFun is a library of approximate exchange-correlation functionals,
9322b7e
used in the Density Functional Theory description of electronic
9322b7e
structure. Because XCFun is based on automatic differentiation the
9322b7e
library can provide arbitrary order derivatives of all supported
9322b7e
functionals. Only the exchange-correlation energy expression needs to
9322b7e
be implemented, which is a huge gain in productivity (and also
9322b7e
efficiency). For this reason the library is very well suited for high
9322b7e
order time dependent DFT or for the development of new functionals.
9322b7e
9322b7e
This package contains the Python bindings for XCFun.
9322b7e
9322b7e
%prep
9322b7e
%setup -q
8005d1e
%patch0 -p1 -b .overflow
8005d1e
%patch1 -p1 -b .32bit
9322b7e
9322b7e
%build
9322b7e
%cmake -B %{_host} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIB=%{_lib} -DXCFUN_PYTHON_INTERFACE=ON -DPYMOD_INSTALL_LIBDIR=../../%{python3_sitearch}
9322b7e
%make_build -C %{_host}
9322b7e
9322b7e
%install
9322b7e
%make_install -C %{_host}
9322b7e
# Fix test permissions
9322b7e
chmod u=rwX,og=rX -R %{buildroot}%{python3_sitearch}/xcfun/tests
9322b7e
9322b7e
%check
9322b7e
cd %{_host}
9322b7e
ctest --output-on-failure
9322b7e
9322b7e
%files
9322b7e
%license LICENSE.md
9322b7e
%doc CHANGELOG.md README.md
9322b7e
%{_libdir}/libxcfun.so.%{soname}*
9322b7e
9322b7e
%files devel
9322b7e
%{_datadir}/cmake/XCFun/
9322b7e
%{_includedir}/XCFun/
9322b7e
%{_libdir}/libxcfun.so
9322b7e
9322b7e
%files -n python3-xcfun
9322b7e
%{python3_sitearch}/xcfun
9322b7e
9322b7e
%changelog
8005d1e
* Wed Sep 08 2021 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.1-5
8005d1e
- Patches to fix 32-bit builds and potential array overflow.
8005d1e
7c914b6
* Fri Jul 30 2021 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.1-4
7c914b6
- Disable 32-bit architectures which are not supported by xcfun.
7c914b6
fda7035
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-3
fda7035
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
fda7035
9322b7e
* Sat May 22 2021 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.1-2
9322b7e
- Review fixes
9322b7e
9322b7e
* Mon May 17 2021 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.1-1
9322b7e
- First release