C++ support on Apple OSX?

Hi - I’ve installed PGI Workstation 7.0-7 on my Apple Mac OSX system.

Both the 32-bit and 64-bit C compilers appear to be basically working, but I’m unable to compile any C++ programs:

$ uname -a
Darwin zippy 8.11.1 Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386 i386 i386

$ cat hello.cc

int main() {
std::cout << “hi” << std::endl;
return 0;

$ /opt/pgi/osx86/7.0/bin/pgCC hello.cc
pgCC-Warning-Please use pgCC for C++ source files: hello.cc

The “warning” is actually an error, because the compiler produces no output files.

It’s worth noting that due to the case-insensitive OSX file system, /opt/pgi/osx86/7.0/bin/pgCC and /opt/pgi/osx86/7.0/bin/pgcc are actually the same executable file, which may be part of the problem here.

Is the C++ language supported at all on the OSX platform?
If so, what’s the correct way to invoke the PGI compiler for C++ compilation on OSX?



We do not have C++ support for OSX in 7.0-7. We will have it in 7.1-5 release.


I’ll be the first to concede that I’m not the smartest guy out there but I’m trying to compile OpenMPI with 7.1-5 on a machine running 10.4.11 and the configure step is dying:

./configure CC=pgcc CXX=pgcpp F77=pgf77 FC=pgf90

*** C++ compiler and preprocessor
checking whether we are using the GNU C++ compiler… no
checking whether pgcpp accepts -g… yes
checking dependency style of pgcpp… none
checking how to run the C++ preprocessor… pgcpp -E
checking for the C++ compiler vendor… portland group
checking if C++ compiler works… no

  • It appears that your C++ compiler is unable to produce working
  • executables. A simple test application failed to properly
  • execute. Note that this is likely not a problem with Open MPI,
  • but a problem with the local compiler installation. More
  • information (including exactly what command was given to the
  • compiler and what error resulted when the command was executed) is
  • available in the config.log file in this directory.

configure: error: Could not run a simple C++ program. Aborting.

I can’t make head or tail out of the contents of config.log. The “local compiler installation” was achieved by following the directions in the .pkg file so everything’s default.

I suppose question number one is: given the stupidity of HFS+, is “pgcpp” the C++ compiler since the FS doesn’t distinguish between pgcc and pgCC? If so, question number two is: What now?