Compare commits

...
Sign in to create a new pull request.

28 commits

Author SHA1 Message Date
Python Maint
67c0b404c0 Rebuilt for Python 3.15.0b4 ABI change 2026-07-22 10:16:04 +02:00
Fedora Release Engineering
bd8b82d8d6 Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild 2026-07-17 09:03:47 +00:00
Python Maint
dea6f69ef2 Rebuilt for Python 3.15 2026-06-08 14:56:21 +02:00
Cristian Le
7c374e66da Use standard CMake macros (rhbz#2381159) 2026-06-05 17:30:58 +02:00
Python Maint
36d995e7e2 Rebuilt for Python 3.15 2026-06-04 00:10:47 +02:00
Fedora Release Engineering
1076c288fd Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild 2026-01-17 20:30:21 +00:00
Python Maint
a321fa75bf Rebuilt for Python 3.14.0rc3 bytecode 2025-09-19 15:03:46 +02:00
Python Maint
b64313e318 Rebuilt for Python 3.14.0rc2 bytecode 2025-08-15 15:23:13 +02:00
Fedora Release Engineering
b96493e560 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-25 20:40:41 +00:00
Python Maint
48e67ede5a Rebuilt for Python 3.14 2025-06-03 12:32:25 +02:00
Fedora Release Engineering
e53f9f4a21 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-19 15:31:42 +00:00
Sandro
ec30d0ce06
Revert to uniform patch syntax for all branches
The old syntax no longer works in rawhide:

error: %patchN is obsolete, use %patch N (or %patch -P N):
       %patch0 -p1 -b .overflow

This, in fact, reverts ccc7c8f and de8ae88.
2024-10-31 18:17:26 +01:00
ccc7c8f9ed Adjust patch style for epel 2024-10-17 08:16:08 +00:00
Fedora Release Engineering
4136101b52 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-20 09:48:14 +00:00
de8ae8807c Need to modernize patch syntax to fix build failure on rawhide 2024-06-20 10:03:55 +00:00
Python Maint
5c9145326d Rebuilt for Python 3.13 2024-06-08 08:11:50 +02:00
Software Management Team
02c69a6461 Eliminate use of obsolete %patchN syntax (#2283636) 2024-05-30 12:46:50 +02:00
Miroslav Suchý
ec0970c493 convert MPLv2.0 license to SPDX
This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4
2024-04-13 10:32:30 +02:00
Fedora Release Engineering
d9a19e1d71 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-27 09:24:38 +00:00
Fedora Release Engineering
a3075d4eef Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-22 18:36:10 +00:00
Python Maint
75e8bc3359 Rebuilt for Python 3.12 2023-06-13 23:06:42 +02:00
Fedora Release Engineering
6c5f39dac9 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-21 07:13:56 +00:00
Fedora Release Engineering
a2dec42291 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-23 12:52:18 +00:00
Python Maint
63af3536b6 Rebuilt for Python 3.11 2022-06-13 18:58:06 +02:00
Fedora Release Engineering
1d591ecac9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-22 04:52:53 +00:00
8005d1ec9a Fix 32-bit builds and potential array overflow 2021-09-08 11:48:41 +00:00
7c914b6815 Disable 32-bit architectures since builds fail 2021-07-30 19:42:38 +00:00
Fedora Release Engineering
fda70359e1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-23 21:21:13 +00:00
3 changed files with 211 additions and 8 deletions

53
154.patch Normal file
View file

@ -0,0 +1,53 @@
From 5d37981978494681a6e55224ac6e6f765eb59edb Mon Sep 17 00:00:00 2001
From: Roberto Di Remigio <roberto.diremigio@gmail.com>
Date: Mon, 23 Aug 2021 08:23:23 +0200
Subject: [PATCH] Always use a temporary of large enough size
Should fix #151
---
src/functionals/brx.cpp | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/functionals/brx.cpp b/src/functionals/brx.cpp
index 260a0ed..acaaafc 100644
--- a/src/functionals/brx.cpp
+++ b/src/functionals/brx.cpp
@@ -50,11 +50,15 @@ static double BR(double z) {
// Obtain the Taylor expansion of x(y), which is the
// inverse of BR_y. Use linear method for simplicity.
template <typename T, int Ndeg>
-void BR_taylor(const T & z0, taylor<T, 1, Ndeg> & t) {
- taylor<T, 1, Ndeg> f, d;
+taylor <T, 1, Ndeg> BR_taylor(const T & z0) {
+ static_assert(Ndeg >= 3);
+
+ taylor<T, 1, Ndeg> t;
t = 0;
t[0] = BR(z0);
t[1] = 1;
+
+ taylor<T, 1, Ndeg> f;
f = BR_z(t);
t[1] = 1 / f[1];
// Linear method, for quadratic see i.e. Brent & Kung ~197x
@@ -62,6 +66,8 @@ void BR_taylor(const T & z0, taylor<T, 1, Ndeg> & t) {
f = BR_z(t);
t[i] = -f[i] * t[1];
}
+
+ return t;
}
/* This is a fully differentiable solver for Eq.(21) in
@@ -70,8 +76,9 @@ void BR_taylor(const T & z0, taylor<T, 1, Ndeg> & t) {
*/
template <typename T, int Nvar>
static ctaylor<T, Nvar> BR(const ctaylor<T, Nvar> & t) {
- taylor<T, 1, Nvar> tmp;
- BR_taylor(t.c[0], tmp);
+ // temporary has dimension 3 at least. See: https://github.com/dftlibs/xcfun/issues/151
+ // in C++14 and later can use std::max(Nvar, 3) for the second template argument
+ auto tmp = BR_taylor<T, (Nvar >= 3) ? Nvar : 3>(t.c[0]);
ctaylor<T, Nvar> res = tmp[0];
for (int i = 1; i <= Nvar; i++)

70
155.patch Normal file
View file

@ -0,0 +1,70 @@
From 1c03a9078b8ed2d47be36db6f0d3b8c0d9ba9ddd Mon Sep 17 00:00:00 2001
From: Roberto Di Remigio <robertodr@users.noreply.github.com>
Date: Wed, 8 Sep 2021 10:32:00 +0200
Subject: [PATCH 1/3] Patch py::array_t CTOR usage
---
python/export_xcfun.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/python/export_xcfun.cpp b/python/export_xcfun.cpp
index df5631a..7004299 100644
--- a/python/export_xcfun.cpp
+++ b/python/export_xcfun.cpp
@@ -141,8 +141,7 @@ PYBIND11_MODULE(_xcfun, m) {
}
auto nr_points = density.shape(0);
auto output =
- py::array_t<double, py::array::c_style | py::array::forcecast>(
- {{nr_points, output_len}});
+ py::array_t<double, py::array::c_style | py::array::forcecast>({nr_points, output_len});
if (dens_ndim == 1) {
xcfun::xcfun_eval(fun, density.data(), output.mutable_data());
From ee56726019aa57ab104b3a5cc73967db0ab528f3 Mon Sep 17 00:00:00 2001
From: Roberto Di Remigio <robertodr@users.noreply.github.com>
Date: Wed, 8 Sep 2021 10:54:45 +0200
Subject: [PATCH 2/3] Use correct CTOR
We want to use this one: https://github.com/pybind/pybind11/blob/v2.7.1/include/pybind11/numpy.h#L876
---
python/export_xcfun.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/python/export_xcfun.cpp b/python/export_xcfun.cpp
index 7004299..37fdb92 100644
--- a/python/export_xcfun.cpp
+++ b/python/export_xcfun.cpp
@@ -141,7 +141,7 @@ PYBIND11_MODULE(_xcfun, m) {
}
auto nr_points = density.shape(0);
auto output =
- py::array_t<double, py::array::c_style | py::array::forcecast>({nr_points, output_len});
+ py::array_t<double, py::array::c_style | py::array::forcecast>({nr_points, output_len}, nullptr);
if (dens_ndim == 1) {
xcfun::xcfun_eval(fun, density.data(), output.mutable_data());
From 30c3846671696b585ec16fffac6f9579a81ccedd Mon Sep 17 00:00:00 2001
From: Roberto Di Remigio <robertodr@users.noreply.github.com>
Date: Wed, 8 Sep 2021 11:06:53 +0200
Subject: [PATCH 3/3] Finagling with the CTOR
---
python/export_xcfun.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/python/export_xcfun.cpp b/python/export_xcfun.cpp
index 37fdb92..9b74df2 100644
--- a/python/export_xcfun.cpp
+++ b/python/export_xcfun.cpp
@@ -141,7 +141,7 @@ PYBIND11_MODULE(_xcfun, m) {
}
auto nr_points = density.shape(0);
auto output =
- py::array_t<double, py::array::c_style | py::array::forcecast>({nr_points, output_len}, nullptr);
+ py::array_t<double, py::array::c_style | py::array::forcecast>({{nr_points, output_len}}, nullptr);
if (dens_ndim == 1) {
xcfun::xcfun_eval(fun, density.data(), output.mutable_data());

View file

@ -2,16 +2,20 @@
Name: xcfun
Version: 2.1.1
Release: 2%{?dist}
Release: 26%{?dist}
Summary: A library of approximate exchange-correlation functionals
License: MPLv2.0
License: MPL-2.0
URL: https://xcfun.readthedocs.io
Source0: https://github.com/dftlibs/xcfun/archive/v%{version}/%{name}-%{version}.tar.gz
# Patch out potential array overflow
Patch0: https://github.com/dftlibs/xcfun/pull/154.patch
# Fix build on 32-bit architectures
Patch1: https://github.com/dftlibs/xcfun/pull/155.patch
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: gcc-gfortran
BuildRequires: make
BuildRequires: python3-devel
BuildRequires: pybind11-devel
@ -65,19 +69,20 @@ This package contains the Python bindings for XCFun.
%prep
%setup -q
%patch -P0 -p1 -b .overflow
%patch -P1 -p1 -b .32bit
%build
%cmake -B %{_host} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIB=%{_lib} -DXCFUN_PYTHON_INTERFACE=ON -DPYMOD_INSTALL_LIBDIR=../../%{python3_sitearch}
%make_build -C %{_host}
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIB=%{_lib} -DXCFUN_PYTHON_INTERFACE=ON -DPYMOD_INSTALL_LIBDIR=../../%{python3_sitearch}
%cmake_build
%install
%make_install -C %{_host}
%cmake_install
# Fix test permissions
chmod u=rwX,og=rX -R %{buildroot}%{python3_sitearch}/xcfun/tests
%check
cd %{_host}
ctest --output-on-failure
%ctest
%files
%license LICENSE.md
@ -93,6 +98,81 @@ ctest --output-on-failure
%{python3_sitearch}/xcfun
%changelog
* Wed Jul 22 2026 Python Maint <python-maint@redhat.com> - 2.1.1-26
- Rebuilt for Python 3.15.0b4 ABI change
* Fri Jul 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
* Mon Jun 08 2026 Python Maint <python-maint@redhat.com> - 2.1.1-24
- Rebuilt for Python 3.15
* Fri Jun 05 2026 Cristian Le <git@lecris.dev> - 2.1.1-23
- Use standard CMake macros (rhbz#2381159)
* Wed Jun 03 2026 Python Maint <python-maint@redhat.com> - 2.1.1-22
- Rebuilt for Python 3.15
* Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
* Fri Sep 19 2025 Python Maint <python-maint@redhat.com> - 2.1.1-20
- Rebuilt for Python 3.14.0rc3 bytecode
* Fri Aug 15 2025 Python Maint <python-maint@redhat.com> - 2.1.1-19
- Rebuilt for Python 3.14.0rc2 bytecode
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Tue Jun 03 2025 Python Maint <python-maint@redhat.com> - 2.1.1-17
- Rebuilt for Python 3.14
* Sun Jan 19 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Thu Jun 20 2024 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.1-14
- Modernize patch syntax.
* Sat Jun 08 2024 Python Maint <python-maint@redhat.com> - 2.1.1-13
- Rebuilt for Python 3.13
* Sat Apr 13 2024 Miroslav Suchý <msuchy@redhat.com> - 2.1.1-12
- convert license to SPDX
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 2.1.1-9
- Rebuilt for Python 3.12
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 2.1.1-6
- Rebuilt for Python 3.11
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Sep 08 2021 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.1-5
- Patches to fix 32-bit builds and potential array overflow.
* Fri Jul 30 2021 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.1-4
- Disable 32-bit architectures which are not supported by xcfun.
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Sat May 22 2021 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.1-2
- Review fixes