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).
brew install gtk+3 gtk-mac-integration tcl-tk desktop-file-utils meson cmake pango libffi zlib expat shared-mime-info
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"
git clone "[email protected]:gtkwave/gtkwave.git"
cd gtkwave
meson setup build -Dintrospection=false
meson compile -C build
meson install -C build
gtkwave
When executing the command
meson install -C build
, if an error is reported, how can this issue be resolved?Dropping privileges to 'w' before running ninja...
ninja: Entering directory `/Users/w/workshop/workshop/gtkwave/build'
[20/20] Generating lib/libgtkwave/test/generate-dump-timezero.fst with a custom command (wrapped by meson to set env, to capture output)
Installing lib/libgtkwave/src/libgtkwave.dylib to /opt/homebrew/lib
Installing src/helpers/evcd2vcd to /opt/homebrew/bin
Installing src/helpers/fst2vcd to /opt/homebrew/bin
Installing src/helpers/fstminer to /opt/homebrew/bin
Installing src/helpers/lxt2miner to /opt/homebrew/bin
Installing src/helpers/lxt2vcd to /opt/homebrew/bin
Installing src/helpers/vcd2fst to /opt/homebrew/bin
Installing src/helpers/vcd2lxt to /opt/homebrew/bin
Installing src/helpers/vcd2lxt2 to /opt/homebrew/bin
Installing src/helpers/vcd2vzt to /opt/homebrew/bin
Installing src/helpers/vzt2vcd to /opt/homebrew/bin
Installing src/helpers/vztminer to /opt/homebrew/bin
Installing src/gtkwave to /opt/homebrew/bin
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.12/site-packages/mesonbuild/mesonmain.py", line 188, in run
return options.run_func(options)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.12/site-packages/mesonbuild/minstall.py", line 869, in run
installer.do_install(datafilename)
File "/opt/homebrew/lib/python3.12/site-packages/mesonbuild/minstall.py", line 549, in do_install
self.install_targets(d, dm, destdir, fullprefix)
File "/opt/homebrew/lib/python3.12/site-packages/mesonbuild/minstall.py", line 746, in install_targets
file_copied = self.do_copyfile(fname, outname, makedirs=(dm, outdir))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.12/site-packages/mesonbuild/minstall.py", line 426, in do_copyfile
self.copy2(from_file, to_file)
File "/opt/homebrew/lib/python3.12/site-packages/mesonbuild/minstall.py", line 323, in copy2
shutil.copy2(*args, **kwargs)
File "/opt/homebrew/Cellar/[email protected]/3.12.5/Frameworks/Python.framework/Versions/3.12/lib/python3.12/shutil.py", line 475, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/opt/homebrew/Cellar/[email protected]/3.12.5/Frameworks/Python.framework/Versions/3.12/lib/python3.12/shutil.py", line 262, in copyfile
with open(dst, 'wb') as fdst:
^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/opt/homebrew/bin/gtkwave'
ERROR: Unhandled python OSError. This is probably not a Meson bug, but an issue with your build environment.