File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -86,19 +86,19 @@ cd ~/postgresql-18.0/build_postgres
8686```
8787
8888``` bash [编译指令]
89+ # 同时存在 clang 和 gcc 时,需指定 clang 和 clang++ 作为编译器,因为pgsql专门对clang进行了优化
90+ export CC=/usr/bin/clang
91+ export CXX=/usr/bin/clang++
92+ export LLVM_CONFIG=/usr/bin/llvm-config-19
8993# 使用postgres账户编译
9094# 开发环境:建议一律启用 --enable-debug 和 --enable-cassert 选项
9195# 部署环境:
9296# 1. --enable-debug 选项本身不影响查询效率,但使用 llvm+clang 编译器套件时不能启用,因为该选项通常会禁用llvm编译器对pgsql的性能优化
9397# 2. 一律不启用 --enable-cassert 选项 ,这会影响查询速度
94- # LLVM_CONFIG 的路径在不同发行版有所区别,这里展示的是debian13下的路径
9598../configure --prefix=/server/postgres \
9699--enable-debug \
97100--enable-cassert \
98- CC=clang \
99- CXX=clang++ \
100101--with-llvm \
101- LLVM_CONFIG=/usr/lib/llvm-19/bin/llvm-config \
102102--with-pam \
103103--with-systemd \
104104--with-uuid=e2fs \
You can’t perform that action at this time.
0 commit comments