# Building Avogadro2 in the openSUSE Build Service: builds OK, but obabel isn't working properly

#1

Hi,

I packaged the OpenChemistry software needed to build Avogadro 2, from their respective latest master git commit, along with Avogadro 2 itself, using the openSUSE Build Service. Avogadro 2 launches fine, but there’s an issue with running obabel in it to optimize geometry. I started Avogadro 2 from the command-line so I could see the precise error messages and commands it is executing, this is what I saw when trying to optimize the geometry of a molecule:

OBProcess::executeObabel: Running "obabel" "-imol -omol --minimize --log --crit 1e-6 --ff  --steps 10000 --rvdw 10 --rele 10 --freq 10"
MDL: "Open Babel 2.4.90 -- May 28 2018 -- 20:57\nUsage:\nobabel [-i<input-type>] <infilename> [-o<output-type>] -O<outfilename> [Options]\nTry  -H option for more information.\n"


seems like the command is not found. Open Babel must be working somewhat given that I managed to open a SDF file, which I think requires the Open Babel backend to work. I tried a few example Open Babel 3 commands, however, and they all returned errors. Like when I ran the example command:

obabel -:"O=C(O)c1ccccc1OC(=O)C aspirin" -:"Oc1ccccc1C(=O)O salicylic acid" -ofpt


(per the docs for 2.3.1, not sure if Open Babel 2 and 3 use the same syntax, however)

I received the output:

obabel: cannot write output format!
Open Babel 2.4.90 -- May 28 2018 -- 20:57
Usage:
obabel [-i<input-type>] <infilename> [-o<output-type>] -O<outfilename> [Options]


If you want to look at the files I used to build Open Babel 3, here they are. If you want to see the build log click the “Succeeded text” next to the “openSUSE Tumbleweed” build target on the right side bar. Here’s a screenshot showing exactly what I mean for the Avogadro 2 libraries package:

. Avogadro 2 (i.e. avogadroapp) is here. The libraries (avogadrolibs) are here. MoleQueue is packaged here. spglib is here. I tried running an strace on the aspirin obabel command above, here is the output:

obabel.log

Here is strace output for opening a SDF file with Avogadro 2 and trying to optimize the geometry:

strace.log

I really want this Avogadro 2 build to work to its fullest potential so please, if there’s something you need to know in order to help fix this ask.

I’ve also tried editing avogadro2-libs, removing all patches and adjusting the spec file so the build occurs properly (as it changes the contents of the packages), and I get the same obabel issues.

Thanks for your time,
Brenton

#2

I think the first command I’d try is:

obabel -L formats

This should naturally list the formats. The command-line syntax hasn’t changed from 2.x to 3.0 versions, so that’s not the problem.

My usual guess with OB issues is that the file formats aren’t being found. In the comment above from OBProcess::executeObabel the error is not that obabel isn’t found, more that the syntax is funny.

Indeed, I think that Avogadro2 disables the Open Babel menu commands if it can’t find obabel

#3

obabel -L formats

(not sure if I was meant to take that literally, or substitute formats with an actual format (e.g. sdf), I did try substituting formats with sdf but it returned much the same result as below) returns:

formats is not a recognized plugin type. Those with instances of sub-types loaded are:
ops


.

My usual guess with OB issues is that the file formats aren’t being found.

Do you mean they’re not being found in the mimetype database? If so, well my /usr/share/mime/chemical directory is very much full and contains x-mdl-sdfile.xml, among other files, so I don’t think this is the case here.

Indeed, I think that Avogadro2 disables the Open Babel menu commands if it can’t find obabel

As far as I can tell all the Open Babel menu commands are shown, e.g. the optimize geometry one is shown, so this isn’t the case here. Much the same issue occurs with all other Open Babel-related menu items that I’ve tested so far, like when I click “Perceive bonds” or “Add hydrogens” I also get obabel errors.

#4

Oh, sorry I realize now why you said, “Indeed, I think that…” I don’t mean as in obabel isn’t in PATH, I mean that the precise obabel command being executed isn’t a valid one (i.e. the options used have not been found to be valid).

#5

Oh goodie, I finally got things to work. In my Open Babel 3 build I merely needed to use a RPM spec macro (%make_build) to run make instead of manually calling it.

Thanks for your time and patience. I realize with all my queries here, on Chemistry StackExchange and on GitHub I must get irritating, so I appreciate your patience.

#6

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.