Error while installing Apache AGE using make install

huangapple go评论56阅读模式
英文:

Error while installing Apache AGE using make install

问题

我正在按照这个指南 https://age.apache.org/age-manual/master/intro/setup.html 安装 Apache AGE,并使用 sudo apt install postgresql-12 安装了 PostgreSQL,但在 age git 目录中运行 make install 时,我遇到了以下错误:

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

我的 pg_config 路径是 usr/include/postgresql/pg_config.h,之前我遇到以下错误:

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 &quot;postgres.h&quot;
      |          ^~~~~~~~~~~~
compilation terminated.
make: *** [<builtin>: src/backend/age.o] Error 1

我通过将 server 路径从 usr/include/postgresql/12/server/ 更改为 usr/include/postgresql/server 来纠正了这个错误,因为 pg_config 将该路径描述为 https://stackoverflow.com/questions/56724622/how-to-fix-postgres-h-file-not-found-problem 中所述。

我认为也许我的 PostgreSQL 与 AGE 不兼容,因为 CatalogTupleInsert 是在 PostgreSQL 中定义的,所以可能返回 void 而不是 graph_oid。我尝试了源代码安装,它可以正常工作,但我无法弄清楚为什么会出现这个错误。

我正在使用带有 Ubuntu 20.04.2 LTS 的 WSL2,PostgreSQL 版本是 12.13。

英文:

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: *** [&lt;builtin&gt;: 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 &quot;postgres.h&quot;
      |          ^~~~~~~~~~~~
compilation terminated.
make: *** [&lt;builtin&gt;: 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 https://stackoverflow.com/questions/56724622/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

答案1

得分: 0

我猜你正在尝试从源代码安装AGE?如果是这样,AGE的主分支只与PostgreSQL 12版本兼容,你可能需要在运行make命令之前切换分支。

在你希望安装Apache AGE的文件夹中执行以下操作:

git clone https://github.com/apache/age.git
git checkout AGE_PG12.1.0_ALPHA
make && make install
make installcheck

这将创建一个名为"age"的文件夹,其中包含与PG12兼容的源代码,编译并运行测试。

英文:

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:

git clone https://github.com/apache/age.git
git checkout AGE_PG12.1.0_ALPHA
make &amp;&amp; make install
make installcheck

It will create a folder named "age" with the source code compatible with PG12, compile and run the tests.

答案2

得分: 0

  1. 确保您使用与 PostgreSQL 12 兼容的最新 AGE 发行版:https://github.com/apache/age/releases/tag/PG12/v1.1.1-rc1。

  2. 确保您已安装了 postgresql-server-dev-12 软件包。该软件包包含一些可能缺少以安装 AGE 的文件。

  3. 正如文档中所述,如果您的 Postgres 安装路径不在 PATH 变量中,请在参数中添加路径:

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

也许 PG_CONFIG 设置为错误的目录。

英文:

I was having similar problems following the installation via package management. I managed to solve this by following these steps:

  1. Make sure you use the latest AGE release compatible with PostgreSQL 12: https://github.com/apache/age/releases/tag/PG12/v1.1.1-rc1.

  2. Make sure you installed the postgresql-server-dev-12 package. This package contains some files that may be missing to install AGE.

  3. As stated in the documentation, if the path to your Postgres installation is not in the PATH variable, add the path in the arguments:

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

Maybe PG_CONFIG is set to the wrong directory.

答案3

得分: 0

尝试安装postgresql-server-dev-12以包括postgres.h头文件的定义,并确保在运行make install时切换到与您尝试安装的Postgres版本兼容的正确分支,即与postgres-12兼容的版本。

英文:

Trying installing postgresql-server-dev-12 to include the definition of the postgres.h header, and also make sure while running make install you switch to the right branch for the Postgres version you are trying to install i.e age version compatible with postgres-12

答案4

得分: 0

这是我成功完成的步骤。

按照以下步骤进行。如果您有任何问题,请提问。

您应该安装与您的Postgres版本兼容的Apache Age版本。

  1. 检查已安装的Postgres版本。注意 'V' 是大写的。

    psql -V
    
  2. 从Github克隆Age源代码。

    git clone https://github.com/apache/age.git
    
  3. 进入Age目录

    cd age
    
  4. 切换到与您的Postgres版本对应的Age源代码分支。例如,如果是12版本,请切换到 'PG12' 分支。

    git checkout PG12
    

注意: 有三个切换选项,请确保正确拼写它们。它们包括 'PG11'、'PG12' 和 'PG13',否则切换将无效。

  1. 使用sudo以管理员权限安装

    sudo make install
    
  2. 确认安装

    make installcheck
    

这应该可以正常工作。

英文:

This is how i successfully did it.

Follow this. Ask if you have any question.

You should install Apache Age version Compatible with your postgres version

1.Check your postgres version installed. The 'V' is CAPITAL

psql -V

2.Clone Age Source code from Github.

git clone https://github.com/apache/age.git

3.CD into Age directory

cd age

4.Checkout to the branch of Age source corresponding to you postgres version. i.e if 12 checkout to 'PG12'

git checkout PG12

Note: There are three checkout option, make sure you spell them right.
They include 'PG11' 'PG12' 'PG13' Otherwise the checkout will be invalid.

5.Install with administrative privileges using sudo

sudo make install

6.Confirm install

make installcheck

This should work

huangapple
  • 本文由 发表于 2023年2月27日 18:38:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/75579392.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定