gcc crtbegin.o file

We just upgraded the version of gcc on our computers
from 4.1.0 to 4.1.1, and now the PGF90 and PGF95 compilers
don’t work. I now get the following error when I try to
build even the simplest of Fortran codes:

/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.1.0//crtbegin.o: No such file: No such file or directory

The directory “4.1.0” has been erased on our system and
replaced with “4.1.1”. Are there some shared objects in the
PG compilers that link to this file?

What’s the solution? Is it just to rebuild the PG compilers
from scratch?

Catherine

Hi Catherine,

The GCC directory the PGI compilers use is defined in a configuration file called “localrc” found in your PGI “bin” directory. Since this is a minor upgrade, the simplest solution is to edit “localrc” and change the paths of the “GCCDIR”, “GCCINC”, and “G77DIR” variables.

For major upgrades of GCC, you may need to instead rerun “makelocalrc” and/or re-install the PGI compilers.

Hope this helps,
Mat

% cat /usr/pgi/linux86-64/6.2-3/bin/localrc
set LFC=-lgfortran;
set LDSO=/lib64/ld-linux-x86-64.so.2;
set GCCDIR=/usr/lib64/gcc/x86_64-suse-linux/4.1.0/;
set GCCINC=/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include;
set G77DIR=/usr/lib64/gcc/x86_64-suse-linux/4.1.0/;
set NUMALIBS=-lnuma ;
set LOCALRC=YES;
set THROW=__THROW=;
set EXTENSION=__extension__=;
set LC=$if(-Bstatic,-lgcc -lgcc_eh -lc -lgcc -lgcc_eh -lc, -lgcc -lc -lgcc);

Change to:

set LFC=-lgfortran;
set LDSO=/lib64/ld-linux-x86-64.so.2;
set GCCDIR=/usr/lib64/gcc/x86_64-suse-linux/4.1.1/;
set GCCINC=/usr/lib64/gcc/x86_64-suse-linux/4.1.1/include;
set G77DIR=/usr/lib64/gcc/x86_64-suse-linux/4.1.1/;
set NUMALIBS=-lnuma ;
set LOCALRC=YES;
set THROW=__THROW=;
set EXTENSION=__extension__=;
set LC=$if(-Bstatic,-lgcc -lgcc_eh -lc -lgcc -lgcc_eh -lc, -lgcc -lc -lgcc);

Worked perfectly. All we had to do was edit the file
as suggested.

Thanks,

Catherine