PostgreSQL 8.3.8 on AIX5.3 : compilation failed
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi all,<br>
<br>
I am trying to compile PostgreSQL 8.3.8 on AIX 5.3 TL9 (64 bits).<br>
The "<font face="Courier New" size="-1">.configure</font>" has been
executed with success without any error but the compilation of
PostgreSQL with "<font face="Courier New" size="-1">gmake</font>"
fails. <br>
<br>
Please find below the errors I get : <br>
<blockquote><font face="Courier New" size="-1">In file included from
psqlscan.c:2385:</font><br>
<font face="Courier New" size="-1">/usr/include/unistd.h:171: error:
conflicting types for 'lseek64'</font><br>
<font face="Courier New" size="-1">/usr/include/unistd.h:169: error:
previous declaration of 'lseek64' was here</font><br>
<font face="Courier New" size="-1">In file included from
/usr/include/unistd.h:744,</font><br>
<font face="Courier New" size="-1"> from
psqlscan.c:2385:</font><br>
<font face="Courier New" size="-1">/usr/include/sys/lockf.h:64:
error: conflicting types for 'lockf64'</font><br>
<font face="Courier New" size="-1">/usr/include/sys/lockf.h:62:
error: previous declaration of 'lockf64' was here</font><br>
<font face="Courier New" size="-1">In file included from
psqlscan.c:2385:</font><br>
<font face="Courier New" size="-1">/usr/include/unistd.h:807: error:
conflicting types for 'ftruncate64'</font><br>
<font face="Courier New" size="-1">/usr/include/unistd.h:805: error:
previous declaration of 'ftruncate64' was here</font><br>
<font face="Courier New" size="-1">/usr/include/unistd.h:843: error:
conflicting types for 'truncate64'</font><br>
<font face="Courier New" size="-1">/usr/include/unistd.h:841: error:
previous declaration of 'truncate64' was here</font><br>
<font face="Courier New" size="-1">/usr/include/unistd.h:860: error:
conflicting types for 'pread64'</font><br>
<font face="Courier New" size="-1">/usr/include/unistd.h:857: error:
previous declaration of 'pread64' was here</font><br>
<font face="Courier New" size="-1">/usr/include/unistd.h:861: error:
conflicting types for 'pwrite64'</font><br>
<font face="Courier New" size="-1">/usr/include/unistd.h:858: error:
previous declaration of 'pwrite64' was here</font><br>
<font face="Courier New" size="-1">/usr/include/unistd.h:928: error:
conflicting types for 'fclear64'</font><br>
<font face="Courier New" size="-1">/usr/include/unistd.h:925: error:
previous declaration of 'fclear64' was here</font><br>
<font face="Courier New" size="-1">/usr/include/unistd.h:929: error:
conflicting types for 'fsync_range64'</font><br>
<font face="Courier New" size="-1">/usr/include/unistd.h:926: error:
previous declaration of 'fsync_range64' was here</font><br>
<font face="Courier New" size="-1">gmake[3]: *** [psqlscan.o] Error 1</font><br>
<font face="Courier New" size="-1">gmake[3]: Leaving directory
`/home/PostgreSQL_8.3.8/sources/postgresql-8.3.8/src/bin/psql'</font><br>
<font face="Courier New" size="-1">gmake[2]: *** [all] Error 2</font><br>
<font face="Courier New" size="-1">gmake[2]: Leaving directory
`/home/PostgreSQL_8.3.8/sources/postgresql-8.3.8/src/bin'</font><br>
<font face="Courier New" size="-1">gmake[1]: *** [all] Error 2</font><br>
<font face="Courier New" size="-1">gmake[1]: Leaving directory
`/home/PostgreSQL_8.3.8/sources/postgresql-8.3.8/src'</font><br>
<font face="Courier New" size="-1">gmake: *** [all] Error 2</font><br>
</blockquote>
I read on the PostgreSQL.fr's forum that this error is linked to large
files in 64 bits system, allowing to read / write files of 2 GB and
over.<br>
I also read that I can use the "<font face="Courier New" size="-1">-disable-largefile</font>"
while I launched "<font face="Courier New" size="-1">.configure</font>"
but I don't really understand the problem. <br>
If PostgreSQL can't use such files, except for trace logs, why the
compilation fails on large files ? <br>
<br>
Thank you for your help.<br>
<br>
Regards,<br>
Alexandra
</body>
</html>
I am trying to compile PostgreSQL 8.3.8 on AIX 5.3 TL9 (64 bits).
The ".configure" has been executed with success without any
error but the compilation of PostgreSQL with "gmake" fails.Please find below the errors I get :
In file included from psqlscan.c:2385:
/usr/include/unistd.h:171: error: conflicting types for 'lseek64'
/usr/include/unistd.h:169: error: previous declaration of 'lseek64' was here
In file included from /usr/include/unistd.h:744,
from psqlscan.c:2385:
[...]
I read on the PostgreSQL.fr's forum that this error is linked
to large files in 64 bits system, allowing to read / write
files of 2 GB and over.
I also read that I can use the "-disable-largefile" while I
launched ".configure" but I don't really understand the problem.
If PostgreSQL can't use such files, except for trace logs,
why the compilation fails on large files ?
Is this a 32-bit or a 64-bit build?
How exactly did you call configure and make?
After configuring, what do you get when you run
grep -i large config.log
in the PostgreSQL directory?
And what is the result of
grep -i large include/pg_config.h
Yours,
Laurenz Albe
Hi Laurenz,
It was a 32-bit build as I didn't have set the "OBJECT_MODE" to 64.
I call configure and make using as root user:
# ./configure
# gmake
The releases of "make" and "gcc" are :
make-3.80-1
gcc-4.2.0-3
Please find below the result of that you ask me:
1. # grep -i large config.log
configure:18474: checking for _LARGEFILE_SOURCE value needed for
large files
configure:23755: checking for special C compiler options needed for
large files
configure:23860: checking for _FILE_OFFSET_BITS value needed for
large files
conftest.c:144: error: size of array 'off_t_is_large' is negative
| We can't simply define LARGE_OFF_T to be 9223372036854775807,
| #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
| int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
| && LARGE_OFF_T % 2147483647 == 1)
conftest.c:145: error: size of array 'off_t_is_large' is negative
| We can't simply define LARGE_OFF_T to be 9223372036854775807,
| #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
| int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
| && LARGE_OFF_T % 2147483647 == 1)
configure:23985: checking for _LARGE_FILES value needed for large files
conftest.c:144: error: size of array 'off_t_is_large' is negative
| We can't simply define LARGE_OFF_T to be 9223372036854775807,
| #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
| int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
| && LARGE_OFF_T % 2147483647 == 1)
ac_cv_sys_large_files=1
ac_cv_sys_largefile_CC=no
ac_cv_sys_largefile_source=no
#define _LARGE_FILES 1
2. # grep -i large include/pg_config.h
grep: 0652-033 Cannot open include/pg_config.h.
#
# grep -i large src/include/pg_config.h
/* #undef _LARGEFILE_SOURCE */
/* Define for large files, on AIX-style hosts. */
#define _LARGE_FILES 1
Since my post, I have followed the advice of PostgreSQL 8.4
documentation on AIX to do a 64-bit build:
http://www.postgresql.org/docs/8.4/static/installation-platform-notes.html#INSTALLATION-NOTES-AIX
that is to say I have :
- set OBJECT_MODE to 64
- pass CC="gcc -maix64" and LDFLAGS="-Wl,-bbigtoc" to configure
- execute gmake
gmake failed with these errors :
gcc -maix64 -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
-fwrapv -I../../src/port -DFRONTEND -I../../src/include -c -o
sprompt.o sprompt.c
gcc -maix64 -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
-fwrapv -I../../src/port -DFRONTEND -I../../src/include -c thread.c
ar crs libpgport.a strlcat.o strlcpy.o getopt_long.o chklocale.o
copydir.o dirmod.o exec.o noblock.o path.o pipe.o pgsleep.o
pgstrcasecmp.o qsort.o qsort_arg.o sprompt.o thread.o
ar: 0707-126 strlcat.o is not valid with the current object file mode.
Use the -X option to specify the desired object mode.
ar: 0707-126 strlcpy.o is not valid with the current object file mode.
Use the -X option to specify the desired object mode.
ar: 0707-126 getopt_long.o is not valid with the current object file
mode.
Use the -X option to specify the desired object mode.
ar: 0707-126 chklocale.o is not valid with the current object file mode.
Use the -X option to specify the desired object mode.
ar: 0707-126 copydir.o is not valid with the current object file mode.
Use the -X option to specify the desired object mode.
ar: 0707-126 dirmod.o is not valid with the current object file mode.
Use the -X option to specify the desired object mode.
ar: 0707-126 exec.o is not valid with the current object file mode.
Use the -X option to specify the desired object mode.
ar: 0707-126 noblock.o is not valid with the current object file mode.
Use the -X option to specify the desired object mode.
ar: 0707-126 path.o is not valid with the current object file mode.
Use the -X option to specify the desired object mode.
ar: 0707-126 pipe.o is not valid with the current object file mode.
Use the -X option to specify the desired object mode.
ar: 0707-126 pgsleep.o is not valid with the current object file mode.
Use the -X option to specify the desired object mode.
ar: 0707-126 pgstrcasecmp.o is not valid with the current object
file mode.
Use the -X option to specify the desired object mode.
ar: 0707-126 qsort.o is not valid with the current object file mode.
Use the -X option to specify the desired object mode.
ar: 0707-126 qsort_arg.o is not valid with the current object file mode.
Use the -X option to specify the desired object mode.
ar: 0707-126 sprompt.o is not valid with the current object file mode.
Use the -X option to specify the desired object mode.
ar: 0707-126 thread.o is not valid with the current object file mode.
Use the -X option to specify the desired object mode.
gmake[2]: *** [libpgport.a] Error 16
gmake[2]: Leaving directory
`/home/PostgreSQL_8.3.8/sources/postgresql-8.3.8/src/port'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory
`/home/PostgreSQL_8.3.8/sources/postgresql-8.3.8/src'
gmake: *** [all] Error 2
Do you have an idea about these errors ?
Thank you.
Regards,
Alexandra
Albe Laurenz a �crit :
Show quoted text
I am trying to compile PostgreSQL 8.3.8 on AIX 5.3 TL9 (64 bits).
The ".configure" has been executed with success without any
error but the compilation of PostgreSQL with "gmake" fails.Please find below the errors I get :
In file included from psqlscan.c:2385:
/usr/include/unistd.h:171: error: conflicting types for 'lseek64'
/usr/include/unistd.h:169: error: previous declaration of 'lseek64' was here
In file included from /usr/include/unistd.h:744,
from psqlscan.c:2385:[...]
I read on the PostgreSQL.fr's forum that this error is linked
to large files in 64 bits system, allowing to read / write
files of 2 GB and over.
I also read that I can use the "-disable-largefile" while I
launched ".configure" but I don't really understand the problem.
If PostgreSQL can't use such files, except for trace logs,
why the compilation fails on large files ?Is this a 32-bit or a 64-bit build?
How exactly did you call configure and make?
After configuring, what do you get when you run
grep -i large config.log
in the PostgreSQL directory?And what is the result of
grep -i large include/pg_config.hYours,
Laurenz Albe
Alexandra Roy wrote:
It was a 32-bit build as I didn't have set the "OBJECT_MODE" to 64.
I call configure and make using as root user:# ./configure
# gmakeThe releases of "make" and "gcc" are :
make-3.80-1
gcc-4.2.0-3
Hmmm, I dont get the error if I set OBJECT_MODE to 32 and
do what you did, but I have PostgreSQL 8.4 here.
config.log and pg_config.h look like yours...
Since my post, I have followed the advice of PostgreSQL 8.4
documentation on AIX to do a 64-bit build:
http://www.postgresql.org/docs/8.4/static/installation-platform-notes.html#INSTALLATION-NOTES-AIX
that is to say I have :
- set OBJECT_MODE to 64
- pass CC="gcc -maix64" and LDFLAGS="-Wl,-bbigtoc" to configure
- execute gmakegmake failed with these errors :
[...]
ar crs libpgport.a strlcat.o strlcpy.o getopt_long.o chklocale.o
copydir.o dirmod.o exec.o noblock.o path.o pipe.o pgsleep.o
pgstrcasecmp.o qsort.o qsort_arg.o sprompt.o thread.o
ar: 0707-126 strlcat.o is not valid with the current object file mode.
Use the -X option to specify the desired object mode.
You have to export OBJECT_MODE. Setting it is not enough.
Did you 'make clean' first? Otherwise some 64-bit objects might still be around...
Yours,
Laurenz Albe
Hi Laurenz, hi Daniel,
I have always run "gmake distclean" before relaunching a build.
Maybe the32-bit build failed because I have not set and exported the
"OBJECT_MODE" environment variable.
I will try to build PostgreSQL once again with "export OBJECT_MODE=32".
I continued to test a 64-bit build and finally, I found the procedure to
do a 64-bit build of PostgreSQL 8.3.8 on AIX 5.3.
As "root" user :
# export OBJECT_MODE=64
# export CFLAGS="-maix64"
# export LDFLAGS="-maix64 -Wl,-bbigtoc"
# export AR="ar -X64" => this step was missing in my first test
# ./configure
# gmake
All of PostgreSQL successfully made. Ready to install.
As non-root user :
# gmake check
=======================
All 114 tests passed.
=======================
As "root" user:
# gmake install
PostgreSQL installation complete.
I will try this procedure with "export OBJECT_MODE=32" at the beginning
to see if the first error was coming from this variable.
I will tell me my conclusion.
About 32-build versus 64-build on AIX, could you please tell me if
PostgreSQL will be able to use all the benefits of a 64-build or not ?
Thank you for your answer.
Regards,
Alexandra
Albe Laurenz a �crit :
Show quoted text
Alexandra Roy wrote:
It was a 32-bit build as I didn't have set the "OBJECT_MODE" to 64.
I call configure and make using as root user:# ./configure
# gmakeThe releases of "make" and "gcc" are :
make-3.80-1
gcc-4.2.0-3Hmmm, I dont get the error if I set OBJECT_MODE to 32 and
do what you did, but I have PostgreSQL 8.4 here.config.log and pg_config.h look like yours...
Since my post, I have followed the advice of PostgreSQL 8.4
documentation on AIX to do a 64-bit build:
http://www.postgresql.org/docs/8.4/static/installation-platform-notes.html#INSTALLATION-NOTES-AIX
that is to say I have :
- set OBJECT_MODE to 64
- pass CC="gcc -maix64" and LDFLAGS="-Wl,-bbigtoc" to configure
- execute gmakegmake failed with these errors :
[...]
ar crs libpgport.a strlcat.o strlcpy.o getopt_long.o chklocale.o
copydir.o dirmod.o exec.o noblock.o path.o pipe.o pgsleep.o
pgstrcasecmp.o qsort.o qsort_arg.o sprompt.o thread.o
ar: 0707-126 strlcat.o is not valid with the current object file mode.
Use the -X option to specify the desired object mode.You have to export OBJECT_MODE. Setting it is not enough.
Did you 'make clean' first? Otherwise some 64-bit objects might still be around...
Yours,
Laurenz Albe
Laurenz,
I have juste finished to build PostgreSQL 8.3.8 with OBJECT_MODE set to
32 and I have exactly the same error as the beginning :
# export OBJECT_MODE=32
# cd /home/PostgreSQL_8.3.8/sources/postgresql-8.3.8
# ./configure => OK
# gmake 2>&1 | tee gmake_PGS_8.3.8_v4.log
In file included from psqlscan.c:2385:
/usr/include/unistd.h:171: error: conflicting types for 'lseek64'
/usr/include/unistd.h:169: error: previous declaration of 'lseek64' was here
In file included from /usr/include/unistd.h:744,
from psqlscan.c:2385:
/usr/include/sys/lockf.h:64: error: conflicting types for 'lockf64'
/usr/include/sys/lockf.h:62: error: previous declaration of 'lockf64'
was here
In file included from psqlscan.c:2385:
/usr/include/unistd.h:807: error: conflicting types for 'ftruncate64'
/usr/include/unistd.h:805: error: previous declaration of 'ftruncate64'
was here
/usr/include/unistd.h:843: error: conflicting types for 'truncate64'
/usr/include/unistd.h:841: error: previous declaration of 'truncate64'
was here
/usr/include/unistd.h:860: error: conflicting types for 'pread64'
/usr/include/unistd.h:857: error: previous declaration of 'pread64' was here
/usr/include/unistd.h:861: error: conflicting types for 'pwrite64'
/usr/include/unistd.h:858: error: previous declaration of 'pwrite64' was
here
/usr/include/unistd.h:928: error: conflicting types for 'fclear64'
/usr/include/unistd.h:925: error: previous declaration of 'fclear64' was
here
/usr/include/unistd.h:929: error: conflicting types for 'fsync_range64'
/usr/include/unistd.h:926: error: previous declaration of
'fsync_range64' was here
gmake[3]: *** [psqlscan.o] Error 1
gmake[3]: Leaving directory
`/home/PostgreSQL_8.3.8/sources/postgresql-8.3.8/src/bin/psql'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory
`/home/PostgreSQL_8.3.8/sources/postgresql-8.3.8/src/bin'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory
`/home/PostgreSQL_8.3.8/sources/postgresql-8.3.8/src'
gmake: *** [all] Error 2
Could you please give me the command you execute to 32-build PostgreSQL
on AIX ?
Thank you.
Regards,
Alexandra
Albe Laurenz a �crit :
Alexandra Roy wrote:
It was a 32-bit build as I didn't have set the "OBJECT_MODE" to 64.
I call configure and make using as root user:# ./configure
# gmakeThe releases of "make" and "gcc" are :
make-3.80-1
gcc-4.2.0-3Hmmm, I dont get the error if I set OBJECT_MODE to 32 and
do what you did, but I have PostgreSQL 8.4 here.config.log and pg_config.h look like yours...
Since my post, I have followed the advice of PostgreSQL 8.4
documentation on AIX to do a 64-bit build:
http://www.postgresql.org/docs/8.4/static/installation-platform-notes.html#INSTALLATION-NOTES-AIX
that is to say I have :
- set OBJECT_MODE to 64
- pass CC="gcc -maix64" and LDFLAGS="-Wl,-bbigtoc" to configure
- execute gmakegmake failed with these errors :
[...]
ar crs libpgport.a strlcat.o strlcpy.o getopt_long.o chklocale.o
copydir.o dirmod.o exec.o noblock.o path.o pipe.o pgsleep.o
pgstrcasecmp.o qsort.o qsort_arg.o sprompt.o thread.o
ar: 0707-126 strlcat.o is not valid with the current object file mode.
Use the -X option to specify the desired object mode.You have to export OBJECT_MODE. Setting it is not enough.
Did you 'make clean' first? Otherwise some 64-bit objects might still be around...
Yours,
Laurenz Albe
--
Alexandra ROY
Database Competence Center
Bull, Architect of an Open World TM
Phone: 04 76 29 77 01
http://www.bull.com
This e-mail contains material that is confidential for the sole use of
the intended recipient. Any review, reliance or distribution by others
or forwarding without express permission is strictly prohibited. If you
are not the intended recipient, please contact the sender and delete all
copies.
Alexandra Roy wrote:
I have always run "gmake distclean" before relaunching a build.
Maybe the32-bit build failed because I have not set and exported the
"OBJECT_MODE" environment variable.
I will try to build PostgreSQL once again with "export
OBJECT_MODE=32".
I will look at the 32 bit case again.
I continued to test a 64-bit build and finally, I found the
procedure to
do a 64-bit build of PostgreSQL 8.3.8 on AIX 5.3.
As "root" user :
You don't have to be root for this.
# export OBJECT_MODE=64
# export CFLAGS="-maix64"
# export LDFLAGS="-maix64 -Wl,-bbigtoc"
# export AR="ar -X64" => this step was missing in my first test
This should not be necessary - if you look at the man page of "ar"
you will see that the default value of the -X flag is derived
from OBJECT_MODE.
# ./configure
# gmake
All of PostgreSQL successfully made. Ready to install.
I'm glad that you got it to compile.
As non-root user :
# gmake check
=======================
All 114 tests passed.
=======================As "root" user:
# gmake install
PostgreSQL installation complete.
Yours,
Laurenz Albe
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Laurenz, hi all,<br>
<br>
This is a summary of what I have noticed concerning PostgreSQL 8.3.8
compilation on AIX 5.3 TL9.<br>
<br>
1. To do a successful 64-bit build, specify and execute:<br>
<blockquote><font face="Courier New" size="-1"># export
OBJECT_MODE="64"
<br>
# export CFLAGS="-maix64" <br>
# export LDFLAGS="-maix64 -Wl,-bbigtoc"
<br>
# ./configure
<br>
# gmake <br>
# gmake install </font><br>
</blockquote>
Laurenz, you are right: it is not necessary to specify: <br>
<pre wrap=""># export AR="ar -X64" </pre>
<br>
<br>
2. To do a successful 32-bit build, you must specify:<br>
<blockquote><font face="Courier New" size="-1"># export
OBJECT_MODE="32"
</font></blockquote>
and use the "<font color="#3333ff">-disable-largefile</font>" option
with configure :<br>
<blockquote><font face="Courier New" size="-1"># ./configure <font
color="#ff0000">-disable-largefile</font></font><br>
</blockquote>
If I use the "-disable-largefile" option, "configure" indicates at the
end: <br>
<blockquote><font color="#ff0000" face="Courier New" size="-1">configure:
WARNING: option ignored: --enable-largefile</font><br>
</blockquote>
And then, the compilation is successful:<br>
<blockquote><font color="#3333ff" face="Courier New" size="-1">All of
PostgreSQL successfully made. Ready to install.</font><br>
</blockquote>
Without the "-disable-largefile" option, the compilation is still
failing with this error:<br>
<blockquote><font face="Courier New" size="-1">In file included from
psqlscan.c:2385:
<br>
/usr/include/unistd.h:171: error: conflicting types for 'lseek64'
<br>
/usr/include/unistd.h:169: error: previous declaration of 'lseek64'
<br>
was here
<br>
In file included from /usr/include/unistd.h:744,
<br>
from psqlscan.c:2385:
<br>
/usr/include/sys/lockf.h:64: error: conflicting types for 'lockf64'
<br>
/usr/include/sys/lockf.h:62: error: previous declaration of
<br>
'lockf64' was here
</font><br>
</blockquote>
Does someone have an idea about this ? <br>
Why the "-disable-largefile" option is necessary to do a PostgreSQL
8.3.8 32-build ? <br>
Why the "OBJECT_MODE" exported to 32 is not sufficient ? <br>
<br>
Thank you for your answer.<br>
<br>
Regards,<br>
Alexandra<br>
<br>
<br>
Albe Laurenz a écrit :
<blockquote
cite="mid:D960CB61B694CF459DCFB4B0128514C203938023@exadv11.host.magwien.gv.at"
type="cite">
<pre wrap="">Alexandra Roy wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I have always run "gmake distclean" before relaunching a build.
Maybe the32-bit build failed because I have not set and exported the
"OBJECT_MODE" environment variable.
I will try to build PostgreSQL once again with "export
OBJECT_MODE=32".
</pre>
</blockquote>
<pre wrap=""><!---->
I will look at the 32 bit case again.
</pre>
<blockquote type="cite">
<pre wrap="">I continued to test a 64-bit build and finally, I found the
procedure to
do a 64-bit build of PostgreSQL 8.3.8 on AIX 5.3.
As "root" user :
</pre>
</blockquote>
<pre wrap=""><!---->
You don't have to be root for this.
</pre>
<blockquote type="cite">
<pre wrap=""># export OBJECT_MODE=64
# export CFLAGS="-maix64"
# export LDFLAGS="-maix64 -Wl,-bbigtoc"
# export AR="ar -X64" => this step was missing in my first test
</pre>
</blockquote>
<pre wrap=""><!---->
This should not be necessary - if you look at the man page of "ar"
you will see that the default value of the -X flag is derived
from OBJECT_MODE.
</pre>
<blockquote type="cite">
<pre wrap=""># ./configure
# gmake
All of PostgreSQL successfully made. Ready to install.
</pre>
</blockquote>
<pre wrap=""><!---->
I'm glad that you got it to compile.
</pre>
<blockquote type="cite">
<pre wrap="">As non-root user :
# gmake check
=======================
All 114 tests passed.
=======================
As "root" user:
# gmake install
PostgreSQL installation complete.
</pre>
</blockquote>
<pre wrap=""><!---->
Yours,
Laurenz Albe
</pre>
</blockquote>
<div class="moz-signature"><font color="grey"><br>
</font>
</div>
</body>
</html>
I CC: this to the hackers list as it seems to be an old problem that
was never fixed. See at the bottom.
Alexandra Roy wrote:
This is a summary of what I have noticed concerning
PostgreSQL 8.3.8 compilation on AIX 5.3 TL9.1. To do a successful 64-bit build, specify and execute:
# export OBJECT_MODE="64"
# export CFLAGS="-maix64"
# export LDFLAGS="-maix64 -Wl,-bbigtoc"
# ./configure
# gmake
# gmake install
I forgot to answer your question concerning the benefits of a 64-bit build:
You will be able to use more memory.
2. To do a successful 32-bit build, you must specify:
# export OBJECT_MODE="32"
and use the "-disable-largefile" option with configure :
# ./configure -disable-largefile
If I use the "-disable-largefile" option, "configure"
indicates at the end:configure: WARNING: option ignored: --enable-largefile
And then, the compilation is successful:
All of PostgreSQL successfully made. Ready to install.
Without the "-disable-largefile" option, the compilation is
still failing with this error:In file included from psqlscan.c:2385:
/usr/include/unistd.h:171: error: conflicting types
for 'lseek64'
/usr/include/unistd.h:169: error: previous
declaration of 'lseek64'
was here
In file included from /usr/include/unistd.h:744,
from psqlscan.c:2385:
/usr/include/sys/lockf.h:64: error: conflicting
types for 'lockf64'
/usr/include/sys/lockf.h:62: error: previous declaration of
'lockf64' was hereDoes someone have an idea about this ?
Why the "-disable-largefile" option is necessary to do a
PostgreSQL 8.3.8 32-build ?
Why the "OBJECT_MODE" exported to 32 is not sufficient ?
I dug around a little, and the problem is in psqlscan.c which is generated
from psqlscan.l by flex.
I found descriptions of the problem in the archives:
http://archives.postgresql.org/pgsql-hackers/2002-09/msg01142.php
http://archives.postgresql.org/pgsql-hackers/2002-09/msg01545.php
The problem is that both _LARGE_FILES and _LARGE_FILE_API are #defined
in this case, which makes #include <unistd.h> fail.
A possible workaround, suggested by Peter Eisentraut at the time, would
be to add this line at the beginning of bin/psql/psqlscan.c:
#include "postgres.h"
This fixes the problem for me.
Does anyone have an idea how to best fix this problem in the
source tree? I'm willing to implement and test.
Yours,
Laurenz Albe
"Albe Laurenz" <laurenz.albe@wien.gv.at> writes:
Why the "OBJECT_MODE" exported to 32 is not sufficient ?
I dug around a little, and the problem is in psqlscan.c which is generated
from psqlscan.l by flex.
The problem is that both _LARGE_FILES and _LARGE_FILE_API are #defined
in this case, which makes #include <unistd.h> fail.
Yeah. We solved this and other problems years ago by decreeing that
we would never try to compile flex output files on their own; they'd
always be #include'd into some other source file so that pg_config.h
would get read first. psqlscan.l seems to have escaped that dictum
somehow, but I guess we'd better make it fall into line.
In most of the other cases the #include is done in an associated .y
file, but there is none in psql. Anyone have a thought which of
psql's .c files would be the most appropriate host?
regards, tom lane
Tom Lane wrote:
In most of the other cases the #include is done in an associated .y
file, but there is none in psql. Anyone have a thought which of
psql's .c files would be the most appropriate host?
mainloop.c?
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
Alvaro Herrera <alvherre@commandprompt.com> writes:
Tom Lane wrote:
In most of the other cases the #include is done in an associated .y
file, but there is none in psql. Anyone have a thought which of
psql's .c files would be the most appropriate host?
mainloop.c?
Yeah, that's about the same conclusion I had come to --- that's
the principal caller so it's the closest analog to what we do
elsewhere.
Will fix.
regards, tom lane
"Albe Laurenz" <laurenz.albe@wien.gv.at> writes:
The problem is that both _LARGE_FILES and _LARGE_FILE_API are #defined
in this case, which makes #include <unistd.h> fail.
Does anyone have an idea how to best fix this problem in the
source tree? I'm willing to implement and test.
I've committed changes for this in CVS, please verify it fixes your
problem.
regards, tom lane
Tom Lane wrote:
The problem is that both _LARGE_FILES and _LARGE_FILE_API are #defined
in this case, which makes #include <unistd.h> fail.
Does anyone have an idea how to best fix this problem in the
source tree? I'm willing to implement and test.I've committed changes for this in CVS, please verify it fixes your
problem.
Problem fixed.
Thanks for the quick work!
Yours,
Laurenz Albe
Alexandra Roy wrote:
Without the "-disable-largefile" option, the compilation is
still failing with this error:In file included from psqlscan.c:2385:
/usr/include/unistd.h:171: error: conflicting types for 'lseek64'
/usr/include/unistd.h:169: error: previous declaration of 'lseek64'
was here
In file included from /usr/include/unistd.h:744,
from psqlscan.c:2385:
[...]
Does someone have an idea about this ?
Why the "-disable-largefile" option is necessary to do a
PostgreSQL 8.3.8 32-build ?
Why the "OBJECT_MODE" exported to 32 is not sufficient ?
The problem will be fixed in the upcoming 8.5 release.
If you need a 32-bit build of 8.3.8 on AIX, you can (after
you got the error message) edit src/bin/psql/psqlscan.c and add
#include "postgres.h"
as first line.
Then try again, and it should work.
Yours,
Laurenz Albe
Albe Laurenz wrote:
Alexandra Roy wrote:
Without the "-disable-largefile" option, the compilation is
still failing with this error:In file included from psqlscan.c:2385:
/usr/include/unistd.h:171: error: conflicting types for 'lseek64'
/usr/include/unistd.h:169: error: previous declaration of 'lseek64'
was here
In file included from /usr/include/unistd.h:744,
from psqlscan.c:2385:[...]
Does someone have an idea about this ?
Why the "-disable-largefile" option is necessary to do a
PostgreSQL 8.3.8 32-build ?
Why the "OBJECT_MODE" exported to 32 is not sufficient ?The problem will be fixed in the upcoming 8.5 release.
If you need a 32-bit build of 8.3.8 on AIX, you can (after
you got the error message) edit src/bin/psql/psqlscan.c and add
#include "postgres.h"
as first line.
Actually it's in the 8.3 CVS branch too. A 8.3 snapshot should work
fine.
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
"Albe Laurenz" <laurenz.albe@wien.gv.at> writes:
Alexandra Roy wrote:
Why the "-disable-largefile" option is necessary to do a
PostgreSQL 8.3.8 32-build ?
The problem will be fixed in the upcoming 8.5 release.
... and the next minor releases, eg 8.3.9.
regards, tom lane
Hi Tom, Laurenz and all,
Adding #include "postgres.h" in src/bin/psql/psqlscan.c fixes the problem !
I tested the fix with PostgreSQL 8.3.8 and I would check the 8.3.9 as
soon as possible.
Thank you so much for your help and your rapidity to solve this question
/ problem !!!
Have a nice day.
Regards,
Alexandra
Tom Lane a �crit :
"Albe Laurenz" <laurenz.albe@wien.gv.at> writes:
Alexandra Roy wrote:
Why the "-disable-largefile" option is necessary to do a
PostgreSQL 8.3.8 32-build ?The problem will be fixed in the upcoming 8.5 release.
... and the next minor releases, eg 8.3.9.
regards, tom lane
--
Alexandra ROY
Database Competence Center
Bull, Architect of an Open World TM
Phone: 04 76 29 77 01
http://www.bull.com
This e-mail contains material that is confidential for the sole use of
the intended recipient. Any review, reliance or distribution by others
or forwarding without express permission is strictly prohibited. If you
are not the intended recipient, please contact the sender and delete all
copies.