Installing 5.2 on AMD64 running Gentoo linux

We are migrating from 32 bit to an Opteron system running the latest Gentoo Linux with both 64 and 32 bit support and the gcc 3.3.3 compiler, licensing issues are taken care of with a permanent license (no errors).

Following the install instructions we know that:

gcc –m32 hello.c
and gcc –mcmodel=medium hello.c
gcc –m64 hello.c

We got errors on crtbegin.o which was resolved for the 64 bit compiler by
defining (in /usr/pgi/linux86-64/5.2/bin/lin86rc)
#set GCCINC=/usr/i386-redhat-linux/include
set GCCINC=/usr/lib/gcc-lib/x86_64-pc-linux-gnu/3.3.3/include
#set GCCDIR=/usr/lib/gcc-lib/i386-redhat-linux/
set GCCDIR=/usr/lib/gcc-lib/x86_64-pc-linux-gnu/3.3.3
#set G77DIR=/usr/lib/gcc-lib/i386-redhat-linux/
set G77DIR=/usr/lib/gcc-lib/x86_64-pc-linux-gnu/3.3.3

So now a simple test.F program that looks like so:
program test
print*,‘Test me out’

compiles with the 64 bit compiler:
oberon ekv3 # /usr/pgi/linux86-64/5.2/bin/pgf90 test.F
oberon ekv3 # ./a.out
-bash: ./a.out: Accessing a corrupted shared library

With the 32 bit compiler we cannot compiler given the same settings or adding the trailing /32 to the /usr/pgi/linux86/5.2/bin/lin86rc:
set GCCINC=/usr/lib/gcc-lib/x86_64-pc-linux-gnu/3.3.3/include
set GCCDIR=/usr/lib/gcc-lib/x86_64-pc-linux-gnu/3.3.3/32
set G77DIR=/usr/lib/gcc-lib/x86_64-pc-linux-gnu/3.3.3/32

oberon ekv3 # /usr/pgi/linux86/5.2/bin/pgf90 test.F
/usr/bin/ld: cannot find -lpgc

Any help on both these issues would be great! I need to get MM5 going on this box, although the version compiled for the 5.0 compiler seems to run with only one processor (the box is a dual 248 with 8GB of RAM), as does, both of which are 32 bit programs. Also, the test.F program compiled on the 32 bit box works on the Opteron box.


Gentoo is not one of the distributions that PGI has in-house, though there
should be no reason why the PGI compilers cannot be made to work.

For starters, you should make your changes in the localrc file. Changes
made in there will override any settings in any *rc file. No one should be
changing the other *rc files, because unintended consequences can happen.

If you haven’t tried running the install script to install the compilers, you
really should start with that. The configuration that you describe should
be supported by the 5.2 installer by default.

After installing, next check the localrc file in $PGI/linux86/5.2/bin and
$PGI/linux86-64/bin. There should be some differences. Especially,
make sure that GCCDIR, GCCINC, and G77DIR are set properly. The
install script uses the gcc binary that it finds in $PATH to detemine
these settings.

I’ve downloaded the Gentoo amd64 2004.2 ISO and will get it installed so
we can test this out for ourselves.


Just checking in to see if progress has been made. We might just switch the license to an intel box if we cannot use amd64 version to cross compile on Gentoo.


If I’m understanding this correctly, your wanting to use your AMD64 system to build both 64 and 32-bit executables?

This is my personal opinion so take it for what it worth, but you might consider using SuSE9.1 instead of Gentoo. It’s my understanding that by default Gentoo only supports 64-bit applications. For 32-bit applications, you must install a separate emulation package. SuSE9.1 supports both.

You can then use the PGI “-tp” flag to target various systems. For example, if you build an application on an AMD64 using “-tp piv”, you’ve created a 32-bit executable targeting an Intel Pentium IV.

Good Luck,

I fixed the installation.


  1. A full system update including gcc-3.3.4-R1, glibc- - this forced an update of emulation libraries.

  2. Running ./makelocalrc in the /usr/pgi/linux86/5.2/bin and /usr/pgi/linux86-64/5.2/bin and adding the ourput to lin86rc (cat localrc >> lin86rc and lin8664rc) and removing duplicate old entries.

So both 32 and 64 bit versions of pgf90 are working.