# Avogadro cannot open files on Tumbleweed, but can on Fedora 27

#1

Avogadro is very handy when I’m trying to create molecular models, unfortunately I’ve noticed that on openSUSE Tumbleweed I cannot open SDF files with it. I get errors like (in popups):

Reading molecular file failed, file /home/fusion809/Chem/3D/SDF/4M48-Ligands_noHydrogens_withMissing_1_Instances.sdf.


while on Fedora 27 I do not get this error and Avogadro opens the SDF file without issue. The version of Avogadro is the same on both platforms, 1.2.0, yet on Tumbleweed opening SDF files fails. Here are the packaging files (e.g. patches, spec file, etc.) used on Tumbleweed: https://build.opensuse.org/package/show/openSUSE%3AFactory/avogadro. Here’s the source RPM used by Fedora (containing the spec file, the patches, the upstream sources, etc.): https://kojipkgs.fedoraproject.org//packages/avogadro/1.2.0/10.fc27/src/avogadro-1.2.0-10.fc27.src.rpm. Unfortunately I do not have a page you can go to, to see the sources in your browser without having to download the source RPM.

I have tried manually compiling Avogadro, after applying this patch:

From 53e179f4dbfa5062478f02b1ae463f4ea4251f30 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <[email protected]>
Date: Wed, 27 Dec 2017 10:00:30 +0100
Subject: [PATCH 4/4] don't use signbit on non-float

---
1 file changed, 2 insertions(+), 2 deletions(-)

index 143b4de03e0f..42b5979d7d94 100644
@@ -67,13 +67,13 @@ msym_error_t orbitalFromQuantumNumbers(int n, int l, int m, msym_orbital_t *o){
}
case 2 : {
//o->v = dpolynomial[m+l];
-            char *d = (signbit(m) == 1 ? "-" : "+");
+            char *d = (m < 0) ? "-" : "+";
snprintf(o->name, sizeof(o->name), "%dd%d%s",n,abs(m),d);
break;
}
default : {
char t = 'f' - 3 + l;
-            char *d = (signbit(m) == 1 ? "-" : "+");
+            char *d = (m < 0) ? "-" : "+";
snprintf(o->name, sizeof(o->name), "%d%c%d%s",n,t,abs(m),d);
}
}
--
2.15.1


(otherwise I get an error; I would have just given you the link to where I obtained this patch but the silly limit on how many links a new user, like me, can add to a post is stopping me), and installing it on Tumbleweed (I installed it to ~/avogadro-install, so it wouldn’t conflict with the packaged Avogadro install’s files), unfortunately it suffers from the same problem.

This issue also occurs with MOL2 files.

As a side note, has anyone considered packaging Avogadro as a cross-distro package format (e.g. AppImage, Flatpak, Snap, etc.)? If they did they’d provide people like me, that find a problem in their distro’s Avogadro package, a way around it. Closest to this I’ve found is the Avogadro Nix package (would give you a link to its packaging file, but I can’t due to that limit on links), which presently doesn’t work per NixOS/nixpkgs#34307 (also not linking because I can’t).

Thanks for your time, I know I’ve whinged about the link limit but any help is truly appreciated

#3

Well how silly do I feel, it seems to affect every file format, not just SDF. Even CML files won’t open. If you’re thinking about file permissions well they’re all owned by fusion809 (me). Other programs (e.g. Jmol) manage to open them on Tumbleweed.

#4

Tried to build Avogadro manually from source (with that patch) and install it locally so I can get a log for ya, unfortunately the log is huge (6.1M), so I couldn’t pastebin it. As a workaround I’ve xz-compressed and uploaded it here https://drive.google.com/open?id=1aSKXeqtKfu6CHieyKe6ahBUafjviNwJM.

#5

Can you compile Avo 1.2? If so, the log isn’t relevant.

The key question I’d have is whether Open Babel is working and/or installed correctly. That’s usually the problem when files cannot be read.