I am trying to install Apache AGE for PostgreSQL v11, but I keep getting errors when running the command make install
. Here are the messages I get from running the command:
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -g -glldb -ggdb -Og -g3 -fno-omit-frame-pointer -I.//src/include -I.//src/include/parser -I. -I./ -I/usr/local/pgsql/include/server -I/usr/local/pgsql/include/internal -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk -c -o src/backend/catalog/ag_label.o src/backend/catalog/ag_label.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -g -glldb -ggdb -Og -g3 -fno-omit-frame-pointer -I.//src/include -I.//src/include/parser -I. -I./ -I/usr/local/pgsql/include/server -I/usr/local/pgsql/include/internal -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk -c -o src/backend/parser/cypher_analyze.o src/backend/parser/cypher_analyze.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -g -glldb -ggdb -Og -g3 -fno-omit-frame-pointer -I.//src/include -I.//src/include/parser -I. -I./ -I/usr/local/pgsql/include/server -I/usr/local/pgsql/include/internal -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk -c -o src/backend/parser/cypher_clause.o src/backend/parser/cypher_clause.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -g -glldb -ggdb -Og -g3 -fno-omit-frame-pointer -I.//src/include -I.//src/include/parser -I. -I./ -I/usr/local/pgsql/include/server -I/usr/local/pgsql/include/internal -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk -c -o src/backend/parser/cypher_expr.o src/backend/parser/cypher_expr.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -g -glldb -ggdb -Og -g3 -fno-omit-frame-pointer -I.//src/include -I.//src/include/parser -I. -I./ -I/usr/local/pgsql/include/server -I/usr/local/pgsql/include/internal -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk -c -o src/backend/utils/adt/agtype.o src/backend/utils/adt/agtype.c
src/backend/utils/adt/agtype.c:2363:9: warning: expression which evaluates to zero treated as a null pointer constant of type 'agtype_value *' (aka 'struct agtype_value *') [-Wnon-literal-null-conversion]
PG_RETURN_NULL();
^~~~~~~~~~~~~~~~
/usr/local/pgsql/include/server/fmgr.h:316:37: note: expanded from macro 'PG_RETURN_NULL'
do { fcinfo->isnull = true; return (Datum) 0; } while (0)
^~~~~~~~~
src/backend/utils/adt/agtype.c:5767:30: warning: converting the enum constant to a boolean [-Wint-in-bool-context]
Assert(itok == WAGT_ELEM || WAGT_END_ARRAY);
^
src/backend/utils/adt/agtype.c:9561:29: warning: converting the enum constant to a boolean [-Wint-in-bool-context]
Assert(itok == WAGT_KEY || WAGT_END_OBJECT);
^
3 warnings generated.
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -g -glldb -ggdb -Og -g3 -fno-omit-frame-pointer -I.//src/include -I.//src/include/parser -I. -I./ -I/usr/local/pgsql/include/server -I/usr/local/pgsql/include/internal -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk -c -o src/backend/utils/graph_generation.o src/backend/utils/graph_generation.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -g -glldb -ggdb -Og -g3 -fno-omit-frame-pointer -I.//src/include -I.//src/include/parser -I. -I./ -I/usr/local/pgsql/include/server -I/usr/local/pgsql/include/internal -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk -c -o src/backend/utils/load/age_load.o src/backend/utils/load/age_load.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -g -glldb -ggdb -Og -g3 -fno-omit-frame-pointer -bundle -multiply_defined suppress -o age.so src/backend/age.o src/backend/catalog/ag_catalog.o src/backend/catalog/ag_graph.o src/backend/catalog/ag_label.o src/backend/catalog/ag_namespace.o src/backend/commands/graph_commands.o src/backend/commands/label_commands.o src/backend/executor/cypher_create.o src/backend/executor/cypher_merge.o src/backend/executor/cypher_set.o src/backend/executor/cypher_utils.o src/backend/nodes/ag_nodes.o src/backend/nodes/cypher_copyfuncs.o src/backend/nodes/cypher_outfuncs.o src/backend/nodes/cypher_readfuncs.o src/backend/optimizer/cypher_createplan.o src/backend/optimizer/cypher_pathnode.o src/backend/optimizer/cypher_paths.o src/backend/parser/ag_scanner.o src/backend/parser/cypher_analyze.o src/backend/parser/cypher_clause.o src/backend/executor/cypher_delete.o src/backend/parser/cypher_expr.o src/backend/parser/cypher_gram.o src/backend/parser/cypher_item.o src/backend/parser/cypher_keywords.o src/backend/parser/cypher_parse_agg.o src/backend/parser/cypher_parse_node.o src/backend/parser/cypher_parser.o src/backend/parser/cypher_transform_entity.o src/backend/utils/adt/age_graphid_ds.o src/backend/utils/adt/agtype.o src/backend/utils/adt/agtype_ext.o src/backend/utils/adt/agtype_gin.o src/backend/utils/adt/agtype_ops.o src/backend/utils/adt/agtype_parser.o src/backend/utils/adt/agtype_util.o src/backend/utils/adt/age_global_graph.o src/backend/utils/adt/age_session_info.o src/backend/utils/adt/age_vle.o src/backend/utils/adt/cypher_funcs.o src/backend/utils/adt/ag_float8_supp.o src/backend/utils/adt/graphid.o src/backend/utils/ag_func.o src/backend/utils/graph_generation.o src/backend/utils/cache/ag_cache.o src/backend/utils/load/ag_load_labels.o src/backend/utils/load/ag_load_edges.o src/backend/utils/load/age_load.o src/backend/utils/load/libcsv.o src/backend/utils/name_validation.o -L/usr/local/pgsql/lib -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk -Wl,-dead_strip_dylibs -bundle_loader /usr/local/pgsql/bin/postgres
Undefined symbols for architecture x86_64:
"_pg_snprintf", referenced from:
_get_next_default_alias in cypher_parse_node.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [age.so] Error 1
I have PostgreSQL installed from the REL_11_STABLE
branch and have tried installing AGE from both the master
and PG11
branches. Here are the flags I have used for the configure
command:
./configure --prefix=/usr/local/pgsql --enable-cassert --enable-debug CFLAGS="-glldb -ggdb -O0 -g3 -fno-omit-frame-pointer"
4
Answers
I have solved this issue by re-cloning the AGE repository and using the
master
branch for the installation. I'm not sure what was the problem as I did pull from the repository before trying to install previously.It is one of the most common issues while installing the software. The reason for this is that the linker is unable to find the library or the library has some issues.
You can try the following:
If you are a MAC user, click here for stack overflow reference and here for detailed blog post.
Make sure you have PostgreSQL 11 installed and running correctly. Try installing and updating all dependencies
Then use this command:
Replace
/path/to/postgres
with the actual file location of Postgres. In your case, the file location should be/usr/local/pgsql
, so you can try thisLink for Apache AGE Setup
try installing by removing CFLAGS first
./configure –prefix=/usr/local/pgsql –enable-cassert –enable-debug CFLAGS=" -O0 -g3 -fno-omit-frame-pointer"