Homebrew installs the LLVM version of GHDL. Unfortunately, currently, there is an issue with Apple's LLVM and GHDL. Hence, we will use the mcode version of GHDL.
Download the mcode version of GHDL from the official github repo and then replace the brew-installed LLVM version with the manually downloaded mcode version.
- Download ghdl with brew
brew install ghdl
- Download the mcode version of ghdl (the file named
ghdl-macos-11-mcode) from the official release of GHDL - Unzip the downloaded
ghdl-macos-11-mcode.tgz - Go to
/opt/homebrew/Caskroom/ghdl/<version>(version 3.0.0 at the time of writing this) and delete thebin,includeandlibdirectories (these contain the llvm version that is causing problems) - Copy the
bin,includeandlibdirectories from the unzippedghdl-macos-11-mcodedirectory to the/opt/homebrew/Caskroom/ghdl/<version>directory
We are done! You can now call the ghdl command from a new terminal shell**. For example,
ghdl --version** You might have to go to the Privacy and Security settings of your mac to allow the execution of ghdl when you run it for the first time.
If, for whatever reason, ghdl is updated by Homebrew and the issue still exists with Apple's LLVM and GHDL, then you will need to redo the process outlined in the solution.
The reason why we are not directly installing and using the mcode version from the release, is that it would require placing the downloaded files into the /bin, /include and /lib directories which can be bothersome since they are protected by the OS.
There are certainly other ways of doing it, but I found that this way is quite simple and easy to revert (simply run brew reinstall ghdl or brew uninstall ghdl).