user [email protected]
usertags 1133593 python3.15
tags 1133593 patch
thanks
Hi!
While rebuilding the python related packages against the Python 3.15rc2
version I ran into this bug [1].
In order to get openbabel to build, I had to apply several changes:
- Get rid of deprecated allocate (removed in c++20)
- Apply the changes proposed in pr#2858 [2] (same as for the Debian
bug #1136307, which was only uploaded to experimental)
- Use guess-concurrency, limit openmp threads to 1 (the work is
already parallelized)
- Disable the test/testdistgeom.py test, as it requires too much
memory and causes the build machines to crash. It was already
disabled in amd64.
I've applied these fixes in the sandbox [3] to verify that it builds
successfully, these should be applied in Debian to get the package back
to a healthy state.
Happy hacking,
[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4290363/
[2]: https://github.com/openbabel/openbabel/pull/2858
[3]: https://debusine.debian.net/debian/r-python-python3.15/
--
"Can you imagine what I would do if I could do all I can?" -- Sun Tzu
Saludos /\/\ /\ >< `/
diff -Nru openbabel-3.1.1+dfsg/debian/changelog
openbabel-3.1.1+dfsg/debian/changelog
--- openbabel-3.1.1+dfsg/debian/changelog 2025-10-06 12:45:00.000000000
+0200
+++ openbabel-3.1.1+dfsg/debian/changelog 2026-09-08 12:07:44.000000000
+0200
@@ -1,3 +1,13 @@
+openbabel (3.1.1+dfsg-14.1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * Get rid of deprecated allocate (removed in c++20)
+ * Apply the changes proposed in pr#2858
+ * Use guess-concurrency, limit openmp threads to 1
+ * Disable the test/testdistgeom.py test
+
+ -- Maximiliano Curia <[email protected]> Tue, 08 Sep 2026 12:07:44 +0200
+
openbabel (3.1.1+dfsg-14) unstable; urgency=medium
* Team upload.
diff -Nru openbabel-3.1.1+dfsg/debian/control
openbabel-3.1.1+dfsg/debian/control
--- openbabel-3.1.1+dfsg/debian/control 2025-10-06 10:00:00.000000000 +0200
+++ openbabel-3.1.1+dfsg/debian/control 2026-09-08 12:07:44.000000000 +0200
@@ -7,6 +7,7 @@
Build-Depends: cmake,
debhelper-compat (= 13),
dh-python,
+ guess-concurrency,
doxygen,
ghostscript,
graphviz,
diff -Nru openbabel-3.1.1+dfsg/debian/patches/2858.patch
openbabel-3.1.1+dfsg/debian/patches/2858.patch
--- openbabel-3.1.1+dfsg/debian/patches/2858.patch 1970-01-01
01:00:00.000000000 +0100
+++ openbabel-3.1.1+dfsg/debian/patches/2858.patch 2026-09-08
12:07:44.000000000 +0200
@@ -0,0 +1,634 @@
+From 8014749a97bb77cd7753a78dc029f0766016d661 Mon Sep 17 00:00:00 2001
+From: Eisuke Kawashima <[email protected]>
+Date: Sat, 7 Jun 2025 16:34:30 +0900
+Subject: [PATCH 1/4] build!: drop eigen2
+
+---
+ CMakeLists.txt | 8 +---
+ cmake/modules/FindEigen2.cmake | 80 ----------------------------------
+ include/CMakeLists.txt | 2 +-
+ include/openbabel/distgeom.h | 2 +-
+ include/openbabel/forcefield.h | 2 +-
+ include/openbabel/plugin.h | 6 +--
+ scripts/CMakeLists.txt | 9 +---
+ scripts/openbabel-R.i | 4 +-
+ scripts/openbabel-java.i | 4 +-
+ scripts/openbabel-perl.i | 2 +-
+ scripts/openbabel-php.i | 4 +-
+ scripts/openbabel-python.i | 4 +-
+ scripts/openbabel-ruby.i | 2 +-
+ src/CMakeLists.txt | 8 ++--
+ src/charges/qeq.cpp | 12 +----
+ src/charges/qeq.h | 4 +-
+ src/charges/qtpie.cpp | 12 +----
+ src/charges/qtpie.h | 4 +-
+ src/distgeom.cpp | 2 +-
+ src/formats/formats.cmake | 2 +-
+ src/math/align.cpp | 12 -----
+ src/ops/gen3d.cpp | 2 +-
+ src/plugin.cpp | 6 +--
+ test/CMakeLists.txt | 2 +-
+ 24 files changed, 35 insertions(+), 160 deletions(-)
+ delete mode 100644 cmake/modules/FindEigen2.cmake
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -456,15 +456,13 @@
+ )
+
+ #cjh
+-find_package(Eigen3)
+-if(EIGEN3_FOUND)
+- add_definitions(-DHAVE_EIGEN -DHAVE_EIGEN3)
+- include_directories(${EIGEN3_INCLUDE_DIR})
++find_package(Eigen3 CONFIG)
++if(TARGET Eigen3::Eigen)
++ add_definitions(-DHAVE_EIGEN3)
+ else()
+- find_package(Eigen2) # find and setup Eigen2
+- if(EIGEN2_FOUND)
+- add_definitions (-DHAVE_EIGEN)
+- include_directories(${EIGEN2_INCLUDE_DIR})
++ find_package(Eigen3 MODULE)
++ if(TARGET Eigen3::Eigen)
++ add_definitions(-DHAVE_EIGEN3)
+ endif()
+ endif()
+ #cjh
+--- a/cmake/modules/FindEigen2.cmake
++++ /dev/null
+@@ -1,80 +0,0 @@
+-# - Try to find Eigen2 lib
+-#
+-# This module supports requiring a minimum version, e.g. you can do
+-# find_package(Eigen2 2.0.3)
+-# to require version 2.0.3 to newer of Eigen2.
+-#
+-# Once done this will define
+-#
+-# EIGEN2_FOUND - system has eigen lib with correct version
+-# EIGEN2_INCLUDE_DIR - the eigen include directory
+-# EIGEN2_VERSION - eigen version
+-
+-# Copyright (c) 2006, 2007 Montel Laurent, <[email protected]>
+-# Copyright (c) 2008, 2009 Gael Guennebaud, <[email protected]>
+-# Redistribution and use is allowed according to the terms of the BSD license.
+-
+-if(NOT Eigen2_FIND_VERSION)
+- if(NOT Eigen2_FIND_VERSION_MAJOR)
+- set(Eigen2_FIND_VERSION_MAJOR 2)
+- endif(NOT Eigen2_FIND_VERSION_MAJOR)
+- if(NOT Eigen2_FIND_VERSION_MINOR)
+- set(Eigen2_FIND_VERSION_MINOR 0)
+- endif(NOT Eigen2_FIND_VERSION_MINOR)
+- if(NOT Eigen2_FIND_VERSION_PATCH)
+- set(Eigen2_FIND_VERSION_PATCH 0)
+- endif(NOT Eigen2_FIND_VERSION_PATCH)
+-
+- set(Eigen2_FIND_VERSION
"${Eigen2_FIND_VERSION_MAJOR}.${Eigen2_FIND_VERSION_MINOR}.${Eigen2_FIND_VERSION_PATCH}")
+-endif(NOT Eigen2_FIND_VERSION)
+-
+-macro(_eigen2_check_version)
+- file(READ "${EIGEN2_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h"
_eigen2_version_header)
+-
+- string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)"
_eigen2_world_version_match "${_eigen2_version_header}")
+- set(EIGEN2_WORLD_VERSION "${CMAKE_MATCH_1}")
+- string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)"
_eigen2_major_version_match "${_eigen2_version_header}")
+- set(EIGEN2_MAJOR_VERSION "${CMAKE_MATCH_1}")
+- string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)"
_eigen2_minor_version_match "${_eigen2_version_header}")
+- set(EIGEN2_MINOR_VERSION "${CMAKE_MATCH_1}")
+-
+- set(EIGEN2_VERSION
${EIGEN2_WORLD_VERSION}.${EIGEN2_MAJOR_VERSION}.${EIGEN2_MINOR_VERSION})
+- if(${EIGEN2_VERSION} VERSION_LESS ${Eigen2_FIND_VERSION})
+- set(EIGEN2_VERSION_OK FALSE)
+- else(${EIGEN2_VERSION} VERSION_LESS ${Eigen2_FIND_VERSION})
+- set(EIGEN2_VERSION_OK TRUE)
+- endif(${EIGEN2_VERSION} VERSION_LESS ${Eigen2_FIND_VERSION})
+-
+- if(NOT EIGEN2_VERSION_OK)
+-
+- message(STATUS "Eigen2 version ${EIGEN2_VERSION} found in
${EIGEN2_INCLUDE_DIR}, "
+- "but at least version ${Eigen2_FIND_VERSION} is required")
+- endif(NOT EIGEN2_VERSION_OK)
+-endmacro(_eigen2_check_version)
+-
+-if (EIGEN2_INCLUDE_DIR)
+-
+- # in cache already
+- _eigen2_check_version()
+- set(EIGEN2_FOUND ${EIGEN2_VERSION_OK})
+-
+-else (EIGEN2_INCLUDE_DIR)
+-
+-find_path(EIGEN2_INCLUDE_DIR NAMES Eigen/Core
+- PATHS
+- ${INCLUDE_INSTALL_DIR}
+- ${KDE4_INCLUDE_DIR}
+- PATH_SUFFIXES eigen2
+- )
+-
+-if(EIGEN2_INCLUDE_DIR)
+- _eigen2_check_version()
+-endif(EIGEN2_INCLUDE_DIR)
+-
+-include(FindPackageHandleStandardArgs)
+-find_package_handle_standard_args(Eigen2 DEFAULT_MSG EIGEN2_INCLUDE_DIR
EIGEN2_VERSION_OK)
+-
+-mark_as_advanced(EIGEN2_INCLUDE_DIR)
+-
+-endif(EIGEN2_INCLUDE_DIR)
+-
+--- a/include/CMakeLists.txt
++++ b/include/CMakeLists.txt
+@@ -13,7 +13,7 @@
+ install(FILES ${math_headers} DESTINATION
${OB_INCLUDE_DIRS}/openbabel/math)
+ install(FILES ${stereo_headers} DESTINATION
${OB_INCLUDE_DIRS}/openbabel/stereo)
+ install(FILES ${depict_headers} DESTINATION
${OB_INCLUDE_DIRS}/openbabel/depict)
+-if(EIGEN2_FOUND OR EIGEN3_FOUND)
++if(TARGET Eigen3::Eigen)
+ install(FILES LBFGS.h DESTINATION ${OB_INCLUDE_DIRS})
+ install(FILES ${lbfgs_headers} DESTINATION ${OB_INCLUDE_DIRS}/LBFGS)
+ endif()
+--- a/include/openbabel/distgeom.h
++++ b/include/openbabel/distgeom.h
+@@ -29,7 +29,7 @@
+ #define OBAPI
+ #endif
+
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+
+ #include <Eigen/Core>
+ #include <LBFGS.h>
+--- a/include/openbabel/forcefield.h
++++ b/include/openbabel/forcefield.h
+@@ -1188,7 +1188,7 @@
+ */
+ int FastRotorSearch(bool permute = true);
+
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+ //! \since version 2.4
+ int DiverseConfGen(double rmsd, unsigned int nconfs = 0, double
energy_gap = 50, bool verbose = false);
+ #endif
+--- a/include/openbabel/plugin.h
++++ b/include/openbabel/plugin.h
+@@ -570,7 +570,7 @@
+ #ifdef HAVE_STATIC_INCHI
+ OB_STATIC_PLUGIN(OpUnique, theOpUnique)
+ #endif
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+ OB_STATIC_PLUGIN(OpConformer, theOpConformer)
+ #endif
+
+@@ -579,11 +579,9 @@
+ OB_STATIC_PLUGIN(MMFF94Charges, theMMFF94Charges)
+ OB_STATIC_PLUGIN(NoCharges, theNoCharges)
+ OB_STATIC_PLUGIN(FromFileCharges, theFromFileCharges)
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+ OB_STATIC_PLUGIN(QEqCharges, theQEqCharges)
+ OB_STATIC_PLUGIN(QTPIECharges, theQTPIECharges)
+-#endif
+-#ifdef HAVE_EIGEN3
+ OB_STATIC_PLUGIN(EQEqCharges, theEQEqCharges)
+ #endif
+ OBAPI std::vector<std::string> EnableStaticPlugins();
+--- a/scripts/CMakeLists.txt
++++ b/scripts/CMakeLists.txt
+@@ -18,18 +18,8 @@
+ endif (RUN_SWIG)
+
+ # The following needs to be kept in synch with ..\CMakeLists.txt
+-if(EIGEN3_FOUND)
+- set (eigen_define "-DHAVE_EIGEN" "-DHAVE_EIGEN3")
+- include_directories(${EIGEN3_INCLUDE_DIR})
+- set (CPPFLAGS_VALUE "-I${EIGEN3_INCLUDE_DIR}")
+- set (CPPFLAGS_TEXT "CPPFLAGS=${CPPFLAGS_VALUE}")
+-else()
+- if(EIGEN2_FOUND)
+- set (eigen_define "-DHAVE_EIGEN")
+- include_directories(${EIGEN2_INCLUDE_DIR})
+- set (CPPFLAGS_VALUE "-I${EIGEN2_INCLUDE_DIR}")
+- set (CPPFLAGS_TEXT "CPPFLAGS=${CPPFLAGS_VALUE}")
+- endif()
++if(TARGET Eigen3::Eigen)
++ set (eigen_define "-DHAVE_EIGEN3")
+ endif()
+
+ ###################
+--- a/scripts/openbabel-R.i
++++ b/scripts/openbabel-R.i
+@@ -62,7 +62,7 @@
+ %}
+
+
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+ %{
+ #include <openbabel/forcefield.h>
+ #include <openbabel/conformersearch.h>
+@@ -368,7 +368,7 @@
+ %ignore OpenBabel::Swab;
+ %include <openbabel/rotamer.h>
+ %include <openbabel/spectrophore.h>
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+
+ // Ignore shadowed methods
+ %ignore OpenBabel::OBForceField::VectorSubtract(const double *const, const
double *const, double *);
+--- a/scripts/openbabel-java.i
++++ b/scripts/openbabel-java.i
+@@ -62,7 +62,7 @@
+ #include <openbabel/obiter.h>
+ %}
+
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+ %{
+ #include <openbabel/conformersearch.h>
+ #include <openbabel/math/align.h>
+@@ -308,7 +308,7 @@
+ %ignore OpenBabel::OBDescriptor::LessThan;
+ %include <openbabel/descriptor.h>
+
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+ %include <openbabel/conformersearch.h>
+ %include <openbabel/math/align.h>
+ #else
+--- a/scripts/openbabel-perl.i
++++ b/scripts/openbabel-perl.i
+@@ -218,7 +218,7 @@
+ // %include <openbabel/fingerprint.h> // Causes an error (I do not know why)
+ %include <openbabel/descriptor.h>
+
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+ %include <openbabel/conformersearch.h>
+ %include <openbabel/math/align.h>
+ #else
+--- a/scripts/openbabel-php.i
++++ b/scripts/openbabel-php.i
+@@ -56,7 +56,7 @@
+ #include <openbabel/obiter.h>
+ %}
+
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+ %{
+ #include <openbabel/conformersearch.h>
+ #include <openbabel/math/align.h>
+@@ -285,7 +285,7 @@
+ %include <openbabel/rotamer.h>
+ %include <openbabel/spectrophore.h>
+
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+ %include <openbabel/conformersearch.h>
+ %include <openbabel/math/align.h>
+ #endif
+--- a/scripts/openbabel-python.i
++++ b/scripts/openbabel-python.i
+@@ -87,7 +87,7 @@
+ %ignore OpenBabel::OBMol::FindChildren(std::vector< OBAtom * > &, OBAtom *,
OBAtom *);
+ %ignore OpenBabel::OBResidue::GetAtoms;
+
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+ %{
+ #include <openbabel/conformersearch.h>
+ #include <openbabel/math/align.h>
+@@ -362,7 +362,7 @@
+ %ignore OpenBabel::Swab;
+ %include <openbabel/rotamer.h>
+ %include <openbabel/spectrophore.h>
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+ %include <openbabel/conformersearch.h>
+ %include <openbabel/math/align.h>
+ #endif
+--- a/scripts/openbabel-ruby.i
++++ b/scripts/openbabel-ruby.i
+@@ -243,7 +243,7 @@
+ // Ignore shadowed methods
+ %ignore OpenBabel::OBForceField::VectorSubtract(const double *const, const
double *const, double *);
+ %ignore OpenBabel::OBForceField::VectorMultiply(const double *const, const
double, double *);
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+ %{
+ #include <openbabel/conformersearch.h>
+ #include <openbabel/math/align.h>
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -15,7 +15,7 @@
+ charges/fromfile.cpp
+ )
+
+-if (EIGEN2_FOUND OR EIGEN3_FOUND)
++if (TARGET Eigen3::Eigen)
+ # if eigen is available, compile QEq, EQeq, and QTPIE charge models
+ set(charges ${charges}
+ charges/eqeq.cpp
+@@ -58,7 +58,7 @@
+ math/vector3.cpp
+ )
+
+-if(EIGEN2_FOUND OR EIGEN3_FOUND)
++if(TARGET Eigen3::Eigen)
+ set(math_srcs ${math_srcs}
+ math/align.cpp
+ )
+@@ -89,7 +89,7 @@
+ ops/ophighlight.cpp
+ ops/xout.cpp
+ )
+-if(EIGEN2_FOUND OR EIGEN3_FOUND)
++if(TARGET Eigen3::Eigen)
+ set(ops ${ops}
+ ops/conformer.cpp
+ ops/opalign.cpp
+@@ -163,7 +163,7 @@
+ typer.cpp
+ obmolecformat.cpp
+ )
+-if(EIGEN2_FOUND OR EIGEN3_FOUND)
++if(TARGET Eigen3::Eigen)
+ set(openbabel_srcs ${openbabel_srcs}
+ conformersearch.cpp
+ confsearch.cpp
+@@ -253,6 +253,9 @@
+ if(Boost_FOUND)
+ include_directories(${Boost_INCLUDE_DIRS})
+ endif()
++if(TARGET Eigen3::Eigen)
++ target_link_libraries(openbabel PUBLIC Eigen3::Eigen)
++endif()
+
+ if(BUILD_SHARED OR BUILD_MIXED)
+ set(THREADS_PREFER_PTHREAD_FLAG ON)
+--- a/src/charges/qeq.cpp
++++ b/src/charges/qeq.cpp
+@@ -16,7 +16,7 @@
+ GNU General Public License for more details.
+ ***********************************************************************/
+
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+
+ #include "qeq.h"
+ #include <openbabel/locale.h>
+@@ -309,12 +309,8 @@
+ bool QEqCharges::solver(Eigen::MatrixXd A, Eigen::VectorXd b,
Eigen::VectorXd &x, const double NormThreshold)
+ {
+ // using a LU factorization
+-#ifdef HAVE_EIGEN3
+ bool SolverOK = true;
+ x = A.partialPivLu().solve(b);
+-#else
+- bool SolverOK = A.lu().solve(b, &x);
+-#endif
+ //bool SolverOK = A.svd().solve(b, &x);
+
+ Eigen::VectorXd resid = A*x - b;
+@@ -332,11 +328,7 @@
+
+ obErrorLog.ThrowError(__FUNCTION__, msg.str(), obWarning);
+
+-#ifdef HAVE_EIGEN3
+ x = A.jacobiSvd().solve(b);
+-#else
+- SolverOK = A.svd().solve(b, &x);
+-#endif
+ resid = A*x - b;
+ resnorm = resid.norm();
+
+@@ -362,7 +354,7 @@
+
+ }//namespace
+
+-#endif //HAVE_EIGEN2
++#endif // HAVE_EIGEN3
+
+ //! \file qeq.cpp
+ //! \brief Assign QEq partial charges.
+--- a/src/charges/qeq.h
++++ b/src/charges/qeq.h
+@@ -24,7 +24,7 @@
+
+ #include <math.h>
+
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+
+ #include <Eigen/LU>
+ #include <Eigen/SVD>
+@@ -69,5 +69,5 @@
+ };
+
+ }; //namespace OpenBabel
+-#endif //HAVE_EIGEN
++#endif //HAVE_EIGEN3
+ #endif //__QEQ_H__
+--- a/src/charges/qtpie.cpp
++++ b/src/charges/qtpie.cpp
+@@ -16,7 +16,7 @@
+ GNU General Public License for more details.
+ ***********************************************************************/
+
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+
+ #include "qtpie.h"
+ #include <openbabel/locale.h>
+@@ -359,12 +359,8 @@
+ bool QTPIECharges::solver(Eigen::MatrixXd A, Eigen::VectorXd b,
Eigen::VectorXd &x, const double NormThreshold)
+ {
+ // using a LU factorization
+-#ifdef HAVE_EIGEN3
+ bool SolverOK = true;
+ x = A.partialPivLu().solve(b);
+-#else
+- bool SolverOK = A.lu().solve(b, &x);
+-#endif
+ //bool SolverOK = A.svd().solve(b, &x);
+
+ Eigen::VectorXd resid = A*x - b;
+@@ -382,11 +378,7 @@
+
+ obErrorLog.ThrowError(__FUNCTION__, msg.str(), obWarning);
+
+-#ifdef HAVE_EIGEN3
+ x = A.jacobiSvd().solve(b);
+-#else
+- SolverOK = A.svd().solve(b, &x);
+-#endif
+ resid = A*x - b;
+ resnorm = resid.norm();
+
+@@ -412,7 +404,7 @@
+
+ }//namespace
+
+-#endif //HAVE_EIGEN2
++#endif // HAVE_EIGEN3
+
+ //! \file qtpie.cpp
+ //! \brief Assign QTPIE partial charges.
+--- a/src/charges/qtpie.h
++++ b/src/charges/qtpie.h
+@@ -24,7 +24,7 @@
+
+ #include <math.h>
+
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+
+ #include <Eigen/LU>
+ #include <Eigen/SVD>
+@@ -74,5 +74,5 @@
+ void ParseParamFile();
+ };
+ }; //namespace OpenBabel
+-#endif //HAVE_EIGEN
++#endif //HAVE_EIGEN3
+ #endif //__QTPIE_H__
+--- a/src/distgeom.cpp
++++ b/src/distgeom.cpp
+@@ -17,7 +17,7 @@
+ GNU General Public License for more details.
+ ***********************************************************************/
+
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+
+ #include <openbabel/distgeom.h>
+ #include <openbabel/mol.h>
+--- a/src/formats/formats.cmake
++++ b/src/formats/formats.cmake
+@@ -21,7 +21,7 @@
+ )
+ set(painterformat_additional_sources ../depict/commandpainter.cpp)
+ set(asciiformat_additional_sources ../depict/asciipainter.cpp)
+-if(EIGEN2_FOUND OR EIGEN3_FOUND)
++if(TARGET Eigen3::Eigen)
+ set(formats_utility ${formats_utility}
+ confabreport
+ )
+--- a/src/math/align.cpp
++++ b/src/math/align.cpp
+@@ -193,11 +193,7 @@
+ SxzpSzx, SyzpSzy, SxypSyx, SyzmSzy,
+ SxzmSzx, SxymSyx, SxxpSyy, SxxmSyy;
+
+-#ifdef HAVE_EIGEN3
+ Eigen::MatrixXd M_sqr = M.array().square();
+-#else
+- Eigen::MatrixXd M_sqr = M.cwise().square();
+-#endif
+
+ Sxx = M(0, 0);
+ Sxy = M(1, 0);
+@@ -274,11 +270,7 @@
+ Eigen::Matrix3d C = _mref * mtarget.transpose();
+
+ // Singular Value Decomposition of C into USV(t)
+-#ifdef HAVE_EIGEN3
+ Eigen::JacobiSVD<Eigen::Matrix3d> svd(C, Eigen::ComputeFullU |
Eigen::ComputeFullV);
+-#else
+- Eigen::SVD<Eigen::Matrix3d> svd(C);
+-#endif
+
+ // Prepare matrix T
+ double sign = (C.determinant() > 0) ? 1. : -1.; // Sign of determinant
+@@ -292,11 +284,7 @@
+ _result = _rotMatrix.transpose() * mtarget;
+
+ Eigen::MatrixXd deviation = _result - _mref;
+-#ifdef HAVE_EIGEN3
+ Eigen::MatrixXd sqr = deviation.array().square();
+-#else
+- Eigen::MatrixXd sqr = deviation.cwise().square();
+-#endif
+ double sum = sqr.sum();
+ _rmsd = sqrt( sum / sqr.cols() );
+
+--- a/src/ops/gen3d.cpp
++++ b/src/ops/gen3d.cpp
+@@ -113,7 +113,7 @@
+ useDistGeom = true;
+ }
+
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+ OBDistanceGeometry dg;
+ if (useDistGeom) {
+ // use the bond lengths and angles if we ran the builder
+--- a/src/plugin.cpp
++++ b/src/plugin.cpp
+@@ -420,7 +420,7 @@
+
plugin_ids.push_back(reinterpret_cast<OBPlugin*>(&theOpReadConformers)->GetID());
+ plugin_ids.push_back(reinterpret_cast<OBPlugin*>(&theOpSort)->GetID());
+ plugin_ids.push_back(reinterpret_cast<OBPlugin*>(&theOpExtraOut)->GetID());
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+ plugin_ids.push_back(reinterpret_cast<OBPlugin*>(&theOpConformer)->GetID());
+ #endif
+ #ifdef HAVE_STATIC_INCHI
+@@ -432,11 +432,9 @@
+
plugin_ids.push_back(reinterpret_cast<OBPlugin*>(&theMMFF94Charges)->GetID());
+ plugin_ids.push_back(reinterpret_cast<OBPlugin*>(&theNoCharges)->GetID());
+
plugin_ids.push_back(reinterpret_cast<OBPlugin*>(&theFromFileCharges)->GetID());
+-#ifdef HAVE_EIGEN
++#ifdef HAVE_EIGEN3
+ plugin_ids.push_back(reinterpret_cast<OBPlugin*>(&theQEqCharges)->GetID());
+
plugin_ids.push_back(reinterpret_cast<OBPlugin*>(&theQTPIECharges)->GetID());
+-#endif
+-#ifdef HAVE_EIGEN3
+ plugin_ids.push_back(reinterpret_cast<OBPlugin*>(&theEQEqCharges)->GetID());
+ #endif
+
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -53,7 +53,7 @@
+ set (tetraplanar_parts 1)
+ set (uniqueid_parts 1 2)
+
+-if (EIGEN2_FOUND OR EIGEN3_FOUND)
++if (TARGET Eigen3::Eigen)
+ set(cpptests
+ align ${cpptests})
+ set (align_parts 1 2 3 4 5)
+--- a/cmake/modules/FindEigen3.cmake
++++ b/cmake/modules/FindEigen3.cmake
+@@ -59,6 +59,9 @@
+ _eigen3_check_version()
+ set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
+
++ add_library(Eigen3::Eigen INTERFACE IMPORTED)
++ set_target_properties(Eigen3::Eigen PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${EIGEN3_INCLUDE_DIR}")
++
+ else (EIGEN3_INCLUDE_DIR)
+
+ find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
+--- a/tools/CMakeLists.txt
++++ b/tools/CMakeLists.txt
+@@ -26,7 +26,7 @@
+ obtautomer
+ obthermo
+ )
+- if(EIGEN3_FOUND)
++ if(TARGET Eigen3::Eigen)
+ set(tools
+ ${tools}
+ obdistgen
+@@ -52,7 +52,7 @@
+ if(NOT MINIMAL_BUILD)
+ # obgrep, obrms, obspectrophore -- require getopt
+ set(toolnames obgrep obspectrophore)
+- if(EIGEN3_FOUND)
++ if(TARGET Eigen3::Eigen)
+ set(toolnames ${toolnames} obrms)
+ endif()
+ foreach(tool ${toolnames})
diff -Nru openbabel-3.1.1+dfsg/debian/patches/fix-allocator-cpp20.patch
openbabel-3.1.1+dfsg/debian/patches/fix-allocator-cpp20.patch
--- openbabel-3.1.1+dfsg/debian/patches/fix-allocator-cpp20.patch
1970-01-01 01:00:00.000000000 +0100
+++ openbabel-3.1.1+dfsg/debian/patches/fix-allocator-cpp20.patch
2026-09-08 12:07:44.000000000 +0200
@@ -0,0 +1,89 @@
+Description: Fix allocator calls for C++20 compatibility
+ std::allocator::allocate(size_type, const void*) was deprecated in C++17
+ and removed in C++20.
+Author: Maximiliano Curia <[email protected]>
+--- a/include/openbabel/tree/tree.hh
++++ b/include/openbabel/tree/tree.hh
+@@ -542,8 +542,8 @@
+ template <class T, class tree_node_allocator>
+ void tree<T, tree_node_allocator>::head_initialise_()
+ {
+- head = alloc_.allocate(1,nullptr); // MSVC does not have default second
argument
+- feet = alloc_.allocate(1,nullptr);
++ head = alloc_.allocate(1);
++ feet = alloc_.allocate(1);
+
+ head->parent=nullptr;
+ head->first_child=nullptr;
+@@ -869,7 +869,7 @@
+ assert(position.node!=head);
+ assert(position.node);
+
+- tree_node *tmp=alloc_.allocate(1,0);
++ tree_node *tmp=alloc_.allocate(1);
+ kp::constructor(&tmp->data);
+ tmp->first_child=0;
+ tmp->last_child=0;
+@@ -894,7 +894,7 @@
+ assert(position.node!=head);
+ assert(position.node);
+
+- tree_node *tmp=alloc_.allocate(1,0);
++ tree_node *tmp=alloc_.allocate(1);
+ kp::constructor(&tmp->data);
+ tmp->first_child=0;
+ tmp->last_child=0;
+@@ -923,7 +923,7 @@
+ assert(position.node!=head);
+ assert(position.node);
+
+- tree_node* tmp = alloc_.allocate(1,nullptr);
++ tree_node* tmp = alloc_.allocate(1);
+ kp::constructor(&tmp->data, x);
+ tmp->first_child=nullptr;
+ tmp->last_child=nullptr;
+@@ -948,7 +948,7 @@
+ assert(position.node!=head);
+ assert(position.node);
+
+- tree_node* tmp = alloc_.allocate(1,0);
++ tree_node* tmp = alloc_.allocate(1);
+ kp::constructor(&tmp->data, x);
+ tmp->first_child=0;
+ tmp->last_child=0;
+@@ -1035,7 +1035,7 @@
+ position.node=feet; // Backward compatibility: when calling
insert on a null node,
+ // insert before the feet.
+ }
+- tree_node* tmp = alloc_.allocate(1,nullptr);
++ tree_node* tmp = alloc_.allocate(1);
+ kp::constructor(&tmp->data, x);
+ tmp->first_child=nullptr;
+ tmp->last_child=nullptr;
+@@ -1057,7 +1057,7 @@
+ template <class T, class tree_node_allocator>
+ typename tree<T, tree_node_allocator>::sibling_iterator tree<T,
tree_node_allocator>::insert(sibling_iterator position, const T& x)
+ {
+- tree_node* tmp = alloc_.allocate(1,0);
++ tree_node* tmp = alloc_.allocate(1);
+ kp::constructor(&tmp->data, x);
+ tmp->first_child=0;
+ tmp->last_child=0;
+@@ -1087,7 +1087,7 @@
+ template <class iter>
+ iter tree<T, tree_node_allocator>::insert_after(iter position, const T& x)
+ {
+- tree_node* tmp = alloc_.allocate(1,0);
++ tree_node* tmp = alloc_.allocate(1);
+ kp::constructor(&tmp->data, x);
+ tmp->first_child=0;
+ tmp->last_child=0;
+@@ -1159,7 +1159,7 @@
+ // std::cout << "warning!" << position.node << std::endl;
+ erase_children(position);
+ // std::cout << "no warning!" << std::endl;
+- tree_node* tmp = alloc_.allocate(1,0);
++ tree_node* tmp = alloc_.allocate(1);
+ kp::constructor(&tmp->data, (*from));
+ tmp->first_child=0;
+ tmp->last_child=0;
diff -Nru openbabel-3.1.1+dfsg/debian/patches/series
openbabel-3.1.1+dfsg/debian/patches/series
--- openbabel-3.1.1+dfsg/debian/patches/series 2025-10-06 10:00:00.000000000
+0200
+++ openbabel-3.1.1+dfsg/debian/patches/series 2026-09-08 12:07:44.000000000
+0200
@@ -7,3 +7,5 @@
remove-CMAKE_CXX_STANDARD.patch
disable-CMP0042.patch
no-fatal-warnings.patch
+fix-allocator-cpp20.patch
+2858.patch
diff -Nru openbabel-3.1.1+dfsg/debian/rules openbabel-3.1.1+dfsg/debian/rules
--- openbabel-3.1.1+dfsg/debian/rules 2025-10-06 10:00:00.000000000 +0200
+++ openbabel-3.1.1+dfsg/debian/rules 2026-09-08 12:07:44.000000000 +0200
@@ -2,6 +2,9 @@
-include /usr/share/python3/python.mk
+DEB_BUILD_PARALLEL ?= $(shell guess_concurrency --require-mem 16G)
+export PYBUILD_TEST_ARGS=-n $(DEB_BUILD_PARALLEL)
+
PYVERS=$(shell py3versions -vs)
PERL_ARCHLIB := $(shell perl -MConfig -e 'print $$Config{vendorarch}')
@@ -25,7 +28,7 @@
endif
%:
- dh $@ --with=python3 --builddirectory=$(CURDIR)/builddir
+ dh $@ --with=python3 --builddirectory=$(CURDIR)/builddir
--max-parallel=$(DEB_BUILD_PARALLEL)
override_dh_auto_configure:
dh_auto_configure -- $(DH_AUTO_CONFIGURE_OPTS)
@@ -53,7 +56,8 @@
override_dh_auto_test:
-BABEL_LIBDIR=$(CURDIR)/builddir/lib/$(DEB_HOST_MULTIARCH) \
LD_LIBRARY_PATH=$(CURDIR)/builddir/lib/$(DEB_HOST_MULTIARCH) \
- dh_auto_test
+ OMP_NUM_THREADS=1 \
+ dh_auto_test --max-parallel=$(DEB_BUILD_PARALLEL)
override_dh_strip:
dh_strip --dbgsym-migration='openbabel-dbg (<< 3.0.0+dfsg)'
diff -Nru openbabel-3.1.1+dfsg/debian/tests/control
openbabel-3.1.1+dfsg/debian/tests/control
--- openbabel-3.1.1+dfsg/debian/tests/control 2025-10-06 10:00:00.000000000
+0200
+++ openbabel-3.1.1+dfsg/debian/tests/control 2026-09-08 12:07:44.000000000
+0200
@@ -1,6 +1,6 @@
Tests: python3
Depends:
- @,
+ @
Restrictions:
allow-stderr,
rw-build-tree,
diff -Nru openbabel-3.1.1+dfsg/debian/tests/python3
openbabel-3.1.1+dfsg/debian/tests/python3
--- openbabel-3.1.1+dfsg/debian/tests/python3 2025-10-06 10:00:00.000000000
+0200
+++ openbabel-3.1.1+dfsg/debian/tests/python3 2026-09-08 12:07:44.000000000
+0200
@@ -15,12 +15,9 @@
echo "Skipping ${TEST} ..."
continue;;
test/testdistgeom.py)
- case "$arch" in amd64|armel)
- # timesout on ci.d.n worker13
- # takes very long on armel
- echo "Skipping ${TEST} ..."
- continue;;
- esac;;
+ # timesout and exhausts memory
+ echo "Skipping ${TEST} ..."
+ continue;;
test/testbindings.py)
case "$arch" in
amd64)