ThreadScope icon indicating copy to clipboard operation
ThreadScope copied to clipboard

Mac binary

Open kazu-yamamoto opened this issue 6 years ago • 16 comments

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?

kazu-yamamoto avatar Jun 10 '19 07:06 kazu-yamamoto

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.

maoe avatar Jun 14 '19 00:06 maoe

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.

kazu-yamamoto avatar Jun 14 '19 00:06 kazu-yamamoto

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 avatar Jun 14 '19 00:06 maoe

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

maoe avatar Jun 14 '19 00:06 maoe

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

kazu-yamamoto avatar Jun 14 '19 02:06 kazu-yamamoto

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

kazu-yamamoto avatar Jun 14 '19 02:06 kazu-yamamoto

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.

maoe avatar Jun 14 '19 02:06 maoe

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'))

asarkar avatar Jan 22 '23 11:01 asarkar

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 avatar Jan 25 '23 04:01 maoe

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

Looks like they don't yet. https://github.com/actions/runner-images/issues/2187

maoe avatar Jan 25 '23 04:01 maoe

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;

matheussbernardo avatar Apr 05 '24 13:04 matheussbernardo

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

Mikolaj avatar Apr 05 '24 13:04 Mikolaj

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

matheussbernardo avatar Apr 05 '24 13:04 matheussbernardo

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

Mikolaj avatar Apr 05 '24 13:04 Mikolaj