我最近尝试用ghdl编译.vhd文件
ghdl -a --ieee=synopsys --work=work Matrix_Data_Structure.vhd
,出现以下错误:
ghdl:error: installation problem: ghdl1-llvm not found
我在 MacOS 系统上运行 ghdl,安装有
brew
我也尝试安装
llvm
并添加到 zshrc
的路径:
echo 'export PATH="/opt/homebrew/opt/llvm@12/bin:$PATH"' >> ~/.zshrc
echo 'export LDFLAGS="-L/opt/homebrew/opt/llvm@12/lib"' >> ~/.zshrc
echo 'export CPPFLAGS="-I/opt/homebrew/opt/llvm@12/include"' >> ~/.zshrc
以及卸载 ghdl 并重新安装 ghdl,同样的错误消息仍然存在
------编辑:额外信息---------------------------------------- --------
ghdl --version GHDL 4.1.0 (4.0.0.r39.g7188e92cf) [Dunoon edition]
操作系统版本:
macOS Sonoma version 14.6
GDHL路径:/opt/homebrew/bin/ghdl
问题解决了,直接从ghdl存储库中git克隆,然后构建并安装它,然后添加路径到
zshrc
:
# Clone the LLVM repository
git clone https://github.com/llvm/llvm-project.git
cd llvm-project
# Create a build directory
mkdir build
cd build
# Configure the build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/llvm ../llvm
# Build and install LLVM
make
sudo make install
# Add paths to .zshrc
echo 'export PATH="/usr/local/llvm/bin:$PATH"' >> ~/.zshrc
echo 'export LDFLAGS="-L/usr/local/llvm/lib"' >> ~/.zshrc
echo 'export CPPFLAGS="-I/usr/local/llvm/include"' >> ~/.zshrc
echo 'export DYLD_LIBRARY_PATH="/usr/local/llvm/lib:$DYLD_LIBRARY_PATH"' >> ~/.zshrc
# Apply the changes
source ~/.zshrc
# Verify the installation
llvm-config --version