ubuntu18.04 apt 安装llvm11
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install libllvm-11-ocaml-dev libllvm11 llvm-11 llvm-11-dev llvm-11-doc llvm-11-examples llvm-11-runtime \
clang-11 clang-tools-11 clang-11-doc libclang-common-11-dev libclang-11-dev libclang1-11 clang-format-11 clangd-11 \
libfuzzer-11-dev lldb-11 lld-11 libc++-11-dev libc++abi-11-dev libomp-11-dev -y
也可以使用源码下载,但编译时间需要数小时,且卸载时没找到sudo make uninstall命令,不知道怎么卸载
undefined reference to `llvm::EnableABIBreakingChecks解决办法
在编译时添加变量-DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1
gcc或者clang编译时-Dmacro=value
,等同于#define,将macro定义为1