Flags not recognized for configuring Postgres 13 in Ubuntu

Advertisements

I am required to use Ubuntu for working in an Apache Age project and have tried installing Postgres 13 but am getting errors when configuring the files.

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

This command works without any issues when I installed it in MacOS but for Ubuntu, the flags are causing errors. ./configure worked for me if I removed the CFLAGS section but I would need it for debugging. Here is the output after running the command:

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

Here is the ‘config.log’ file:

## ----------- ##
## 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

I have build-essential and gcc installed in my machine.

>Solution :

Seems to me that the -glldb part of the CFLAGS is causing an error, maybe try:

CFLAGS="-ggdb -Og -g3 -fno-omit-frame-pointer"

instead, it worked for me and i have no problem debugging.

Leave a ReplyCancel reply