使用PostgreSQL v11安装Apache AGE时链接器命令失败

kse8i1jr  于 2023-03-29  发布在  PostgreSQL
关注(0)|答案(4)|浏览(152)

我正在尝试安装Apache AGE for PostgreSQL v11,但在运行make install命令时,我一直收到错误。以下是我在运行该命令时收到的消息:

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

我从REL_11_STABLE分支安装了PostgreSQL,并尝试从masterPG11分支安装AGE。以下是我在configure命令中使用的标志:

./configure --prefix=/usr/local/pgsql --enable-cassert --enable-debug CFLAGS="-glldb -ggdb -O0 -g3 -fno-omit-frame-pointer"
5sxhfpxr

5sxhfpxr1#

这是安装软件时最常见的问题之一。其原因是链接器无法找到库或库有一些问题。
您可以尝试以下操作:
1.验证是否已安装并更新所有依赖项。
1.验证为库提供的路径是否正确&命名中没有冲突。
1.编译时尝试使用不同的标志。
如果您是MAC用户,请单击here for stack overflow referencehere for detailed blog post

ryhaxcpt

ryhaxcpt2#

请确保已安装PostgreSQL 11并正确运行。尝试安装和更新所有依赖项

sudo apt-get update
sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison
sudo apt install postgresql-server-dev-11

然后使用以下命令:

make PG_CONFIG=/path/to/postgres/bin/pg_config install

/path/to/postgres替换为Postgres的实际文件位置。

make PG_CONFIG=/usr/local/pgsql/bin/pg_config install

Apache AGE Setup的链接

lzfw57am

lzfw57am3#

首先删除CFLAGS,尝试安装
./configure --prefix=/usr/local/pgsql --enable-cassert --enable-debug CFLAGS=”-O0 -g3 -fno-omit-frame-pointer”

jum4pzuy

jum4pzuy4#

我已经通过重新克隆AGE仓库并使用master分支进行安装解决了这个问题。我不确定是什么问题,因为我在之前尝试安装之前确实从仓库中拉出来了。

相关问题