Re: Postgres failed to compile on debian x86

Lists: pgsql-ports
From: Josh Fremer <jfremer(at)earthlink(dot)net>
To: pgsql-ports(at)postgresql(dot)org
Subject: Postgres failed to compile on debian x86
Date: 2006-09-05 03:36:12
Message-ID: 1DECF249-E64B-49DF-AB32-E54601798ECD@earthlink.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-ports

This is a fresh Debian stable install. I think there's a very good
chance I'm missing some required library, since I've had to install
everything up to this point by hand. Any suggestions are hugely
appreciated.

The config.log is 600k so I'm not going to post the whole thing.
There are heaps of errors in it, including lots of "syntax error
before 'size_t'" and "WARNING: xxx.h: present but cannot be
compiled". The error that configure quite on is "checking types of
arguments for accept()... configure: error: could not determine
argument types.

Here are some bits that may be relevant. If anyone can tell me which
parts of this massive log would be more helpful, I'll be happy to
post them. Thanks in advance:

$ ./configure --with-perl --with-openssl --with-includes=/usr/
include/linux/:/usr/include --with-libraries=/usr/lib/

## --------- ##
## Platform. ##
## --------- ##

hostname = squall
uname -m = i686
uname -r = 2.4.27-2-386
uname -s = Linux
uname -v = #1 Mon May 16 16:47:51 JST 2005

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch = i686
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /sbin
PATH: /bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /usr/bin/X11
PATH: /usr/local/sbin
PATH: /usr/local/bin

<snip>

Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-13)
configure:2086: $? = 0
configure:2088: gcc -V </dev/null >&5
gcc: `-V' option must have argument

<snip>

configure:2550: gcc -c -g -O2 conftest.c >&5
conftest.c:2: error: syntax error before "me"
configure:2556: $? = 1
configure: failed program was:
| #ifndef __cplusplus
| choke me
| #endif
configure:2721: checking if gcc supports -Wdeclaration-after-statement
configure:2741: gcc -c -O2 -Wall -Wmissing-prototypes -Wpointer-arith
-Winline -Wdeclaration-after-statement -D_GNU_SOURCE conftest.c >&5
cc1: error: unrecognized option `-Wdeclaration-after-statement'
configure:2747: $? = 1
configure: failed program was:
| /* confdefs.h. */


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Josh Fremer <jfremer(at)earthlink(dot)net>
Cc: pgsql-ports(at)postgresql(dot)org
Subject: Re: Postgres failed to compile on debian x86
Date: 2006-09-05 04:21:54
Message-ID: 18474.1157430114@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-ports

Josh Fremer <jfremer(at)earthlink(dot)net> writes:
> This is a fresh Debian stable install. I think there's a very good
> chance I'm missing some required library, since I've had to install
> everything up to this point by hand. Any suggestions are hugely
> appreciated.

You haven't provided anything real definitive, but the mention of syntax
errors makes me wonder whether your install has the expected system
header files. Do the error messages mention missing include files?
If so you probably are lacking some xxx-devel packages. (More
generally, if you want to build stuff from source code, you need to
install a whole pile of "development" support files that are not
installed by a minimal install of modern Linux distros. On Red Hat
you normally need a "foo-devel" RPM corresponding to each "foo" package
the source code you want to build depends on. I'm not a Debian person
but I believe they've got some pretty similar packaging convention.)

regards, tom lane


From: Seneca Cunningham <tentra(at)gmail(dot)com>
To: Josh Fremer <jfremer(at)earthlink(dot)net>
Cc: pgsql-ports(at)postgresql(dot)org
Subject: Re: Postgres failed to compile on debian x86
Date: 2006-09-05 04:24:56
Message-ID: C408D24C-5B8E-432D-8545-A2CD1FCE6B16@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-ports

On 04-Sep-2006, at 23:36 :12, Josh Fremer wrote:

> This is a fresh Debian stable install. I think there's a very good
> chance I'm missing some required library, since I've had to install
> everything up to this point by hand. Any suggestions are hugely
> appreciated.

If you have a deb-src entry for main in your sources.list, you can
use "apt-get build-dep" followed by a Debian postgres package name to
find what development packages Debian considers to be required. I
can't remember the full package list off hand, but expect there to be
packages like libc6-dev, libreadline5-dev, cpp, perl-dev, libssl-dev,
zlib-dev.

> The config.log is 600k so I'm not going to post the whole thing.
> There are heaps of errors in it, including lots of "syntax error
> before 'size_t'" and "WARNING: xxx.h: present but cannot be
> compiled". The error that configure quite on is "checking types of
> arguments for accept()... configure: error: could not determine
> argument types.

My guess is a missing libc6-dev.

> Here are some bits that may be relevant. If anyone can tell me
> which parts of this massive log would be more helpful, I'll be
> happy to post them. Thanks in advance:
>
> $ ./configure --with-perl --with-openssl --with-includes=/usr/
> include/linux/:/usr/include --with-libraries=/usr/lib/
>
> ## --------- ##
> ## Platform. ##
> ## --------- ##
>
> hostname = squall
> uname -m = i686
> uname -r = 2.4.27-2-386
> uname -s = Linux
> uname -v = #1 Mon May 16 16:47:51 JST 2005
>
> /usr/bin/uname -p = unknown
> /bin/uname -X = unknown
>
> /bin/arch = i686
> /usr/bin/arch -k = unknown
> /usr/convex/getsysinfo = unknown
> hostinfo = unknown
> /bin/machine = unknown
> /usr/bin/oslevel = unknown
> /bin/universe = unknown
>
> PATH: /sbin
> PATH: /bin
> PATH: /usr/sbin
> PATH: /usr/bin
> PATH: /usr/bin/X11
> PATH: /usr/local/sbin
> PATH: /usr/local/bin
>
> <snip>
>
> Thread model: posix
> gcc version 3.3.5 (Debian 1:3.3.5-13)
> configure:2086: $? = 0
> configure:2088: gcc -V </dev/null >&5
> gcc: `-V' option must have argument
>
> <snip>
>
> configure:2550: gcc -c -g -O2 conftest.c >&5
> conftest.c:2: error: syntax error before "me"
> configure:2556: $? = 1
> configure: failed program was:
> | #ifndef __cplusplus
> | choke me
> | #endif
> configure:2721: checking if gcc supports -Wdeclaration-after-statement
> configure:2741: gcc -c -O2 -Wall -Wmissing-prototypes -Wpointer-
> arith -Winline -Wdeclaration-after-statement -D_GNU_SOURCE
> conftest.c >&5
> cc1: error: unrecognized option `-Wdeclaration-after-statement'
> configure:2747: $? = 1
> configure: failed program was:
> | /* confdefs.h. */

All this output is normal for a configure script that didn't fail.

--
Seneca Cunningham
tentra(at)gmail(dot)com


From: Josh Fremer <jfremer(at)earthlink(dot)net>
To: Seneca Cunningham <tentra(at)gmail(dot)com>
Cc: pgsql-ports(at)postgresql(dot)org
Subject: Re: Postgres failed to compile on debian x86
Date: 2006-09-05 14:32:57
Message-ID: 4B8EC131-1671-4A91-965C-ACE4D25F6200@earthlink.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-ports

I can't believe I forgot to mention this before, but the version of
postgresql I'm trying to install is 8.1.4.

On Sep 5, 2006, at 12:24 AM, Seneca Cunningham wrote:

> If you have a deb-src entry for main in your sources.list, you can
> use "apt-get build-dep" followed by a Debian postgres package name
> to find what development packages Debian considers to be required.
> I can't remember the full package list off hand, but expect there
> to be packages like libc6-dev, libreadline5-dev, cpp, perl-dev,
> libssl-dev, zlib-dev.

Thanks for this excellent tip; I had no idea the "build-dep"
functionality even existed. I tried doing an "apt-get build-dep" on
the latest version of postgresql in stable (7.4 I believe) which
installed a whole bunch of stuff which probably helped, but didn't
solve the problem

I then opted to add the testing branch to my sources list and do an
"apt-get build-dep postgresql-8.1" since this is the same major
version of postgresql I'm trying to build. This yields the same error.

> All this output is normal for a configure script that didn't fail.

Again, I'm sorry, but I really don't know what parts of this 660k log
file are the most useful. Here's a snippet from the end of the first
section:

----------
configure:13454: gcc -c -O2 -Wall -Wmissing-prototypes -Wpointer-
arith -Winline -Wendif-labels -fno-strict-aliasing -D_GNU_SOURCE -I/
usr/include/linux/ -I/usr/include conftest.c >&5
In file included from /usr/include/sys/types.h:266,
from /usr/include/sys/uio.h:24,
from /usr/include/sys/socket.h:27,
from conftest.c:54:
/usr/include/bits/pthreadtypes.h:50: error: syntax error before "size_t"
/usr/include/bits/pthreadtypes.h:53: error: syntax error before
"__stacksize"
In file included from /usr/include/sys/uio.h:29,
from /usr/include/sys/socket.h:27,
from conftest.c:54:
/usr/include/bits/uio.h:45: error: syntax error before "size_t"
In file included from /usr/include/sys/socket.h:35,
from conftest.c:54:
/usr/include/bits/socket.h:221: error: syntax error before "size_t"
/usr/include/bits/socket.h:224: error: syntax error before
"msg_controllen"
/usr/include/bits/socket.h:227: error: syntax error before '}' token
/usr/include/bits/socket.h:232: error: syntax error before "size_t"
/usr/include/bits/socket.h:239: error: syntax error before '}' token
/usr/include/bits/socket.h: In function `__cmsg_nxthdr':
/usr/include/bits/socket.h:266: error: `size_t' undeclared (first use
in this function)
/usr/include/bits/socket.h:266: error: (Each undeclared identifier is
reported only once
/usr/include/bits/socket.h:266: error: for each function it appears in.)
/usr/include/bits/socket.h:266: error: syntax error before "__cmsg"
/usr/include/bits/socket.h:271: error: dereferencing pointer to
incomplete type
/usr/include/bits/socket.h:271: error: syntax error before '~' token
/usr/include/bits/socket.h:271: error: syntax error before ')' token
/usr/include/bits/socket.h:272: error: invalid use of undefined type
`struct cmsghdr'
/usr/include/bits/socket.h:272: error: dereferencing pointer to
incomplete type
/usr/include/bits/socket.h:273: error: dereferencing pointer to
incomplete type
/usr/include/bits/socket.h:274: error: dereferencing pointer to
incomplete type
/usr/include/bits/socket.h:274: error: syntax error before '~' token
/usr/include/bits/socket.h:275: error: syntax error before '>' token
In file included from conftest.c:54:
/usr/include/sys/socket.h: At top level:
/usr/include/sys/socket.h:136: error: syntax error before "size_t"
/usr/include/sys/socket.h:143: error: syntax error before "size_t"
/usr/include/sys/socket.h:150: error: syntax error before "size_t"
/usr/include/sys/socket.h:161: error: syntax error before "size_t"
conftest.c:56: error: syntax error before "accept"
conftest.c:56: warning: type defaults to `int' in declaration of
`accept'
conftest.c:56: error: conflicting types for `accept'
/usr/include/sys/socket.h:210: error: previous declaration of `accept'
conftest.c:56: warning: data definition has no type or storage class
/usr/include/bits/socket.h:237: warning: array `__cmsg_data' assumed
to have one element
configure:13460: $? = 1
configure: failed program was:
| /* confdefs.h. */

<snip>

configure:13488: error: could not determine argument types
----------

Again, thanks very much for any suggestions.


From: Seneca Cunningham <tentra(at)gmail(dot)com>
To: Josh Fremer <jfremer(at)earthlink(dot)net>
Cc: pgsql-ports(at)postgresql(dot)org
Subject: Re: Postgres failed to compile on debian x86
Date: 2006-09-05 15:01:42
Message-ID: 44C47438-83FA-490C-8E12-BC076639D1B9@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-ports


On 05-Sep-2006, at 10:32 :57, Josh Fremer wrote:

> I can't believe I forgot to mention this before, but the version of
> postgresql I'm trying to install is 8.1.4.

That was my guess, given the source build for stable and the line
numbers in your config.log.

> On Sep 5, 2006, at 12:24 AM, Seneca Cunningham wrote:
>
>> If you have a deb-src entry for main in your sources.list, you can
>> use "apt-get build-dep" followed by a Debian postgres package name
>> to find what development packages Debian considers to be
>> required. I can't remember the full package list off hand, but
>> expect there to be packages like libc6-dev, libreadline5-dev, cpp,
>> perl-dev, libssl-dev, zlib-dev.
>
> Thanks for this excellent tip; I had no idea the "build-dep"
> functionality even existed. I tried doing an "apt-get build-dep"
> on the latest version of postgresql in stable (7.4 I believe) which
> installed a whole bunch of stuff which probably helped, but didn't
> solve the problem
>
> I then opted to add the testing branch to my sources list and do an
> "apt-get build-dep postgresql-8.1" since this is the same major
> version of postgresql I'm trying to build. This yields the same
> error.
>
[...snip config.log segment...]

Now that I'm connected to a Linux system, I've tried your original
configure line of:

./configure --with-perl --with-openssl \
--with-includes=/usr/include/linux/:/usr/include \
--with-libraries=/usr/lib/

and reproduced your results. Change that to:

./configure --with-perl --with-openssl \
--with-includes=/usr/include --with-libraries=/usr/lib

and it should work. Incidentally, the --with-includes and
--with-libraries aren't necessary at this point as /usr/include and /
usr/lib are in the default search path of gcc, ld, and cpp.

--
Seneca Cunningham
tentra(at)gmail(dot)com


From: Josh Fremer <jfremer(at)earthlink(dot)net>
To: Seneca Cunningham <tentra(at)gmail(dot)com>
Cc: pgsql-ports(at)postgresql(dot)org
Subject: Re: Postgres failed to compile on debian x86
Date: 2006-09-06 00:27:28
Message-ID: CC10F9B4-34BD-4C36-80C3-706CD7B60255@earthlink.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-ports

On Sep 5, 2006, at 11:01 AM, Seneca Cunningham wrote:
> Now that I'm connected to a Linux system, I've tried your original
> configure line of:
>
> ./configure --with-perl --with-openssl \
> --with-includes=/usr/include/linux/:/usr/include \
> --with-libraries=/usr/lib/
>
> and reproduced your results. Change that to:
>
> ./configure --with-perl --with-openssl \
> --with-includes=/usr/include --with-libraries=/usr/lib
>
> and it should work. Incidentally, the --with-includes and
> --with-libraries aren't necessary at this point as /usr/include
> and /usr/lib are in the default search path of gcc, ld, and cpp.

Installation complete. Thanks so much for all your help.

For completeness, I'd like to mention that after a successful
configure, make failed on my setup with the following error:

gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wendif-
labels -fno-strict-aliasing -Wno-error -L../../../../src/port -Wl,-
rpath,/usr/local/pgsql/lib preproc.o type.o ecpg.o ecpg_keywords.o
output.o keywords.o c_keywords.o ../ecpglib/typename.o descriptor.o
variable.o -lpgport -lssl -lcrypto -lz -lreadline -lcrypt -lresolv -
lnsl -ldl -lm -o ecpg
/usr/lib/libc_nonshared.a(elf-init.oS)(.text.__i686.get_pc_thunk.bx
+0x0): In function `__i686.get_pc_thunk.bx':
: multiple definition of `__i686.get_pc_thunk.bx'
../ecpglib/typename.o(.gnu.linkonce.t.__i686.get_pc_thunk.bx+0x0):
first defined here
collect2: ld returned 1 exit status
make[4]: *** [ecpg] Error 1
make[4]: Leaving directory `/home/josh/postgresql-8.1.4/src/
interfaces/ecpg/preproc'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/josh/postgresql-8.1.4/src/
interfaces/ecpg'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/josh/postgresql-8.1.4/src/interfaces'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/josh/postgresql-8.1.4/src'
make: *** [all] Error 2

After a little research I tried upgrading from gcc-3.4 to gcc-3.5,
which is the latest version currently available in debian stable.
The error persisted. After that I tried upgrading to gcc-4.0 out of
debian testing, which solved the issue.

Again, thanks for your patience and great advice.

Cheers,

Josh