Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac builds for 1.98 have broken Open Babel #1443

Closed
research11111 opened this issue Nov 5, 2023 · 7 comments · Fixed by #1522
Closed

Mac builds for 1.98 have broken Open Babel #1443

research11111 opened this issue Nov 5, 2023 · 7 comments · Fixed by #1522

Comments

@research11111
Copy link
Contributor

research11111 commented Nov 5, 2023

Avogadro version:

  • Avogadrolibs: 1.98.1
  • Qt: 5.15.2

Desktop version:

  • OS: [e.g. MacOS]
  • Version [e.g. 14.0]

Describe the bug
When using Build/Insert/SMILES menu a popup show "No line format readers found!"

To Reproduce
Steps to reproduce the behavior:

  1. Open avogadro
  2. Click on 'Build' menu
  3. Select 'Insert'
  4. Click on 'SMILES...'

Expected behavior
The popup should show up with a qt line text box.

Screenshots
Capture d’écran 2023-11-05 à 12 20 45

Additional context
Corresponding binary
Same behavirour for insert InChl
previous version have also that issue

Copy link

welcome bot commented Nov 5, 2023

Thanks for opening your first issue here! Please try to include example files and screenshots if possible. If you're looking for support, please post on our forum: https://discuss.avogadro.cc/

@research11111
Copy link
Contributor Author

research11111 commented Nov 5, 2023

Source of the issue: obabel not correctly finding shared libs
when running manually babel:

(base) bash-3.2$ /Applications/Avogadro2.app/Contents/MacOS/obabel 
dyld[1599]: Library not loaded: @executable_path/../Frameworks/libopenbabel.7.dylib
  Referenced from: <D1034614-E7C2-3333-B224-5D94919E784D> /Applications/Avogadro2.app/Contents/MacOS/obabel
  Reason: tried: '/Applications/Avogadro2.app/Contents/Frameworks/libopenbabel.7.dylib' (no such file)
Abort trap: 6

Avoagadro2.app package:
./Contents/Frameworks/
do not contains this file libopenbabel.7.dylib

Solutions that can be applied:

1. include libopenbabel in the Avoagadro2.app and modify the binary with install_name_tool so shared library gets from ./Contents/Frameworks/.
     every thing is packaged, no user action needed

2. Allow DYLD_LIBRARY_PATH even with mac SIP 	https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_allow-dyld-environment-variables?language=objc  
     then run avogadro with export DYLD_LIBRARY_PATH=/opt/homebrew/lib

3. Add the standard shared library location : /usr/local/lib/ the rpath of avogadro
     then install open babel in that location

@research11111
Copy link
Contributor Author

intel mac version do not search in the location "application directory"

(base) bash-3.2$ otool -L /Volumes/Avogadro2-1.98.1\ 2/Avogadro2.app/Contents/MacOS/obabel 
/Volumes/Avogadro2-1.98.1 2/Avogadro2.app/Contents/MacOS/obabel:
	/Users/runner/work/avogadrolibs/build/prefix/lib/libopenbabel.7.dylib (compatibility version 7.0.0, current version 7.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)

as arm64 version does

/Applications/Avogadro2.app/Contents/MacOS/obabel:
	@executable_path/../Frameworks/libopenbabel.7.dylib (compatibility version 7.0.0, current version 7.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1600.151.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1336.0.0)

@research11111
Copy link
Contributor Author

As temp fix only for arm64 builds:

brew install open-babel
cp /opt/homebrew/lib/libopenbabel.* /Applications/Avogadro2.app/Contents/Frameworks/

@research11111
Copy link
Contributor Author

Issue has been introduced in 1.98.0 build (1.97.0 is working)

@ghutchis
Copy link
Member

ghutchis commented Nov 5, 2023

Thanks for the bug report. Between 1.97 and 1.98 there were a bunch of changes to the build system, and it helps a lot (since I obviously have libopenbabel installed.

Avoagadro2.app package: ./Contents/Frameworks/ do not contains this file libopenbabel.7.dylib

Huh. That happened on Windows too. Not sure why the Intel version also doesn't have the corrected path for obabel either.

@ghutchis ghutchis changed the title SMILES input lead to "No line format readers found!" Mac builds for 1.98 have broken Open Babel Nov 11, 2023
@sulimovv
Copy link

sulimovv commented Dec 3, 2023

As temp fix only for arm64 builds:

brew install open-babel
cp /opt/homebrew/lib/libopenbabel.* /Applications/Avogadro2.app/Contents/Frameworks/

Thank you very match!
That's works for me on Monterey 12.7.1 (ARM)

ghutchis added a commit to ghutchis/avogadrolibs that referenced this issue Dec 11, 2023
Should address OpenChemistry#1443

Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
@ghutchis ghutchis linked a pull request Dec 12, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants