Citus source code build error on linux 20.04. with postgres 14

55 Views Asked by At

I have postgres 14. I also had postgres 16 before which was removed. I want to build citus source code using postgres 14. But the compiler keeps checking for postgres 16 folder. I tried few ways(symbolic link, changing PATH) but didn't succeed. How do I resolve this?

Below is where the compiler is pointing to postgres 16 and the error:

make -C src/backend/columnar all
make[1]: Entering directory '/data/mak/citus/src/backend/columnar'
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -fvisibility=hidden -std=gnu99 -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-missing-field-initializers -Wno-clobbered -Wno-declaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wmissing-declarations -Wmissing-prototypes -Wshadow -Werror=vla -Werror=implicit-int -Werror=implicit-function-declaration -Werror=return-type -fstack-clash-protection -DGIT_VERSION=""main(sha: dbdde11)"" -I '/data/mak/citus/src/include' -I'../../../src/include' -I/usr/include/postgresql -I/data/mak/citus/vendor/safestringlib/include -I. -I./ -I/usr/include/postgresql/16/server -I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -c -o columnar.o columnar.c
columnar.c:17:10: fatal error: postgres.h: No such file or directory
17 | #include "postgres.h"
| ^~~~~~~~~~~~
compilation terminated.
make[1]: *** [: columnar.o] Error 1
make[1]: Leaving directory '/data/mak/citus/src/backend/columnar'
make: *** [Makefile:19: columnar] Error 2

symbolic link, changing PATH

1

There are 1 best solutions below

0
On

Adrian's comment is correct.

You are likely pointing at incorrect pg_config (i.e. binary of 16), you can quickly verify that using "which pg_config", adjust your PATH to point to pg14/bin/pg_config, it should work.