postgresql 在Ubuntu中配置Postgres 13时无法识别的标志

gudnpqoy  于 2023-05-17  发布在  PostgreSQL
关注(0)|答案(2)|浏览(232)

我需要使用Ubuntu在Apache Age项目中工作,并尝试安装Postgres 13,但在配置文件时出现错误。

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

当我在MacOS中安装此命令时,它没有任何问题,但对于Ubuntu,标志会导致错误。如果我删除了CFLAGS部分,./configure可以工作,但我需要它进行调试。以下是运行命令后的输出:

checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking which template to use... linux
checking whether NLS is wanted... no
checking for default port number... 5432
checking for block size... 8kB
checking for segment size... 1GB
checking for WAL block size... 8kB
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/data/pg13/postgres':
configure: error: C compiler cannot create executables
See `config.log' for more details

下面是'config.log'文件:

## ----------- ##
## Core tests. ##
## ----------- ##

configure:2861: checking build system type
configure:2875: result: x86_64-pc-linux-gnu
configure:2895: checking host system type
configure:2908: result: x86_64-pc-linux-gnu
configure:2930: checking which template to use
configure:2998: result: linux
configure:3123: checking whether NLS is wanted
configure:3188: result: 5432
configure:3665: checking for block size
configure:3699: result: 8kB
configure:3752: checking for WAL block size
configure:3787: result: 8kB
configure:3884: checking for gcc
configure:3900: found /usr/bin/gcc
configure:3911: result: gcc
configure:3942: checking for C compiler version
configure:3951: gcc --version >&5
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3962: $? = 0
configure:3951: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Thread model: posix
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configure:3962: $? = 0
configure:3951: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3962: $? = 1
configure:3951: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:3962: $? = 1
configure:3982: checking whether the C compiler works
configure:4004: gcc -glldb -ggdb -O0 -g3 -fno-omit-frame-pointer   conftest.c  >&5
gcc: error: unrecognized debug output level 'lldb'
configure:4008: $? = 1
configure:4046: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "PostgreSQL"
| #define PACKAGE_TARNAME "postgresql"
| #define PACKAGE_VERSION "13.11"
configure:3962: $? = 0
configure:3951: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
configure:3752: checking for WAL block size
configure:3787: result: 8kB
configure:3884: checking for gcc
configure:3900: found /usr/bin/gcc
configure:3911: result: gcc
configure:3942: checking for C compiler version
configure:3951: gcc --version >&5
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3962: $? = 0
configure:3951: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Thread model: posix
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configure:3962: $? = 0
configure:3951: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3962: $? = 1
configure:3951: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:3962: $? = 1
configure:3982: checking whether the C compiler works
configure:4004: gcc -glldb -ggdb -O0 -g3 -fno-omit-frame-pointer   conftest.c  >&5
gcc: error: unrecognized debug output level 'lldb'
configure:4008: $? = 1
configure:4046: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "PostgreSQL"
| #define PACKAGE_TARNAME "postgresql"
| #define PACKAGE_VERSION "13.11"
| #define PACKAGE_STRING "PostgreSQL 13.11"
| #define PACKAGE_BUGREPORT "pgsql-bugs@lists.postgresql.org"
| #define PACKAGE_URL "https://www.postgresql.org/"
| #define CONFIGURE_ARGS " '--prefix=/usr/local/pgsql-13' '--enable-cassert' '--enable-debug' 'CFLAGS=-glldb -ggdb -O0 -g3 -fno-omit-frame-pointer'"
| #define PG_MAJORVERSION "13"
| #define PG_MAJORVERSION_NUM 13
| #define PG_MINORVERSION_NUM 11
| #define PG_VERSION "13.11"
| #define DEF_PGPORT 5432
| #define DEF_PGPORT_STR "5432"
| #define BLCKSZ 8192
| #define RELSEG_SIZE 131072
| #define XLOG_BLCKSZ 8192
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:4051: error: in `/data/pg13/postgres':
configure:4053: error: C compiler cannot create executables
See `config.log' for more details

我已经在我的机器上安装了build-essential和gcc。

von4xj4u

von4xj4u1#

在我看来,CFLAGS-glldb部分导致了错误,也许可以尝试:
CFLAGS="-ggdb -Og -g3 -fno-omit-frame-pointer"
相反,它为我工作,我没有问题调试。

csbfibhn

csbfibhn2#

命令是:

./configure --enable-debug --enable-cassert --prefix=$(pwd) CFLAGS="-ggdb -Og -fno-omit-frame-pointer"

你可以从here获得帮助,这篇博客文章有一步一步的指导来配置PostgreSQL的AGE。

相关问题