I have a large set of C++ files that are being migrated from Athlon machine to a Quad Opteron. Naturally, my first step is to make sure everything compiles on the Opteron in 32-bit mode first, before moving to 64-bits. These machines have slightly different versions of the PGI compilers (5.1-2 vs 5.1-6 on the Opteron), but I can’t even compile a ‘Hello World’ code on the Opteron! It’s complaining about errors in a single PGI include file, and I have no idea how to resolve them - please help me!
The simple C++ program, test.cpp :
#include <iostream.h>
main ()
{
cout << "hello world!\n";
}
When compiled on the Athlon machine :
- zaphod% which pgCC
/usr/local/pgi/linux86/5.1/bin/pgCC
zaphod% pgCC -c -V test.cpp
pgCC 5.1-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2003, STMicroelectronics, Inc. All Rights Reserved.
Edison Design Group C/C++ Front End, version 3.3 (Nov 4 2003 16:45:25)
Copyright 1988-2003 Edison Design Group, Inc.
PGCC/x86 Linux/x86 5.1-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2003, STMicroelectronics, Inc. All Rights Reserved.
zaphod%
when the same file is compiled (in 32-bit mode) on the Opteron :
- shire% which pgCC
/usr/local/pgi/linux86/5.1/bin/pgCC
shire% pgCC -V -c test.cpp
pgCC 5.1-6
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2003, STMicroelectronics, Inc. All Rights Reserved.
Edison Design Group C/C++ Front End, version 3.3 (Nov 4 2003 16:45:25)
Copyright 1988-2003 Edison Design Group, Inc.
“/usr/local/pgi/linux86/5.1/include/CC/stl/_limits.h”, line 155: error:
identifier “CHAR_BIT” is undefined
((int)((sizeof(_Int) * (CHAR_BIT))) - ((__imin == 0) ? 0 : 1))
^
detected during instantiation of class “std::_Integer_limits<_Int,
__imin, __imax, __idigits, __ismod> [with _Int=bool,
__imin=false, __imax=true, __idigits=1, __ismod=false]” at
line 245
… much more output removed …
“/usr/local/pgi/linux86/5.1/include/CC/stl/_limits.h”, line 502: error:
identifier “DBL_EPSILON” is undefined
static double _STLP_CALL epsilon() _STLP_NOTHROW { return DBL_EPSILON; }
^
39 errors detected in the compilation of “test.cpp”.
shire%