corrupt libstd.a?

Hi,

I am evaluating PG C++ compilers with a trial licence, and I am having trouble with anything that requires STL.

e.g. compiling:
#include

int main() {
std::cout << “hello world\n”;
return 1;
}

results in:
$ pgCC hello.cc
NOTE: your trial license will expire in 14 days, 6.35 hours.
pgCC-Fatal-/usr/bin/ld TERMINATED by signal 11
Arguments to /usr/bin/ld
/usr/bin/ld /usr/lib/crt1.o /usr/lib/crti.o /xtal/devel/pgi/linux86/8.0-5/lib/trace_init.o /usr/lib/gcc/i386-redhat-linux/4.3.0/crtbegin.o -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /xtal/devel/pgi/linux86/8.0-5/lib/pgi.ld -L/xtal/devel/pgi/linux86/8.0-5/lib -L/usr/lib -L/usr/lib/gcc/i386-redhat-linux/4.3.0 /tmp/pgCCUgFdkYWkZlUb.o -rpath /xtal/devel/pgi/linux86/8.0-5/lib -lstd -lC -lpgsse1 -lpgsse2 -lnspgc -lpgc -lm -lgcc -lc -lgcc /usr/lib/gcc/i386-redhat-linux/4.3.0/crtend.o /usr/lib/crtn.o

Interestingly, the C-version (with a printf instead of std::cout) of the same compiles and links (with both pgcc and pgCC). With some trial-and-error I found out that omitting -lstd from the linker command line prevents the linker segmentation fault (but of course complains about missing symbols). Running “nm” on libstd.a also crashes:
$ nm /xtal/devel/pgi/linux86/8.0-5/lib/libstd.a

00002020 t uninitialized_fill_n__tm__8_PPvUiPv__3stdFZ1ZZ2ZRCZ3Z_Z1Z
U vfprintf
000000e0 T what__Q2_3std17__Named_exceptionCFv
Segmentation fault

I have checked the md5 checksum and it agrees with the one provided on the website. OS is Fedora 9 32bit on a quad-core Intel Core2. Any pointers?

Thanks, Gabor

Hi Gabor,

I have not heard of this occuring before and I’m not able to replicate the issue here. What is the checksum of your libstd.a? It should be:

% md5sum pgi/linux86/8.0-5/lib/libstd.a
c418d479ca82c9e6ed696c4e7330f5f1  pgi/linux86/8.0-5/lib/libstd.a
  • Mat

Hi Mat,

The checksums seem to agree.

$ md5sum /xtal/devel/pgi/linux86/8.0-5/lib/libstd.a 
c418d479ca82c9e6ed696c4e7330f5f1  /xtal/devel/pgi/linux86/8.0-5/lib/libstd.a
$ uname -a
Linux perch.cimr.cam.ac.uk 2.6.27.21-78.2.41.fc9.i686 #1 SMP Mon Mar 23 23:45:58 EDT 2009 i686 i686 i386 GNU/Linux
$ ld --version
GNU ld version 2.18.50.0.6-7.fc9 20080403

Could this be some problem with the trial licence? I have moved license.dat away and the compilers stopped working ( “pgi-cpp-lin32: LICENSE MANAGER PROBLEM: Cannot find license file.”). I have also reinstalled the software to another location, as a normal user, and it is still the same.

Thanks, Gabor

Hi Gabor,

It wouldn’t be license issue and since the library check sums are correct, it’s not a library issue.

My best guess is that there is problem with is particular version of binutils. My Fedora 9 system in 64-bits, so I’ll need to have my IT build a 32-bit Fedora 9 box, so it may be a few days before I can try and duplicate it. One difference is your binutils are slightly different build than mine (2.18.50.0.6-2 vs 2.18.50.0.6-7.fc9). It appears that your is a more recent update.

One thing you can try is to build a newer binutils (http://ftp.gnu.org/gnu/binutils/) and see if that works.

  • Mat

Hi Mat,

Thanks for looking into this! I will definitely try with the latest binutils.

In the meantime, I have tried to install on another machine as well, this time running OpenSuSE 10.0 (32bit). On this machine “nm” has no problem reading all the symbols from libstd.a, but now there is an issue with the compilers:

$ pgcc hello.c
pgi-cc-lin32: LICENSE MANAGER PROBLEM: Failed to checkout license

I am using the same license.dat as on the Fedora machine. This particular machine has Mathematica installed, can this be some interplay between the licence managers? If so, how can I fix it?

Thanks, Gabor

Hi Gabor,

The trial license is node locked, meaning that it can’t be moved from one system to another. Please send a note to license@pgroup.com and we should be able to get you another trial license for the second system.

  • Mat

Hi Gabor,

We were able to install 32-bit Fedora 9 on a VM here with all current updates. However, when I try your command, ld links fine. So the error seems to be something specific to your system.

fedora9-32:/tmp% pgCC -V

pgCC 8.0-5 32-bit target on x86 Linux -tp penryn
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2009, STMicroelectronics, Inc.  All Rights Reserved.
fedora9-32:/tmp% pgCC test.cpp
NOTE: your trial license will expire in 14 days, 9.85 hours.
fedora9-32:/tmp% ld --version
GNU ld version 2.18.50.0.6-7.fc9 20080403
Copyright 2007 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
  • Mat

Hi Mat,

I have compiled and installed the latest binutils, version 2.19. This seems to work fine, and pgCC can now link.

Thanks for your help!

Gabor