Menu

#24 osra 2.2.4 fails to build with openbabel 3.2.0

v1.3.7
open
nobody
None
5
2026-06-17
2026-06-10
No

osra 2.2.4 fails to build with openbabel 3.2.0:

osra_openbabel.cpp: In function 'void create_molecule(OpenBabel::OBMol&, std::vector<atom_s>&, const std::vector<bond_s>&, int, double, molecule_statistics_t&, bool, double, const std::map<std::__cxx11::basic_string\<char>, std::__cxx11::basic_string\<char> >&, const std::map<std::__cxx11::basic_string\<char>, std::__cxx11::basic_string\<char> >&, int, std::string</char></std::__cxx11::basic_string\<char></char></std::__cxx11::basic_string\<char>, bool, std::vector<bracket_t>&)':
osra_openbabel.cpp:406:62: error: no match for 'operator=' (operand types are 'OpenBabel::OBMolAtomIter' and 'OpenBabel::OBAtom')
406 | if (ai->GetIdx() == atom[bond[i].b].n) b = ai;
| ^~
osra_openbabel.cpp:406:62: note: there is 1 candidate
In file included from osra_openbabel.cpp:29:
/usr/include/openbabel3/openbabel/obiter.h:56:20: note: candidate 1: 'OpenBabel::OBMolAtomIter& OpenBabel::OBMolAtomIter::operator=(const OpenBabel::OBMolAtomIter&)'
56 | OBMolAtomIter& operator=(const OBMolAtomIter &ai);
| ^~~~~~~~
/usr/include/openbabel3/openbabel/obiter.h:56:51: note: no known conversion for argument 1 from 'OpenBabel::OBAtom
' to 'const OpenBabel::OBMolAtomIter&'
56 | OBMolAtomIter& operator=(const OBMolAtomIter &ai);
| ~~~~~~~~~~~~~~~~~~~~~^~
osra_openbabel.cpp:407:67: error: no match for 'operator=' (operand types are 'OpenBabel::OBMolAtomIter' and 'OpenBabel::OBAtom')
407 | else if (ai->GetIdx() == atom[bond[i].a].n) a = ai;
| ^~
osra_openbabel.cpp:407:67: note: there is 1 candidate
/usr/include/openbabel3/openbabel/obiter.h:56:20: note: candidate 1: 'OpenBabel::OBMolAtomIter& OpenBabel::OBMolAtomIter::operator=(const OpenBabel::OBMolAtomIter&)'
56 | OBMolAtomIter& operator=(const OBMolAtomIter &ai);
| ^~~~~~~~
/usr/include/openbabel3/openbabel/obiter.h:56:51: note: no known conversion for argument 1 from 'OpenBabel::OBAtom
' to 'const OpenBabel::OBMolAtomIter&'
56 | OBMolAtomIter& operator=(const OBMolAtomIter &ai);
| ~~~~~~~~~~~~~~~~~~~~~^~</bracket_t></bond_s></atom_s>

There were build failures with earlier openbabel versions, but replacing std::shared_ptr<OBMol> with obsharedptr<OBMol> in src/osra_reaction.cpp fixed them.

Discussion

  • Igor

    Igor - 2026-06-11

    OSRA needs to be compiled with a patched version of OpenBabel 3.0.0.
    Download is available here:
    https://sourceforge.net/projects/osra/files/openbabel-patched/
    openbabel-3-0-0-patched-3.tgz
    Building with vanilla OpenBabel will miss some of the functionality and is not recommended.

     
    • Andrius Merkys

      Andrius Merkys - 2026-06-16

      Noted, thanks. What about Open Babel 3.2.0, is there going to be a patched version of it as well?

       
  • Igor

    Igor - 2026-06-16

    At the moment I don't have any plans with regards to upgrading to OpenBabel 3.2.0.
    Are there any specific features available in 3.2.0 that you are looking for?

     
    • Andrius Merkys

      Andrius Merkys - 2026-06-17

      I do not have any specific features in mind, but 3.2.0 fixed many bugs present in 3.0.0, including CVEs.

       

Log in to post a comment.