Skip to content

Instantly share code, notes, and snippets.

@urbanij
Created November 26, 2021 21:05
Show Gist options
  • Save urbanij/ea2a4c355c1827ec9e52b5a3dfab9a74 to your computer and use it in GitHub Desktop.
Save urbanij/ea2a4c355c1827ec9e52b5a3dfab9a74 to your computer and use it in GitHub Desktop.
Invoke gtkwave from CLI on macOS (Catalina)

GTKWave from CLI on macOS (Catalina)

based on this article https://ughe.github.io/2018/11/06/gtkwave-osx (which does not work for me, as is)

  • Motivation

While installing and running GTKWave is straightforward on macOS, it is slightly more difficult to get the command line tool running properly:

$ /Applications/gtkwave.app/Contents/Resources/bin/gtkwave
Can't locate Switch.pm in @INC (you may need to install the Switch module) (@INC contains: /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.4 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /Applications/gtkwave.app/Contents/Resources/bin/gtkwave line 2.
BEGIN failed--compilation aborted at /Applications/gtkwave.app/Contents/Resources/bin/gtkwave line 2.



  • Fix

you need the same version of Perl that gtkwave uses under the hood, seemingly 5.18.

brew install perl@5.18

then follow what the article suggests with slightly modified commands, according to the version of Perl

/usr/local/Cellar/perl@5.18/5.18.4_1/bin/cpan install Switch
sudo cp /usr/local/Cellar/perl@5.18/5.18.4_1/lib/site_perl/5.18.4/Switch.pm /Library/Perl/5.18/
ln -s /Applications/gtkwave.app/Contents/Resources/bin/gtkwave /usr/local/bin

done, now you call gtkwave from any location.

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