fract4d / gnofract4d

A fractal generation program for linux
Other
115 stars 29 forks source link

install fails on apple silicon #241

Closed troyfolger closed 2 years ago

troyfolger commented 3 years ago
brew install librsvg python3 pkg-config cairo gtk+3 pygobject3 py3cairo libpng jpeg
pip3 install https://github.com/fract4d/gnofract4d/releases/download/v4.3/gnofract4d-4.3.tar.gz

... performing the above installs gnofract to the /opt/homebrew directory tree, but running gnofract4d will fail with libpango errors:

** (process:42120): WARNING **: 12:23:35.954: Failed to load shared library 'libpango-1.0.0.dylib' referenced by the typelib: dlopen(libpango-1.0.0.dylib, 9): image not found

trying again with DYLD_FALLBACK_LIBRARY_PATH specified yields:

$ DYLD_FALLBACK_LIBRARY_PATH=/opt/homebrew/lib gnofract4d
Segmentation fault: 11
dragonmux commented 3 years ago

I don't see you brew installing libpango, which I would assume is required (GTK 3 can IIRC be built without Pango support - it's up to you to pick how you want fonts supported).

Please try this and let us know if this resolves the issue.

If it does not, please run gnofract4d with GDB (DYLIB_FALLBACK_LIBRARY_PATH=/opt/homebrew/lib gdb gnofract4d) and run it with the following prompt commands: r, bt, q, copying the result of the bt command here so we can get a feel for where it's crashing. This is best done on a build that has debug symbols and has not been optimised (-O0 -g).

troyfolger commented 3 years ago

Well, those install steps were copied straight from the macos instructions from the README.md. I believe libpango is installed as a dependency to one of those packages. When I perform

brew install pango

... I get the message "Warning: pango 1.48.4 is already installed and up-to-date." To confirm:

 $ brew ls -v pango | grep libpango
/opt/homebrew/Cellar/pango/1.48.4/lib/libpango-1.0.0.dylib
/opt/homebrew/Cellar/pango/1.48.4/lib/libpangoft2-1.0.0.dylib
/opt/homebrew/Cellar/pango/1.48.4/lib/libpangocairo-1.0.dylib
/opt/homebrew/Cellar/pango/1.48.4/lib/libpangocairo-1.0.0.dylib
/opt/homebrew/Cellar/pango/1.48.4/lib/libpangoft2-1.0.a
/opt/homebrew/Cellar/pango/1.48.4/lib/libpangocairo-1.0.a
/opt/homebrew/Cellar/pango/1.48.4/lib/libpangoft2-1.0.dylib
/opt/homebrew/Cellar/pango/1.48.4/lib/libpango-1.0.dylib
/opt/homebrew/Cellar/pango/1.48.4/lib/libpango-1.0.a

Checking for the library links shows that they are there:

$ find /opt/homebrew/ | grep libpango
/opt/homebrew//lib/libpango-1.0.0.dylib
/opt/homebrew//lib/libpangoft2-1.0.0.dylib
/opt/homebrew//lib/libpangocairo-1.0.dylib
/opt/homebrew//lib/libpangocairo-1.0.0.dylib
/opt/homebrew//lib/libpangoft2-1.0.a
/opt/homebrew//lib/libpangocairo-1.0.a
/opt/homebrew//lib/libpangoft2-1.0.dylib
/opt/homebrew//lib/libpango-1.0.dylib
/opt/homebrew//lib/libpango-1.0.a
/opt/homebrew//lib/libpangomm-2.48.1.dylib
/opt/homebrew//lib/libpangomm-2.48.dylib
/opt/homebrew//Cellar/pango/1.48.4/lib/libpango-1.0.0.dylib
/opt/homebrew//Cellar/pango/1.48.4/lib/libpangoft2-1.0.0.dylib
/opt/homebrew//Cellar/pango/1.48.4/lib/libpangocairo-1.0.dylib
/opt/homebrew//Cellar/pango/1.48.4/lib/libpangocairo-1.0.0.dylib
/opt/homebrew//Cellar/pango/1.48.4/lib/libpangoft2-1.0.a
/opt/homebrew//Cellar/pango/1.48.4/lib/libpangocairo-1.0.a
/opt/homebrew//Cellar/pango/1.48.4/lib/libpangoft2-1.0.dylib
/opt/homebrew//Cellar/pango/1.48.4/lib/libpango-1.0.dylib
/opt/homebrew//Cellar/pango/1.48.4/lib/libpango-1.0.a
/opt/homebrew//Cellar/pangomm/2.48.0/lib/libpangomm-2.48.1.dylib
/opt/homebrew//Cellar/pangomm/2.48.0/lib/libpangomm-2.48.dylib

Regarding gdb ... I don't think that gdb is available for Apple silicon yet ...

$ brew install gdb
Error: gdb: no bottle available!
You can try to install from source with:
  brew install --build-from-source gdb
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.

https://formulae.brew.sh/formula/gdb

troyfolger commented 3 years ago

Full error output:

 $ DYLIB_FALLBACK_LIBRARY_PATH=/opt/homebrew/lib gnofract4d

** (process:32292): WARNING **: 22:21:37.472: Failed to load shared library 'libpango-1.0.0.dylib' referenced by the typelib: dlopen(libpango-1.0.0.dylib, 9): image not found
A fatal error occurred:

Traceback (most recent call last):
  File "/opt/homebrew/bin/gnofract4d", line 92, in <module>
    main(sys.argv[1:])
  File "/opt/homebrew/bin/gnofract4d", line 40, in main
    gtkmain(userConfig, opts)
  File "/opt/homebrew/bin/gnofract4d", line 50, in gtkmain
    from gi.repository import Gtk
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "/opt/homebrew/lib/python3.9/site-packages/gi/importer.py", line 144, in load_module
    importlib.import_module('gi.repository.' + dep.split("-")[0])
  File "/opt/homebrew/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "/opt/homebrew/lib/python3.9/site-packages/gi/importer.py", line 144, in load_module
    importlib.import_module('gi.repository.' + dep.split("-")[0])
  File "/opt/homebrew/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "/opt/homebrew/lib/python3.9/site-packages/gi/importer.py", line 145, in load_module
    dynamic_module = load_overrides(introspection_module)
  File "/opt/homebrew/lib/python3.9/site-packages/gi/overrides/__init__.py", line 118, in load_overrides
    override_mod = importlib.import_module(override_package_name)
  File "/opt/homebrew/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/opt/homebrew/lib/python3.9/site-packages/gi/overrides/Pango.py", line 41, in <module>
    FontDescription = override(FontDescription)
  File "/opt/homebrew/lib/python3.9/site-packages/gi/overrides/__init__.py", line 195, in override
    assert g_type != TYPE_NONE
AssertionError

I'm just guessing, but perhaps python or gtk/pango dependencies have updated since the gnofract4d 4.3 release, and now the g_type assertion is failing?

troyfolger commented 3 years ago

OK, I did some more research, it looks like this is an upstream problem with homebrew: https://github.com/Homebrew/homebrew-core/issues/75020

There is a pull request awaiting merge: https://github.com/Homebrew/homebrew-core/pull/76383

I'm watching the PR and I can comment if this fixes the issue, hopefully any day now.

troyfolger commented 2 years ago

well, I have been occasionally upgrading brew packages and checking for gnofract4d success for about 8 months, now ... and, today, it is working! Looking at the list of what was updated, it isn't obvious what finally fixed things. But, gnofract4d is definitely working on Apple silicon, and I was able to enable 8 threads and that works, too (and performs very well, check it out).

Closing.

dragonmux commented 2 years ago

Thanks for the update troyfolger - and glad that you've finally got success!