Article View: linux.debian.bugs.dist
Article #7339Bug#1139276: osra: fails to build with openbabel >= 3.2.0
From: Sebastien Bacher
Date: Thu, 03 Dec 2026 16:40
Date: Thu, 03 Dec 2026 16:40
146 lines
7358 bytes
7358 bytes
This is a multi-part MIME message sent by reportbug.
--===============8144106050915886924==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Source: osra
Version: 2.2.4-1
Followup-For: Bug #1139276
X-Debbugs-Cc: seb128@ubuntu.com
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu tenacious ubuntu-patch
Control: tags -1 patch ftbfs
Hi,
The attached patch fixes the build of osra 2.2.4-1 with OpenBabel 3.2.x. It
needs two changes, only the first of which is in the original report:
1. src/osra_openbabel.cpp: FOR_ATOMS_OF_MOL now iterates over OBAtom
pointers, so "OBMolAtomIter a,b; ... b = ai;" no longer compiles:
osra_openbabel.cpp:406:62: error: no match for 'operator=' (operand types
are 'OpenBabel::OBMolAtomIter' and 'OpenBabel::OBAtom*')
The new patch debian/patches/openbabel-3.2.patch keeps plain OBAtom
pointers (a = &*ai) and makes SetTetrahedtalUnknown() take an OBAtom *.
"&*ai" also works with the old iterator, so it should build with 3.1 too.
2. debian/patches/openbabel.patch replaces std::shared_ptr by obsharedptr in
src/osra_reaction.cpp. obsharedptr only exists in OpenBabel 3.1, it is
gone in 3.2 (no match in the 3.2.1 headers), and the build stops there
once the first error is fixed:
osra_reaction.cpp:63:11: error: 'obsharedptr' was not declared in this scope
The upstream source already uses std::shared_ptr, so the attached patch
just drops openbabel.patch from the series.
The patch (against the debian/patches directory of 2.2.4-1) adds the new
patch file, removes openbabel.patch and updates debian/patches/series.
Testing: a PPA build of osra 2.2.4-1ubuntu1~ppa2 on Ubuntu succeeded on
amd64, amd64v3, arm64, armhf, ppc64el and s390x, against libopenbabel-dev
3.2.0+dfsg-2. I have not built it against 3.2.1+dfsg-1 yet, nor on riscv64,
and I have not run the osra tests or checked the results on a wavy bond
molecule, which is the code path the first change touches.
We are carrying it in Ubuntu as osra 2.2.4-1ubuntu1 so openbabel can migrate.
As upstream told you they have no plans to move to 3.2, this will likely stay
in Debian as a patch too. I have not forwarded it upstream.
Cheers,
Sebastien
-- System Information:
Debian Release: forky/sid
APT prefers resolute-updates
APT policy: (500, 'resolute-updates'), (500, 'resolute-security'), (500, 'resolute'), (100, 'resolute-backports')
Architecture: amd64 (x86_64)
Kernel: Linux 7.0.0-44-generic (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
--===============8144106050915886924==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="osra-openbabel-3.2.patch"
diff -Nru a/debian/patches/openbabel-3.2.patch b/debian/patches/openbabel-3.2.patch
--- a/debian/patches/openbabel-3.2.patch
+++ b/debian/patches/openbabel-3.2.patch
@@ -0,0 +1,33 @@
+Description: Fix the build with OpenBabel 3.2
+ In OpenBabel 3.2 FOR_ATOMS_OF_MOL iterates over OBAtom pointers and
+ OBMolAtomIter can no longer be assigned from them. Keep plain OBAtom
+ pointers instead, "&*ai" works with both the old iterator and the new pointer.
+Author: Sebastien Bacher <sebastien.bacher@canonical.com>
+Forwarded: no
+Last-Update: 2026-12-02
+
+--- a/src/osra_openbabel.cpp
++++ b/src/osra_openbabel.cpp
+@@ -273,7 +273,7 @@
+ return (r);
+ }
+
+-void SetTetrahedtalUnknown(OBMolAtomIter atom)
++void SetTetrahedtalUnknown(OBAtom *atom)
+ {
+ OBStereoFacade facade(atom->GetParent());
+ OBTetrahedralStereo *stereo;
+@@ -401,10 +401,10 @@
+ if (bond[i].wedge && bond[i].hash) // wavy bonds
+ {
+ mol.AddBond(atom[bond[i].a].n, atom[bond[i].b].n, bond[i].type, OB_WEDGE_OR_HASH_BOND);
+- OBMolAtomIter a,b;
++ OBAtom *a = NULL, *b = NULL;
+ FOR_ATOMS_OF_MOL(ai, mol)
+- if (ai->GetIdx() == atom[bond[i].b].n) b = ai;
+- else if (ai->GetIdx() == atom[bond[i].a].n) a = ai;
++ if (ai->GetIdx() == atom[bond[i].b].n) b = &*ai;
++ else if (ai->GetIdx() == atom[bond[i].a].n) a = &*ai;
+ SetTetrahedtalUnknown(a);
+ SetTetrahedtalUnknown(b);
+ }
diff -Nru a/debian/patches/openbabel.patch b/debian/patches/openbabel.patch
--- a/debian/patches/openbabel.patch
+++ b/debian/patches/openbabel.patch
@@ -1,18 +0,0 @@
---- a/src/osra_reaction.cpp
-+++ b/src/osra_reaction.cpp
-@@ -60,13 +60,13 @@
- OBReaction react;
- for (int j=0; j<reactants.size(); j++)
- {
-- std::shared_ptr<OBMol> reactant(new OBMol);
-+ obsharedptr<OBMol> reactant(new OBMol);
- conv.ReadString(reactant.get(), page_of_structures[reactants[j]]);
- react.AddReactant(reactant);
- }
- for (int j=0; j<products.size(); j++)
- {
-- std::shared_ptr<OBMol> product(new OBMol);
-+ obsharedptr<OBMol> product(new OBMol);
- conv.ReadString(product.get(), page_of_structures[products[j]]);
- react.AddProduct(product);
- }
diff -Nru a/debian/patches/series b/debian/patches/series
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,2 @@
-openbabel.patch
no-thread.patch
+openbabel-3.2.patch
--===============8144106050915886924==--
Technical Details
Message-ID:
<O6i0F-fLYR-1@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.hispagatos.org!news.nntp4.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomodReferences:
<NBN0J-glWn-7@gated-at.bofh.it>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.hispagatos.org!news.nntp4.net!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod From: Sebastien Bacher <seb128@ubuntu.com> Newsgroups: linux.debian.bugs.dist Subject: Bug#1139276: osra: fails to build with openbabel >= 3.2.0 Date: Thu, 03 Dec 2026 17:40:01 +0100 Message-ID: <O6i0F-fLYR-1@gated-at.bofh.it> References: <NBN0J-glWn-7@gated-at.bofh.it> X-Original-To: Debian Bug Tracking System <1139276@bugs.debian.org> X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Thu Dec 3 16:39:08 2026 Old-Return-Path: <debbugs@buxtehude.debian.org> X-Spam-Flag: NO X-Spam-Score: -1.651 Reply-To: Sebastien Bacher <seb128@ubuntu.com>, 1139276@bugs.debian.org Resent-To: debian-bugs-dist@lists.debian.org Resent-Cc: seb128@ubuntu.com, debichem-devel@lists.alioth.debian.org X-Debian-Pr-Message: followup 1139276 X-Debian-Pr-Package: src:osra X-Debian-Pr-Keywords: ftbfs X-Debian-Pr-Source: osra Content-Type: multipart/mixed; boundary="===============8144106050915886924==" MIME-Version: 1.0 X-Mailer: reportbug 13.2.0+ubuntu1 X-Debian-Message: from BTS X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2006770 List-ID: <debian-bugs-dist.lists.debian.org> List-URL: <https://lists.debian.org/debian-bugs-dist/> Approved: robomod@news.nic.it Lines: 146 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Thu, 03 Dec 2026 17:36:58 +0100 X-Original-Message-ID: <179631581845.2629832.9347296983488594551.reportbug@seb128-ThinkPad-T16> X-Original-References: <689849cb-a712-41f6-ac61-67621006e1cd@debian.org>