compile error: /usr/lib/crt1.o: In function `_start': (.text

I recently upgraded a system running PGI 7.1-6 from RHEL 5.2 to RHEL 5.5 (32 bit) and now users can’t compile using pgi compilers.

The problem can be seen while compiling the example programs:

-bash-3.2$ pgf77 fftpde.F -o fftpde
/usr/lib/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'

Here is the version information:

-bash-3.2$ pgf77 -V

pgf77 7.1-6 32-bit target on x86 Linux -tp piv
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.

Is there a version compatibility problem with the system libraries?

Hi staff@hpcc.uh.edu,

I’m guessing you didn’t re-install the PGI compilers after upgrading the OS?

Most likely what’s happened is that that the GCC version changed so the compiler is no longer able to find these system libraries. To fix, edit the GCC Path variables your ‘localrc’ file found in your PGI install’s bin directory to the new version.

Though, the actual error seems to imply that the Fortran main object (pgfmain.o) isn’t getting linked in. I’m not sure if this is a side effect of the GCC paths being incorrect or a different problem altogether.

Just in case, please post the output of the command ‘pgf77 x.o -dryrun’.

Thanks,
Mat

Thanks for the response. I did re-install the compilers after the upgrade and ran makelocalrc. Here’s the dryrun output:

-bash-3.2$ pgf77 x.o -dryrun
Reading rcfile /share/apps/pgi/linux86/7.1-6/bin/.pgf77rc
Reading rcfile /share/apps/pgi/linux86/7.1-6/bin/nativerc
Reading rcfile /share/apps/pgi/linux86/7.1-6/bin/fnativerc
Reading rcfile /share/apps/pgi/linux86/7.1-6/bin/x86rc
Reading rcfile /share/apps/pgi/linux86/7.1-6/bin/x8632rc
Reading rcfile /share/apps/pgi/linux86/7.1-6/bin/lin86rc
Reading rcfile /share/apps/pgi/linux86/7.1-6/bin/lin8632rc
Reading rcfile /share/apps/pgi/linux86/7.1-6/bin/iparc
Reading rcfile /share/apps/pgi/linux86/7.1-6/bin/pgf77rc
Reading rcfile /share/apps/pgi/linux86/7.1-6/bin/pgftnrc
Reading rcfile /share/apps/pgi/linux86/7.1-6/bin/localrc
Reading rcfile /share/apps/pgi/linux86/7.1-6/bin/localrc.compute-0-0
Skipping siterc (not found)
Skipping siterc.compute-0-0 (not found)
Skipping .mypgf77rc (not found)

/usr/bin/ld /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc/i386-redhat-linux/4.1.2/crtbegin.o -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /share/apps/pgi/linux86/7.1-6/lib/pgi.ld -L/usr/pgi/7.1-6/share_objects/liblf -L/usr/pgi/7.1-6/share_objects/lib -L/share/apps/pgi/linux86/7.1-6/lib-linux86-g232 -L/share/apps/pgi/linux86/7.1-6/lib -L/usr/lib -L/usr/lib/gcc/i386-redhat-linux/4.1.2 x.o -rpath /usr/pgi/7.1-6/share_objects/lib -rpath /share/apps/pgi/linux86/7.1-6/lib-linux86-g232 -rpath /share/apps/pgi/linux86/7.1-6/lib -lpgftnrtl -lpgsse1 -lpgsse2 -lnspgc -lpgc -lrt -lpthread -lm -lgcc -lc -lgcc /usr/lib/gcc/i386-redhat-linux/4.1.2/crtend.o /usr/lib/crtn.o

and here’s the localrc.compute file (same for all nodes in my ROCKS cluster):

set LFC=-lgfortran;
set LDSO=/lib/ld-linux.so.2;
set GCCDIR=/usr/lib/gcc/i386-redhat-linux/4.1.2;
set GCCINC=/usr/lib/gcc/i386-redhat-linux/4.1.2/include;
set G77DIR=/usr/lib/gcc/i386-redhat-linux/4.1.2/;
set OEM_INFO=32-bit target on x86 Linux $INFOTPVAL;
set LOCALRC=YES;
set COMPGLIBDIR=lib-linux86-g232;
set COMPGINCDIR=include-g23;
set THROW=__THROW=;
set EXTENSION=__extension__=;
set COMPGLIBLFDIR=lib-linux86-g232-lf;
set LOCALCOMPLIBLF=/usr/pgi/7.1-6/share_objects/liblf;
set COMPGCCINCDIR=include-gcc41;
set LC=$if(-Bstatic,-lgcc -lgcc_eh -lc -lgcc -lgcc_eh -lc, -lgcc -lc -lgcc);
set HAMMER=;
set X86_64=;
# GLIBC version 2.5
# GCC version 4.1.2
set LOCALCOMPLIB=/usr/pgi/7.1-6/share_objects/lib;
export PGI=/share/apps/pgi;
# makelocalrc executed by root Tue Jul 13 13:53:47

The path to GCCDIR does exist for 4.1.2 (4.1.2 being a symlink to 4.1.1) in /usr/lib/gcc/i386-redhat-linux (from the localrc file).

According to rpm, gcc 4.1.2 is what’s installed:

-bash-3.2$ rpm -qa | grep gcc
gcc-4.1.2-48.el5
libgcc-4.1.2-48.el5
gcc-c++-4.1.2-48.el5
gcc-gfortran-4.1.2-48.el5

and rpm -ql gcc shows that 4.1.2 puts everything in the 4.1.1 directory and creates the symlink for 4.1.2.

Thanks again,

-Mike

Hi Mike,

I asked our Customer Service people about this. They think you should try installing the single system versus the network install. A single system install can still be used by multiple systems provided that the systems are homogeneous.

Though, the dryrun output shows that the pgfmain.o is missing from the link. This only occurs if the file has been deleted from your installation’s PGI lib directory. Can you check if the file '/share/apps/pgi/linux86/7.1-6/lib/pgfmain.o" exists?

If the re-install doesn’t work, please contact PGI Customer Support directly (trs@pgroup.com). This is an odd one that will most likely take several back and forth emails to figure out.

Thanks,
Mat