Thread: Lessons learned on how to build 7.0.2 on AIX 4.x

Lessons learned on how to build 7.0.2 on AIX 4.x

From
rsand@vgalleries.com (Richard Sand)
Date:
Hi all-  I've recently had to suffer a torturous process of building 7.0.2 on AIX 4.3.2.  From my pouring through other newsgroups I've concluded that the problems I've hit exist at least on AIX 4.1.5 and 4.3.3 as well.  This note describes the problems I've encountered and how to get around them, as well as a request for some fixes.  Please accept my apology if this is known information- I couldn't find anything in this digest here.  Some of this is in the document FAQ_AIX, but not all of it.
 
1) First of all, you can't use IBM's make utility, gotta use GNU make.  So download gmake from http://www-frec.bull.com/docs/download.htm (where its put into an AIX installp package).  Be sure to rename /usr/local/bin/make to /usr/local/bin/gmake so as not to confuse it with AIX's make.
 
2) Now, when you first download postgres and try to run the configure program, if you are using GCC instead of the AIX compiler (which is expensive), you have to use the command:
 
./configure --with-template=aix_gcc

This forces GCC.  I used GCC 2.95.2. 
 
2a) If you need to install GCC there are some AIX packages you need.  I installed GCC and typed "gcc" and it responded "No input files found".  Sounds good.  But when I tried the configure command again it still fails to find a compiler.  So I write a little test program and try to compile it and it gives me an error "installation problem, cannot exec `as'".  Well, as it turns out, AIX doesn't install the assembler by default, you have to go and install the package "bos.adt.tools".  That's a wonderful IBM brainchild. :)  Ok, that's that mystery solved.
 
2b) Next, it gave me errors looking for a c++ compiler, so be sure to download gcc.g++.2.95.2 which installs AFTER gcc.2.95.2.
 
2c) Well, then I try compiling my test program with g++ and it complains about finding libm.a, so now we have to install the package "bos.adt.libm".  So dumb. :)
 
3) Ok so we're finally ready to build, and as soon as I type 'gmake', I get this error: 
 
Making postgres.imp
 ./backend/port/aix/mkldexport.sh postgres /usr/local/bin > postgres.imp nm: postgres: 0654-200 Cannot open the specified file.
 nm: A file or directory in the path name does not exist.
 
This is apparently a bug in the make scripts for Postgres.  I did find a workaround which was documented in one of the newsgroups.  I went into the ./src/backend directory and did 'gmake', and even though it failed I then copied the ./src/backend/postgres.imp file to ./src, and that seemed to correct the problem.
 
4) So I continue my gmake'ing, and this time it fails badly trying to compile libpq++.so.  The same person that suggested the postgres.imp workaround also said that they couldn't get the c++ portion to compile, so I hand edited the Makefile.global file in ./src and commented out the line "HAVE_Cplusplus=true"
 
This, finally, at long last (and after all the trouble of installing G++ and libm!), got the rest of Postgres 7.0.2 to compile.
 
Oh, and as the make output scrolled by, I see that it failed as well building some plpsql stuff, but it was non fatal.  There were also a zillion warnings, many of them about multiple type declarations for int8, int32, etc.

Now on to the installation!!
 
5) The install worked pretty smoothly.  The only trouble I had was installing the man pages, because it expected to use "zcat" to handle its .gz files, which AIX doesn't like.  So I had to change zcat to "/usr/local/bin/gunzip -c" in the ./src/Makefile.global (of course implying that I had already installed GNU zip).  I added the LD_PATH and MANPATH entries for pgsql to my /etc/environment.
 
I hope this information is helpful to any of you building this on AIX, and hopefully we can have someone from the Postgres team revisit the AIX installation process!  The missing AIX packages stuff could be added to the FAQ_AIX file, and hopefully the error in the makefile and the problem linking libpq++.so can be fixed.  If the latter is a G++ problem (would not surprise me!), keep in mind that many of us AIX users don't use xlC because IBM licenses the damned thing, so GCC is more more economical!
 
Best regards,
 

Re: Lessons learned on how to build 7.0.2 on AIX 4.x

From
Thomas Lockhart
Date:
> Hi all-  I've recently had to suffer a torturous process of building
> 7.0.2 on AIX 4.3.2.  From my pouring through other newsgroups I've
> concluded that the problems I've hit exist at least on AIX 4.1.5 and
> 4.3.3 as well.  This note describes the problems I've encountered and
> how to get around them, as well as a request for some fixes.  Please
> accept my apology if this is known information- I couldn't find
> anything in this digest here.  Some of this is in the document
> FAQ_AIX, but not all of it.

Great info. Would you have time to update FAQ_AIX? Or is there another
AIX partisan out there who would like to do the honors?

Regards.
                    - Thomas


Re: Lessons learned on how to build 7.0.2 on AIX 4.x

From
rsand@vgalleries.com (Richard Sand)
Date:
I'd be honored to!  I'll give it a shot- to whom should I submit it?

Could someone (at some point) take a look at the install bugs I (and others)
hit- i.e. the glitch in postgres.imp and the problem building libpq++ and
plpsql stuff?

Richard Sand (rsand@vgalleries.com)
http://www.vgalleries.com
-----Original Message-----
From: Thomas Lockhart <lockhart@alumni.caltech.edu>
To: Richard Sand <rsand@vgalleries.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Date: Wednesday, July 05, 2000 11:43 PM
Subject: Re: [HACKERS] Lessons learned on how to build 7.0.2 on AIX 4.x


>> Hi all-  I've recently had to suffer a torturous process of building
>> 7.0.2 on AIX 4.3.2.  From my pouring through other newsgroups I've
>> concluded that the problems I've hit exist at least on AIX 4.1.5 and
>> 4.3.3 as well.  This note describes the problems I've encountered and
>> how to get around them, as well as a request for some fixes.  Please
>> accept my apology if this is known information- I couldn't find
>> anything in this digest here.  Some of this is in the document
>> FAQ_AIX, but not all of it.
>
>Great info. Would you have time to update FAQ_AIX? Or is there another
>AIX partisan out there who would like to do the honors?
>
>Regards.
>
>                     - Thomas
>



Re: Lessons learned on how to build 7.0.2 on AIX 4.x

From
Peter Eisentraut
Date:
Richard Sand writes:

> 1) First of all, you can't use IBM's make utility, gotta use GNU make.

Quoth the installation instructions:

"Building PostgreSQL requires GNU make. It will not work with other make
programs."

> you have to use the command:
> 
> ./configure --with-template=aix_gcc

That has got to be a bug. The configure script should look for gcc
first. Can you show the relevant lines of configure output (checking for
cc... etc), when you don't use that option?


> Making postgres.imp
>  ./backend/port/aix/mkldexport.sh postgres /usr/local/bin > postgres.imp nm: postgres: 0654-200 Cannot open the
specifiedfile.
 
>  nm: A file or directory in the path name does not exist.
> 
> This is apparently a bug in the make scripts for Postgres.

Can you describe how to fix it? The AIX shared library stuff is an enigma
to me.

> I hand edited the Makefile.global file in ./src and commented out the
> line "HAVE_Cplusplus=true"

Quoth configure --help:

"  --without-CXX           prevent building C++ code"


> Oh, and as the make output scrolled by, I see that it failed as well
> building some plpsql stuff, but it was non fatal.

If it failed then it was fatal, and vice versa. Please elaborate.

> There were also a zillion warnings, many of them about multiple type
> declarations for int8, int32, etc.

I'll make a note of it.

> installing the man pages, because it expected to use "zcat" to handle
> its .gz files, which AIX doesn't like.  So I had to change zcat to
> "/usr/local/bin/gunzip -c" in the ./src/Makefile.global (of course

Noted.


-- 
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden