Link to home
Start Free TrialLog in
Avatar of assistunix
assistunixFlag for United States of America

asked on

How to Install GCC Compiler on AIX (5.3)

Can someone please provide me All the steps in How to Install GCC Compiler on AIX (5.3)
and how to verify it, after it has been installed.

Avatar of assistunix
Flag of United States of America image


This question needs to be in IBM AIX ZONE, and i am STILL UNABLE TO put it in that zone.
Please put this question, in IBM AIX ZONE - RPM format - BFF format - TGZ format

make sure you install system perl before installing anything else because BFF and RPM perl are mutually exclusive, and you cannot use the other collection after
Avatar of woolmilkporc

let's see what gcc versions we have.

aixpdslib: 4.1.0

AIX toolbox + bullfreeware:

Bull no longer has BFF packages for gcc - they just point to the AIX toolbox RPMs.  
There is thus no need to worry about perl - particularly because perl is part of AIX sinde AIX 5L and no longer has to be installed separately. - has, so I'd recommend installing this version.

Download these packages:


gfortran is optional, I strongly assume that you don't need it. Please don't install it in this case, because there are some ugly dependencies.

Use the rpm tool (which is also part of AIX since 5L) to install them. The general format is:
rpm -ivh /path/to/downloaded/package

Start with libgcc, then continue with gcc. There is a specialty with gcc - it formally depends on the "info" package, which you don't need and which also has extensive dependencies. So install gcc with

rpm -ivh --nodeps gcc-4.2.4-2.aix5.3.ppc.rpm

Continue with libstdc++ and libstdc++-devel, then install gcc-c++, gcc-cpp and libgomp.

That's all.

Run a first test by simply issuing
gcc -v  (Display the programs invoked by the compiler)
gcc --version
gcc --help

Next you could compile the usual  small Hello World program:

#include <stdio.h>
int main(void)
printf("\nHello world!\n");
return 0;

Save the above in a file helloworld.c and run
gcc helloworld.c

You will find a file named a.out in the current directory. Type
and watch what happens.

Good luck!

Btw. Right. You. Are! This Q should be in the AIX zone! That new Question Wizard is just silly!



Hello wmp
Thank you for your reply.
I am not exactly sure what GCC is, but i have been told to Install GCC.

I had visited and saw a file called, gcc     4.2.0 (5.3)     License     RPM     Source     GNU Compiler Collection

My question is, do i need ALL the filesets that you mentioned above for GCC installation ( or can i just install this one fileset from (
gcc     4.2.0 (5.3)     License     RPM     Source     GNU Compiler Collection

Also, i downloaded the older versions of these filesets that you had mentioned from
the reason i download older versions was because the newer version required a newer rpm version.

I installed these:

after installing this in the sequence you had suggested, i tried doing the test, however i believe i am failing the test.

after creating a helloworld.c file with content
#include <stdio.h>
int main(void)
printf("\nHello world!\n");
return 0;

i run gcc helloworld.c
and a file called a.out gets created.

however, when running a.out , i get an error.

[root@local] /
# ls a.out
[root@local] /
# a.out
ksh: a.out:  not found.
[root@local] /
./a.out works and gives me this output

[root@local] /
# ./a.out

Hello world!
[root@local] /

However, when you get a chance, can you please answer my inquiry if all these filesets are Must needed for gcc compiler installation or can i just install only
gcc     4.2.0 (5.3)     License     RPM     Source     GNU Compiler Collection

let's see what the single packages contain.

gcc is the C compiler itself.

libgcc is gcc's low-level runtime library and you will always need it, because the compiler would generate calls to routines in this library automatically.

gcc-cpp is the C preprocessor, used automatically by the C compiler to transform programs before compilation and is thus also always needed.

gcc-c++ is the C++ compiler.

libstdc++(-devel) are the C++ counterparts of the packages above. Whether you will need them depends on what kind of software you're planning to create / compile.
If you're going to compile and use Open Source programs, it is rather probable that you will need the C++ stuff, if you're planning to develop your own software you should know better than I whether you will program in C++ or not.

libgomp is an API library for multi-platform shared-memory parallel programming in C/C++ and Fortran.
Sometimes needed with Open Source software - whether you're going to use it in own pojects is your decision.
Since it's only ca. 120 KB in size I'd recommend installing it so it will be there if needed.

IBM's toolbox is practically as good as, but the latter generally has the newer versions and  its website usually gives hints on prerequisites and possible pitfalls, so you can plan your installation instead of just reacting on rpm's complaints about e.g. missing prerequisites or the like.

Btw. >> I am not exactly sure what GCC is ... << - please look here:

Hope I could help you a bit.


Thank you for that clarification.
One last clarification that i needed was about
gcc     4.2.0 (5.3)     License     RPM     Source     GNU Compiler Collection

it seems if that fileset is a Compiler Collection , includes all or most of the individual filesets that aer available at
can you confirm that ?

i uninstalled all the filesets from and installed this one GNU Compiler Collection
and ran the helloworld.c test and it worked. Does that also indicate that GNU Compiler Collection contains the needed filesets in one fileset.
perl sometimes conflicts with package manager in general, since this does not happen on your system, you have gcc installed.
I feel a bit confused by your "" or "". Do you mean "", or are you talking about something completely different?
And all this has absolutely nothing to do with Perl, the "Practical Extraction and Report Language"!

Anyway, issue "rpm -qa" and check what's installed.

sorry about the confusion, my apologies. by and , i meant

my question is that your helloword.c test worked after installing all the filesets from as you suggested and it also worked with fileset
 gcc     4.2.0 (5.3)     License     RPM     Source     GNU Compiler Collection

question is

does gcc compiler Collection fileset from ibm = all filesets from
rpm -qa
I fear it's not quite clear what I'm trying to tell you.

rpm -qa will show you all installed RPMs.

Using this command you will see that GCC from the toolbox is only gcc and nothing else.

One difference is there, though, which can be seen with rpm -ql gcc-4.2.0-3.aix5.3.ppc.rpm
You will notice that there is "cpp" in addition to gcc: IBM's package contains the preprocessor which is in "gcc-cpp" at

And that's why you have been able to compile your helloworld.c program.
The cpp contained in gcc (IBM) resolved the "#include" directive, and because the only function you use ("printf()") is in /usr/lib/libc.a(stdio) which is part of AIX there is no need for libgcc and all the other packages.

Now, if you're planning to compile only such simple programs you should well be able to get along with gcc (including cpp) alone, but if you're going to write more sophisticated things or if you're going to compile Open Source programs gcc alone will fail.

You should re-read my comment  #34171300 above, because all I wrote there is also valid for the toolbox version of GCC - OK, except for the word "always" in the "libgcc" part.

Hope I could clarify things a bit.

Thank you very much, that really clarifies it.
I have another question though.

 THe format in which i had GCC Compiler in was RPM. However the RPM in my system is of an older version which does not install the GCC Compiler version i try to install.
And i do not want to Upgrade the RPM version intsalled in my AIX.

Is there another way of Installing GCC, without it being in an RPM format?

I had downloaded the RPM version gcc     4.2.0 (5.3)     License     RPM     Source     GNU Compiler Collection


I downloaded the GCC from the source through that link, in the format of .tar.bz2
but can i install gcc in that version?
can i install gcc in .tar version after uncompressing it.

or do i have to untar the file and install from with in it.

Can i use installp for installation?
The GCC source as obtained from (I assume that's where you downloaded it from) must be compiled and linked.
Now that you have a gcc compiler installed via rpm you could of course use this compiler to build a newer version from source.
The method is as usual - run "configure", "make", "make test" and "make install", if I remember well.
But attention - installation paths will be different from the ones the RPM version uses - it will require a bit of effort to clean things up.
I, personally, would not recommend installing from source here, only to get a slightly newer version of gcc.

installp is only for bff packages, and afaik the only bff packages for GCC around (since bullfreeware ceased to build/offer them) are the ones from pWare, the newest being
You should deinstall the RPM version you have beforehand, because the pWare paths are also different from the RPM paths.

By the way, the GCC packages from GNU and pWare have all the stuff I mentioned in my former post above, e.g. libgcc, gcc-c++, libstdc++ and so on, and are thus true "collections".


hello wmp

turns out it might not be the actual rpm version that's causing the problem, but the AIX-rpm version.
these two may or may not be related, but the issue i am getting is installing gcc on my aix 5.3.

IN AIX 5.3
The following errors occurred during installation:
rpm -ivh gcc-4.2.0-3.aix5.3.ppc.rpm
error: failed dependencies:
AIX-rpm >= is needed by gcc-4.2.0-3

My rpm version is
# rpm --version
RPM version 3.0.5

and when i run rpm -qa | grep AIX , i get an output of AIX-rpm less than (don't remember the exact number, and currently unable to access it to verify the number)

I need help in figuring out, how can i update my AIX-rpm to greater than
would upgrading my # rpm --version   help ?
                                   RPM version 3.0.5

IN AIX 6.1
also, i tried to generate a similar error of AIX-rpm version not being compatible enough to install gcc, and i was able to generate the following error on it, by installing 5.3 gcc version gcc-4.2.4-2.

[root@server] /perzl/5 # rpm -ivh gcc-4.2.4-2.aix5.3.ppc.rpm
error: failed dependencies:
        AIX-rpm < is needed by gcc-4.2.4-2   <note in this installation it is requiring a smaller version AIX-rpm

although i do not need this gcc version of 5.3 to be installed on aix 6.1, however i would like to learn how can i downgrade the AIX-rpm version? as needed in this case.

Do note, that 6.1 gcc version gcc-4.2.4-2 was successfully installed and also 5.3 gcc version gcc-4.2.0-3 was also successfully installed.

my aix 6.1 server information:

[root@server] / # rpm --version
RPM version 3.0.5
[root@server] / # rpm -qa | grep AIX
[root@server] / #

My urgency is on resolving the installation on aix 5.3, which is requiring an upgrade of AIX-rpm to a version higher than

Please provide your insight on it.

see my comment in your Q

Essentially there are no such things like "actual rpm version" and "AIX rpm version".
rpm for AIX is contained in a fileset called "rpm.rte", the actual rpm package in there is called "AIX-rpm", but finally the rpm binary deep inside is just the well-known Open Source "rpm" which can also be found under Linux and other UNIXes.
--> It should never happen that rpm is installed twice on a system! This would lead to a terrible mess in your library directories /usr/lib and /usr/local/lib!

The confusing part of this all is that AIX-rpm has a version number following the AIX "Version-Release-Modification-Fixpack" scheme which gets "counted up" along with the AIX level, whereas rpm.rte as well as the rpm binary itself carry a version number as assigned from Open Source development.

Example: lslpp for rpm.rte could show "" , "rpm --version" could show "RPM version 3.0.5" but "rpm -qa | grep rpm" would show "AIX-rpm-".

In the other thread I told you where to get the newest AIX 5.3 rpm installp package (that's where I got the above version numbers from).
Up to now I couldn't find a version suitable for AIX 6.1 which you could download. It's only on the AIX 6.1 installation media - which you could of course download as ISO images from IBM's Entitled Software Support pages, if you have an appropriate contract with IBM:

As for downgrading: Please don't! rpm.rte always contains bzip2, gettext, info and zlib, which would be downgraded along with rpm.
Particularly gettext is important, because it contains libintl.a (and the shared object part "" within), a library that provides native language support to programs. This library is widely used in various programs, and downgrading it would certailnly lead to many of these programs not working properly any more.

This is the current setting in my system-

root / >
# oslevel -s

root / >
# rpm -qa | grep AIX

root / >
# lslpp -h rpm.rte
Fileset Level Action Status Date Time
Path: /usr/lib/objrepos
rpm.rte COMMIT COMPLETE 05/01/09 17:41:15

Path: /etc/objrepos
rpm.rte COMMIT COMPLETE 05/01/09 17:41:22
I tried installing an older version of gcc-3.3.2-5.aix5.3.ppc.rpm, but it gave me the same error i had gotten when i tried installing gcc-4.2.0-3.aix5.3.ppc.rpm and both versions gave me the following error. of needing an AIX-rpm greater than .

RPM Error Summary:
The following errors occurred during installation:
error: failed dependencies:
AIX-rpm >= is needed by gcc-3.3.2-5

So the issue to me, as it seems is that, the gcc versions are for aix 5.3 and although the current level of my aix is 5300-07-02-0806, but my AIX-rpm version states AIX-rpm- needs to be updated) . According to you and the search i did online, it seems as the AIX-rpm "version" should show the current oslevel version which is 5300-07-02-0806.

Is that correct?

From my online search i came across this link, which states on how to update your AIX-rpm version.

It is mentioned to to update bos.rte and than use the following command /usr/sbin/updtvpkg to update AIX-rpm. Can you please provide your insight on that? is updating bos.rte neccesary, when the oslevel is already at 5300-07-02-0806, which is higher the (the version, AIX-rpm reads).

Please assist with getting gcc installed on this system. Thank you.
Avatar of woolmilkporc
Flag of Germany image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you for your help.