I was installing Apache AGE using this guide https://age.apache.org/age-manual/master/intro/setup.html and have used sudo apt install postgresql-12
to install postgresql, but doing make install
in the age git directory is fetching me the following error:
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -ggdb -Og -fno-omit-frame-pointer -fPIC -I.//src/include -I.//src/include/parser -I. -I./ -I/usr/include/postgresql/server -I/usr/include/postgresql/internal -D_GNU_SOURCE -c -o src/backend/catalog/ag_graph.o src/backend/catalog/ag_graph.c
src/backend/catalog/ag_graph.c: In function ‘insert_graph’:
src/backend/catalog/ag_graph.c:67:15: error: void value not ignored as it ought to be
67 | graph_oid = CatalogTupleInsert(ag_graph, tuple);
| ^
make: *** [<builtin>: src/backend/catalog/ag_graph.o] Error 1
My pg_config path is usr/include/postgresql/pg_config.h
and earlier I was having the following error:
de/postgresql/internal -D_GNU_SOURCE -c -o src/backend/age.o src/backend/age.c
src/backend/age.c:20:10: fatal error: postgres.h: No such file or directory
20 | #include "postgres.h"
| ^~~~~~~~~~~~
compilation terminated.
make: *** [<builtin>: src/backend/age.o] Error 1
which I corrected by changing the path of server
from usr/include/postgresql/12/server/
to usr/include/postgresql/server
as pg_config
has that path as described by this How to fix 'postgres.h' file not found problem?.
I think that maybe my postgresql is not compatible with age as the CatalogTupleInsert
is defined in postgres so maybe that is returning void instead of graph_oid
. I have tried source code installation and it is working but I was not able to figure out why this error was there.
I am using WSL2 with Ubuntu 20.04.2 LTS and the postgresql version was 12.13
2
Answers
I guess you’re trying to install AGE from source code? If so, the master branch of AGE is compatible only with PostgreSQL version 12, you may need to change the branch before the
make
command.Do this in the folder you wish to install Apache AGE:
It will create a folder named "age" with the source code compatible with PG12, compile and run the tests.
I was having similar problems following the installation via package management. I managed to solve this by following these steps:
Make sure you use the latest AGE release compatible with PostgreSQL 12: https://github.com/apache/age/releases/tag/PG12/v1.1.1-rc1.
Make sure you installed the
postgresql-server-dev-12
package. This package contains some files that may be missing to install AGE.As stated in the documentation, if the path to your Postgres installation is not in the PATH variable, add the path in the arguments:
Maybe PG_CONFIG is set to the wrong directory.