Possible issue with Debian/Ubuntu packages for avogadro2 and input generators

Dear All,

Currently, I make use of avogadro2 on my desktop which is running Ubuntu 20.04. The binaries are from the deb packages supplied by avogadro and libavogadro2-1.

I have noticed that the “Quantum–>Input generators” pull down is absent. I have also noticed that the “plugin downloader” does not work either, but I think this a separate issue (I think it’s putting them in the wrong location).

Anyway, I manually moved the scripts to the expected location:
~/.local/share/OpenChemistry/Avogadro/inputGenerators
but this did not work. I also note that a few people may also be experiencing this too:

So, to investigate, I compiled avogadro2 from source, from the git repo:

1)Install needed deps
  sudo apt-get install qtbase5-dev qtdeclarative5-dev libxml2-dev

2) clone
  git clone --recursive git://github.com/OpenChemistry/openchemistry.git

3) build out-of-source dir

  mkdir openchemistry-build
  cd openchemistry-build

  cmake ../openchemistry
  cmake --build . --config Release

4) Build
  make -j16

5) Run
  cd ..
  ./openchemistry-build/prefix/bin/avogadro2

This worked; I was able see “Quantum–>Input generators” and all the input generators. So… my attention turned to the compilation and packaging that Ubuntu was using.

Next, I compiled the src debian packages (1.93.0-3 : avogadrolibs package : Ubuntu and 1.93.0-1 : avogadro package : Ubuntu) and installed the generated debs. I, again, saw the original problem.

Now, I suspect there is a bug with the packaging process (the actual compile processes are in ./debian/rules in this file ).

I also notice that from the terminal, the deb binary does not report looking for the input generator (see "Checking for “foo” … "):

mjw@lags:~$ avogadro2 
Locale:  "en_GB"
 translation success
"/usr/share/qt5/translations"
 translation success
Extension plugins dynamically found... 22
Checking for  "commands"  scripts in "/home/mjw/.local/share/OpenChemistry/Avogadro/commands"
Checking for  "commands"  scripts in "/usr/share/ubuntu/OpenChemistry/Avogadro/commands"
Checking for  "commands"  scripts in "/usr/local/share/OpenChemistry/Avogadro/commands"
Checking for  "commands"  scripts in "/usr/share/OpenChemistry/Avogadro/commands"
Checking for  "commands"  scripts in "/var/lib/snapd/desktop/OpenChemistry/Avogadro/commands"
Checking for  "commands"  scripts in "/usr/bin/../lib/x86_64-linux-gnu/avogadro2/scripts/commands"
OBProcess::executeObabel: Running "obabel" "-L formats read"
OBProcess::executeObabel: Running "obabel" "-L formats write"
OBProcess::executeObabel: Running "obabel" "-L forcefields"
OBProcess::executeObabel: Running "obabel" "-V"
"obabel"  found:  "obabel: Open Babel 3.0.0 -- Mar 11 2020 -- 11:52:36"
"Navigator" added
"Editor" added
"Selection" added
"Manipulator" added
"BondCentric" added
"MeasureTool" added
"PlayerTool" added

But, the version compiled from the git source, does:

mjw@lags:~/workspace$ ./openchemistry-build/avogadroapp/bin/avogadro2 
Locale:  "en_GB"
 translation success
"/usr/share/qt5/translations"
 translation success
Extension plugins dynamically found... 29
Checking for  "commands"  scripts in "/home/mjw/.local/share/OpenChemistry/Avogadro/commands"
Checking for  "commands"  scripts in "/usr/share/ubuntu/OpenChemistry/Avogadro/commands"
Checking for  "commands"  scripts in "/usr/local/share/OpenChemistry/Avogadro/commands"
Checking for  "commands"  scripts in "/usr/share/OpenChemistry/Avogadro/commands"
Checking for  "commands"  scripts in "/var/lib/snapd/desktop/OpenChemistry/Avogadro/commands"
Checking for  "commands"  scripts in "/home/mjw/workspace/openchemistry-build/avogadroapp/bin/../lib/avogadro2/scripts/commands"
OBProcess::executeObabel: Running "obabel" "-L formats read"
OBProcess::executeObabel: Running "obabel" "-L formats write"
OBProcess::executeObabel: Running "obabel" "-L forcefields"
OBProcess::executeObabel: Running "obabel" "-V"
"obabel"  found:  "obabel: Open Babel 3.0.0 -- Mar 11 2020 -- 11:52:36"
Checking for  "inputGenerators"  scripts in "/home/mjw/.local/share/OpenChemistry/Avogadro/inputGenerators"
Checking for  "inputGenerators"  scripts in "/usr/share/ubuntu/OpenChemistry/Avogadro/inputGenerators"
Checking for  "inputGenerators"  scripts in "/usr/local/share/OpenChemistry/Avogadro/inputGenerators"
Checking for  "inputGenerators"  scripts in "/usr/share/OpenChemistry/Avogadro/inputGenerators"
Checking for  "inputGenerators"  scripts in "/var/lib/snapd/desktop/OpenChemistry/Avogadro/inputGenerators"
Checking for  "inputGenerators"  scripts in "/home/mjw/workspace/openchemistry-build/avogadroapp/bin/../lib/avogadro2/scripts/inputGenerators"
ScriptLoader::queryProgramName: Unable to retrieve program name for "/home/mjw/.local/share/OpenChemistry/Avogadro/inputGenerators/generators.cmake" ; "Error running script '/usr/bin/python3 /home/mjw/.local/share/OpenChemistry/Avogadro/inputGenerators/generators.cmake --display-name --lang en_GB': Abnormal exit status 1 (Unknown error.: Unknown error)\n\nOutput:\n  File \"/home/mjw/.local/share/OpenChemistry/Avogadro/inputGenerators/generators.cmake\", line 3\n    dalton.py\n    ^\nSyntaxError: invalid syntax\n"
ScriptLoader::queryProgramName: Unable to retrieve program name for "/home/mjw/.local/share/OpenChemistry/Avogadro/inputGenerators/LICENSE" ; "Error running script '/usr/bin/python3 /home/mjw/.local/share/OpenChemistry/Avogadro/inputGenerators/LICENSE --display-name --lang en_GB': Abnormal exit status 1 (Unknown error.: Unknown error)\n\nOutput:\n  File \"/home/mjw/.local/share/OpenChemistry/Avogadro/inputGenerators/LICENSE\", line 1\n    Copyright (c) 2011-2018, Kitware, Inc.\n                  ^\nSyntaxError: invalid syntax\n"
ScriptLoader::queryProgramName: Unable to retrieve program name for "/home/mjw/.local/share/OpenChemistry/Avogadro/inputGenerators/README.md" ; "Error running script '/usr/bin/python3 /home/mjw/.local/share/OpenChemistry/Avogadro/inputGenerators/README.md --display-name --lang en_GB': Abnormal exit status 1 (Unknown error.: Unknown error)\n\nOutput:\n  File \"/home/mjw/.local/share/OpenChemistry/Avogadro/inputGenerators/README.md\", line 1\n    Avogadro 2 Python Input Generators\n             ^\nSyntaxError: invalid syntax\n"
Checking for  "formatScripts"  scripts in "/home/mjw/.local/share/OpenChemistry/Avogadro/formatScripts"
Checking for  "formatScripts"  scripts in "/usr/share/ubuntu/OpenChemistry/Avogadro/formatScripts"
Checking for  "formatScripts"  scripts in "/usr/local/share/OpenChemistry/Avogadro/formatScripts"
Checking for  "formatScripts"  scripts in "/usr/share/OpenChemistry/Avogadro/formatScripts"
Checking for  "formatScripts"  scripts in "/var/lib/snapd/desktop/OpenChemistry/Avogadro/formatScripts"
Checking for  "formatScripts"  scripts in "/home/mjw/workspace/openchemistry-build/avogadroapp/bin/../lib/avogadro2/scripts/formatScripts"
"Navigator" added
"Editor" added
"Selection" added
"Manipulator" added
"BondCentric" added
"MeasureTool" added
"PlayerTool" added
Error starting RPC server: "QLocalServer::listen: Address in use"
Other server is alive. Not starting new instance.

My current theory is the absence of avogadrogenerators in the deb package building process could be the issue and somehow prevents the final binary from searching fro input generators. This is just speculation at the moment…

I am still working my way through the related code, but I just wanted to document what I had found thus far.

What do you think?

Thanks,

Mark

2 Likes

I haven’t had a chance to look at the deb build, but I wonder if the Molequeue bits are turned off in that build.

In the Ubuntu build, it should install:
lib/avogadro2/staticplugins

Mine looks like this:

In the Ubuntu build, is there a “QuantumInput” plugin listed (regardless of the file extension)?

If there isn’t QuantumInput.* then the code to look for the generators isn’t installed and will never run.

I think you’re correct: QuantumInput.* is missing

mjw@lags:~$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"
mjw@lags:~$ dpkg -L libavogadro2-1 | grep -i MeasureToo
/usr/lib/x86_64-linux-gnu/avogadro2/staticplugins/MeasureTool.a
mjw@lags:~$ dpkg -L libavogadro2-1 | grep -i QuantumInput
mjw@lags:~$ 

Looking in the debian/rules file within: https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/avogadrolibs/1.93.0-3/avogadrolibs_1.93.0-3.debian.tar.xz

<snip>
CMAKE_OPTS=-DUSE_HDF5=ON \
            -DUSE_LIBMSYM=OFF \
            -DUSE_MMTF=OFF \
            -DUSE_MOLEQUEUE=OFF \
            -DOpenGL_GL_PREFERENCE=GLVND \
            -DCMAKE_SKIP_RPATH=TRUE \
            -DUSE_PYTHON=ON \
            -DENABLE_TRANSLATIONS=ON

<snip>

In the most recent sid deb, there is also a reference to this:

    - drop_cp2kinput.patch drops the cp2k input plugin,
      since it requires molequeue (upstream Issue#476)

I think #476 is here and “RizzerOnGitHub” is the debian packager (Drew Parsons)

That’s right, no one has package MoleQueue for Debian yet, so we can’t yet build in the functionality that requires it. We’ve got as much of avogadro2 working as we can. Apologies for the inconvenience!

2 Likes

Yeah, it’s incentive to finish the effort to put the input generators onto the newer InterfaceScript classes:

Thanks Drew; this is all very useful since we now understand the origin of this issue with the Debian/Ubuntu packages.

I solved the problem via a simple change in a directory name:

When I installed Avogadro2 (1.93.0-3) in Linux Mint 20.1 Xfce (based on Ubuntu 20.04), after using the Plugin Downloader, it installed the auxiliary files (including the input generators) in the following directory:

/home/user/.local/share/OpenChemistry/Avogadro/other

However, the Avogadro2 application looks in the following directory for the input generators:

/home/user/.local/share/OpenChemistry/Avogadro/commands

Therefore, I changed the name of the “other” directory to “commands”. With this change, the Extensions menu now included the input generators.

However, I am not able to output the input generator file. How should this be done?

It’s probably easier to put this in a new thread.

I’m surprised that “commands” are read in as input generators, but :man_shrugging: The generators, however, should show up in the “Quantum” menu:

If the input generators actually show up and you see the dialogs, there’s a button that’s labeled “Write files to disk…”

The Avogadro package 1.93.0 currently accessible in Debian 11 / bullseye, branch testing, does not show the menu to export to other programs, either:

This despite I just run the Extensions -> Plugin Downloader, selected the avogenerators stamped by 2016, and – by the downloader’s comment – installed them successfully.

Following the suggest provided above, I then renamed the path of

/home/user/.local/share/OpenChemistry/Avogadro/other

into

/home/user/.local/share/OpenChemistry/Avogadro/commands

and restarted the program. To my surprise, Extensions -> Extensions now looks like to provide an assistant. However, it still is not obvious to me how to save the geometry and the parameters set into a dedicated .mop input file (if MOPAC would be a program accessible for you), because confirming the settings just closes said widget.

So I checked a twice the plugin downloader. Contrary to anticipation, it looked like the download of the writer scripts for an export to MOPAC, Gaussian, etc. never happened. So I run this download again, restarted the program (no change), and eventually downloaded the scripts in question a thrice. Still no change in the GUI, but the path

/home/user/.local/share/OpenChemistry/Avogadro/other

is built again. Actually containing multiple sub-folders (e.g., OpenChemistry-avogenerators-8444312, the number varies among the folders, though), each containing the scripts. Pylint (version 2.7.2) to work with Python 3.9.2 identifies among these scripts e.g., in mopac.py some issues which could be improved for style; on the other hand, there are no errors to cause the checker to stop immediately.

AFAIK, the Ubuntu packages do not enable Molequeue, and in turn the input generators.

Installing whatever scripts you want will not change that…

Since people continue to visit this thread, I’m going to update:

If none of these work for you, please post a new thread…

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