Skip to content

Instantly share code, notes, and snippets.

@V0XNIHILI
Last active September 2, 2024 17:04
Show Gist options
  • Save V0XNIHILI/61d1e46684de56357990b5f75a14b8cc to your computer and use it in GitHub Desktop.
Save V0XNIHILI/61d1e46684de56357990b5f75a14b8cc to your computer and use it in GitHub Desktop.
How to compile GTKWave for Apple Silicon (M1/M2/M3 Macs)

How to compile GTKWave for Apple Silicon (M1/M2/M3 Macs)

Based on this tutorial for the M1 Mac, find below a step-by-step guide on how to compile GTKWave from scratch for the M3 MacBook (Pro). See my LinkedIn post with the short announcement here.

Note: it is a prerequisite to have HomeBrew installed (find installation instructions at site).

Steps

1. Install required Homebrew packages

brew install gtk+3 gtk-mac-integration tcl-tk desktop-file-utils meson cmake pango libffi zlib expat shared-mime-info

2. Set linker, compiler and package environment variables

export LDFLAGS="-L/opt/homebrew/opt/libffi/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libffi/include"
export PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:/opt/homebrew/opt/libffi/lib/pkgconfig:/opt/homebrew/opt/zlib/lib/pkgconfig:/opt/homebrew/opt/gtk+3/lib/pkgconfig:/opt/homebrew/opt/expat/lib/pkgconfig"

3. Build, compile and install GTKWave

git clone "[email protected]:gtkwave/gtkwave.git"
cd gtkwave
meson setup build -Dintrospection=false
meson compile -C build
meson install -C build

4. Run GTKWave!

gtkwave
@Kurumiiw
Copy link

Kurumiiw commented Sep 2, 2024

I had the same error as @MicroGrit , it turns out the directory was already populated with a gtkwave. (Probably from a previous installation attempt?)

I fixed it by simply doing rm /opt/homebrew/bin/gtkwave, and then running meson install -C build again.
Hope this helps.

Thank you for the rundown @V0XNIHILI ! I had issues getting gtkwave to run on my M1 but this fixed my issues and I have a working build now.

@V0XNIHILI
Copy link
Author

@Kurumiiw happy to hear, enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment