OS:centos 7.2
PG:11.3
问题一:
# make check USE_PGXS=1 make: pg_config: Command not found make: *** No rule to make target `check'. Stop.
处理方法:
# yum install postgresql11-devel-11.3
如果安装之后还没有该命令,可以看看环境变量的设置:
export PATH=$PATH:/usr/pgsql-11/bin
问题二:
# make USE_PGXS=1 gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -I. -I./ -I/usr/pgsql-11/include/server -I/usr/pgsql-11/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -c -o pgaudit.o pgaudit.c In file included from /usr/pgsql-11/include/server/libpq/auth.h:17:0, from pgaudit.c:26: /usr/pgsql-11/include/server/libpq/libpq-be.h:23:25: fatal error: openssl/ssl.h: No such file or directory #include <openssl/ssl.h> ^ compilation terminated. make: *** [pgaudit.o] Error 1
处理方法:
yum install openssl-devel
问题三:
# make USE_PGXS=1 gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -I. -I./ -I/usr/pgsql-11/include/server -I/usr/pgsql-11/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -c -o pgaudit.o pgaudit.c gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -shared -o pgaudit.so pgaudit.o -L/usr/pgsql-11/lib -Wl,--as-needed -L/usr/lib64/llvm5.0/lib -L/usr/lib64 -Wl,--as-needed -Wl,-rpath,'/usr/pgsql-11/lib',--enable-new-dtags /opt/rh/llvm-toolset-7/root/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -O2 -I. -I./ -I/usr/pgsql-11/include/server -I/usr/pgsql-11/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -flto=thin -emit-llvm -c -o pgaudit.bc pgaudit.c make: /opt/rh/llvm-toolset-7/root/usr/bin/clang: Command not found make: *** [pgaudit.bc] Error 127
处理方法:
# 添加yum源 cat << EOF > /etc/yum.repos.d/c7-devtoolset-7-x86_64.repo [c7-devtoolset-7] name=c7-devtoolset-7 baseurl=https://buildlogs.centos.org/c7-devtoolset-7.x86_64/ gpgcheck=0 enabled=1 [c7-llvm-toolset-7] name=c7-llvm-toolset-7 baseurl=https://buildlogs.centos.org/c7-llvm-toolset-7.x86_64/ gpgcheck=0 enabled=1 [fedoraproject-epel-7] name=fedoraproject-epel-7 baseurl=https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/ gpgcheck=0 enabled=1 EOF # 安装 yum install -y llvm5.0-devel llvm-toolset-7-clang