Bug 2112710

Summary: OpenBabel doesn't work; needs libdir specification
Product: [Fedora] Fedora Reporter: Susi Lehtola <susi.lehtola>
Component: openbabelAssignee: Antonio T. sagitter <trpost>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 36CC: alex.ploumistos, dominik, niklas.kappel, scitech-bugs, susi.lehtola, trpost
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openbabel-3.1.1-12.fc37 openbabel-3.1.1-15.fc36 openbabel-3.1.1-15.fc37 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-10 22:08:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Susi Lehtola 2022-07-31 20:33:25 UTC
Description of problem:

OpenBabel does not work on command line. Converting a Gaussian log file fails with

$ obabel test.log -O test.xyz
==============================
*** Open Babel Error  in LoadAllPlugins
  Unable to find OpenBabel plugins. Try setting the BABEL_LIBDIR environment variable.
Missing or unknown output file or format spec or possibly a misplaced option.
Options, other than -i -o -O -m, must come after the input files.

Open Babel 3.1.1 -- Jan 27 2022 -- 00:00:00
Usage:
obabel [-i<input-type>] <infilename> [-o<output-type>] -O<outfilename> [Options]
Try  -H option for more information.
$

The fix is simple:
$ export BABEL_LIBDIR=/usr/lib64/openbabel
$ obabel test.log -O test.xyz
1 molecule converted
$

You need to set BABEL_LIBDIR in e.g. a profile file.

Version-Release number of selected component (if applicable):
$ rpm -q openbabel
openbabel-3.1.1-6.fc36.x86_64

Comment 1 Antonio T. sagitter 2022-08-01 09:41:13 UTC
> You need to set BABEL_LIBDIR in e.g. a profile file.

Could rpaths in binary files be enough?

Comment 2 Susi Lehtola 2022-08-01 13:53:30 UTC
(In reply to Antonio T. sagitter from comment #1)
> > You need to set BABEL_LIBDIR in e.g. a profile file.
> 
> Could rpaths in binary files be enough?

RPaths are generally not allowed in Fedora

https://docs.fedoraproject.org/en-US/packaging-guidelines/#_beware_of_rpath

but it appears that there's a special policy for internal libraries.

Comment 3 Antonio T. sagitter 2022-08-06 12:21:43 UTC
> You need to set BABEL_LIBDIR in e.g. a profile file.

Can you show me an example about how to include a profile file in the rpms please?

Comment 4 Susi Lehtola 2022-08-06 20:02:03 UTC
xtb package uses profile files to set paths

https://src.fedoraproject.org/rpms/xtb/blob/3ccdb86c183530b7268d1851627b08de61ec3529/f/xtb.spec

Comment 5 Fedora Update System 2022-08-08 19:40:59 UTC
FEDORA-2022-e415638af6 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-e415638af6

Comment 6 Fedora Update System 2022-08-08 19:43:26 UTC
FEDORA-2022-e415638af6 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 7 Susi Lehtola 2022-09-27 12:39:44 UTC
Still doesn't work

Comment 8 Susi Lehtola 2022-09-27 12:39:55 UTC
*** Bug 2087071 has been marked as a duplicate of this bug. ***

Comment 9 Alexander Ploumistos 2022-09-27 12:47:49 UTC
(In reply to Susi Lehtola from comment #7)
> Still doesn't work

Have you tried sourcing the profile in /etc/profile.d/?
I had to reboot because of a kernel update and I don't have any issue.

Comment 10 Fedora Update System 2022-09-27 12:56:49 UTC
FEDORA-2022-68f29e4459 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-68f29e4459

Comment 11 Susi Lehtola 2022-09-27 13:01:11 UTC
(In reply to Alexander Ploumistos from comment #9)
> (In reply to Susi Lehtola from comment #7)
> > Still doesn't work
> 
> Have you tried sourcing the profile in /etc/profile.d/?
> I had to reboot because of a kernel update and I don't have any issue.

the update was never filed to Fedora 36 which is what this bug is about

Comment 12 Alexander Ploumistos 2022-09-27 13:03:37 UTC
Oops, my bad, from your answer I got that the update was not working for you.

Comment 13 Fedora Update System 2022-09-28 11:35:10 UTC
FEDORA-2022-68f29e4459 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-68f29e4459`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-68f29e4459

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 14 Fedora Update System 2022-09-28 12:19:54 UTC
FEDORA-2022-f457b7a068 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-f457b7a068`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-f457b7a068

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 15 Fedora Update System 2022-10-01 10:42:08 UTC
FEDORA-2022-608aa85d22 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-608aa85d22

Comment 16 Fedora Update System 2022-10-01 10:42:13 UTC
FEDORA-2022-30f18333d1 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-30f18333d1

Comment 17 Fedora Update System 2022-10-02 01:22:45 UTC
FEDORA-2022-608aa85d22 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-608aa85d22`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-608aa85d22

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 18 Fedora Update System 2022-10-02 02:18:21 UTC
FEDORA-2022-30f18333d1 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-30f18333d1`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-30f18333d1

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 19 Alexander Ploumistos 2022-10-05 20:46:06 UTC
Version 3.1.1-15 changed the BABEL_LIBDIR from /usr/lib64/openbabel/ (on 64-bit) to /usr/lib64/openbabel3/. As a result, running `obabel -L formats` is broken again as is every other program that requires Open Babel at runtime. Was this done by accident?

The upstream CMakeLists.txt has this section for the plugin directory (on linux):

set(LIB_SUFFIX "" CACHE STRING "Suffix of the directory name, e.g. 64 for lib64")
if(UNIX)
  set(LIB_INSTALL_DIR    "lib${LIB_SUFFIX}"
    CACHE PATH "Install dir for libraries")
  if(ENABLE_VERSIONED_FORMATS)
    set(OB_PLUGIN_INSTALL_DIR "${LIB_INSTALL_DIR}/openbabel/${BABEL_VERSION}"
      CACHE PATH "Install dir for plugins")
  else()
    set(OB_PLUGIN_INSTALL_DIR "${LIB_INSTALL_DIR}/openbabel"
      CACHE PATH "Install dir for plugins")
  endif()

Is there any point in enabling versioned formats? If that is the case, then we should patch all of Open Babel's dependencies.
If not, can we just drop the "3" from the path, or is it going to cause problems?

By the way, @susi.lehtola the script you mentioned in bug 2130870, where is it from? Upstream Open Babel does not append the version number to the folder name.

Comment 20 Susi Lehtola 2022-10-06 08:58:33 UTC
(In reply to Alexander Ploumistos from comment #19)
> By the way, @susi.lehtola the script you mentioned in bug 2130870,
> where is it from? Upstream Open Babel does not append the version number to
> the folder name.

All this information is available in bug 2130870.

Comment 21 Fedora Update System 2022-10-09 16:33:29 UTC
FEDORA-2022-30f18333d1 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 22 Alexander Ploumistos 2022-10-11 06:07:13 UTC
As I wrote in comment 19, the https://src.fedoraproject.org/rpms/openbabel/c/f58d73c656a50c6787797426a8b97c8b250063ad?branch=f36 commit broke the program again. Executables are looking for plugins in /usr/lib64/openbabel/, but the path has changed to /usr/lib64/openbabel3/:

$ obabel -v -L formats
==============================
*** Open Babel Error  in LoadAllPlugins
  Unable to find OpenBabel plugins. Try setting the BABEL_LIBDIR environment variable.
==============================
*** Open Babel Error  in LoadAllPlugins
  Unable to find OpenBabel plugins. Try setting the BABEL_LIBDIR environment variable.
==============================
*** Open Babel Error  in LoadAllPlugins
  Unable to find OpenBabel plugins. Try setting the BABEL_LIBDIR environment variable.
==============================
*** Open Babel Error  in LoadAllPlugins
  Unable to find OpenBabel plugins. Try setting the BABEL_LIBDIR environment variable.
==============================
*** Open Babel Error  in LoadAllPlugins
  Unable to find OpenBabel plugins. Try setting the BABEL_LIBDIR environment variable.
formats is not a recognized plugin type. Those with instances of sub-types loaded are:
ops

Reopening.

Comment 23 Fedora Update System 2022-11-10 22:08:49 UTC
FEDORA-2022-608aa85d22 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.