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 binary #94

Open
kazu-yamamoto opened this issue Jun 10, 2019 · 14 comments
Open

Mac binary #94

kazu-yamamoto opened this issue Jun 10, 2019 · 14 comments

Comments

@kazu-yamamoto
Copy link

Mac binary v0.2.11.1 causes the following error:

% ./threadscope.osx 
dyld: Library not loaded: /usr/local/opt/gtk-mac-integration/lib/libgtkmacintegration-gtk2.2.dylib
  Referenced from: /Users/kazu/./threadscope.osx
  Reason: image not found
zsh: abort      ./threadscope.osx

Is it possible to provide a statically-lined version?

@maoe
Copy link
Member

maoe commented Jun 14, 2019

Do you have the shared library installed? It's called gtk-mac-integration in Homebrew.

I'm personally hesitant to statically link GTK+ libraries or distribute GTK+ shared libraries because

  • GTK+ is huge. If we statically link it or bundle it, we need to repackage every time one of the libraries fixes a critical bug.
  • It has become easy to install the GTK+ dependencies. Homebrew provides good support for GTK+. Windows has MSYS2.
  • I'm not sure about the licensing implications.

@kazu-yamamoto
Copy link
Author

I'm a MacPort user. But I have installed gtk-mac-integration by brew now. It's working. Thanks!

I think that the doc should say the binary distributions also require gtk-mac-integration by brew.

@maoe
Copy link
Member

maoe commented Jun 14, 2019

I think that the doc should say the binary distributions also require gtk-mac-integration by brew.

Thanks for the suggestion. I'll make a fix.

I'm wondering if there's gtk-mac-integration in MacPorts? A quick search turned up some packages that look relevant:
https://www.macports.org/ports.php?by=name&substr=gtk-osx-application

If we can sort out what packages are required in MacPorts, we can extend the README with the instructions for MacPorters.

@maoe
Copy link
Member

maoe commented Jun 14, 2019

I think that the doc should say the binary distributions also require gtk-mac-integration by brew.

Apparently we have this in README:

On OS X, gtk-mac-integration also needs to be installed.

brew install gtk+ gtk-mac-integration

@kazu-yamamoto
Copy link
Author

I read it for building, not for binary release ones.

@kazu-yamamoto
Copy link
Author

It's hard to understand that gtk-mac-application is the same as gtk-mac-integration. Anyway, I will try.

@maoe
Copy link
Member

maoe commented Jun 14, 2019

I read it for building, not for binary release ones.

Okay, it's under the "Using pre-built binaries" section though. Maybe the REAME should be refined a bit.

It's hard to understand that gtk-mac-application is the same as gtk-mac-integration.

Yeah the same naming convention is used in haskell-gi. We should update the README for this as well.

@asarkar
Copy link

asarkar commented Jan 22, 2023

Apparently we have this in README:

On OS X, gtk-mac-integration also needs to be installed.

This is no longer correct. I'm not seeing any mention of gtk-mac-integration in the README.

I'm on a Mac M1 Pro, and have installed gtk+ and gtk-mac-integration using Homebrew. I've downloaded the latest ThreadScope binary, made it executable, but I get the following error:

dyld[71380]: Library not loaded: /usr/local/opt/gtk+/lib/libgtk-quartz-2.0.0.dylib
  Referenced from: <9CF49DF9-CBA5-35C1-A977-73FA218C7F56> /me/Downloads/threadscope.macOS-latest.ghc-9.2.2
  Reason: tried: '/usr/local/opt/gtk+/lib/libgtk-quartz-2.0.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/gtk+/lib/libgtk-quartz-2.0.0.dylib' (no such file), '/usr/local/opt/gtk+/lib/libgtk-quartz-2.0.0.dylib' (no such file), '/usr/local/lib/libgtk-quartz-2.0.0.dylib' (no such file), '/usr/lib/libgtk-quartz-2.0.0.dylib' (no such file, not in dyld cache)
zsh: abort

The file libgtk-quartz-2.0.0.dylib is actually under /opt/homebrew/Cellar/gtk+/2.24.33/lib/, which is where Homebrew installs stuff for Apple Silicon.

Creating a symlink doesn't work either.

(mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

@maoe
Copy link
Member

maoe commented Jan 25, 2023

Ah yes, the macOS binaries in the releases are for Intel Macs. We need to configure GitHub Actions to make a binary for Apple Silicon. I don't know if GitHub provides runners that have Apple Silicon though.

@maoe
Copy link
Member

maoe commented Jan 25, 2023

I don't know if GitHub provides runners that have Apple Silicon though.

Looks like they don't yet. actions/runner-images#2187

@matheussbernardo
Copy link

I am still struggling to get threadscope to work on m1 pro.

My current problem is

/var/folders/bt/jl2x0sgd1s79sbzyc9l3_zmw0000gp/T/ghc24998_0/ghc_2544.c:19:17: error: error: incompatible pointer to integer conversion assigning to 'ffi_arg' (aka 'unsigned long') from 'HsPtr' (aka 'void *') [-Wint-conversion] | 19 | *(ffi_arg*)resp = cret; | ^ *(ffi_arg*)resp = cret;

@Mikolaj
Copy link
Member

Mikolaj commented Apr 5, 2024

I'm sorry to hear that. Is it when compiling ThreadScope or one of its dependencies?

@matheussbernardo
Copy link

The problem is gtk! I think I have all the dependencies.

@Mikolaj
Copy link
Member

Mikolaj commented Apr 5, 2024

I wonder where you could get help. Maybe #haskell:matrix.org? You are not the only person having trouble compiling (old) gtk packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants