Thanks! I got your C++ example.
sierra% uname -a
Darwin sierra.pgi.net 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 201
sierra% g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
When I compile with
sierra% pgc++ -V
pgc++ 17.10-0 64-bit target on macOS -tp haswell
PGI Compilers and Tools
Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
sierra% pgc++ -c test.cpp
“test.cpp”, line 13: error: expected a “;”
for (char c : buf) {
^
“test.cpp”, line 13: error: expected an expression
for (char c : buf) {
^
“test.cpp”, line 13: error: expected a “;”
for (char c : buf) {
^
“test.cpp”, line 22: warning: explicit type is missing (“int” assumed)
for (auto count : nums)
^
“test.cpp”, line 22: error: expected a “;”
for (auto count : nums)
^
“test.cpp”, line 22: error: expected an expression
for (auto count : nums)
^
“test.cpp”, line 22: error: expected a “;”
for (auto count : nums)
^
“test.cpp”, line 23: error: no instance of overloaded function “get” matches
the argument list
argument types are: (int)
cout << (char)get<0>(count) << " occurs " << get<1>(count) << " times\n";
^
“test.cpp”, line 23: error: no instance of overloaded function “get” matches
the argument list
argument types are: (int)
cout << (char)get<0>(count) << " occurs " << get<1>(count) << " times\n";
^
8 errors detected in the compilation of “test.cpp”
=================================================
Now when I add c++11 to the compilation, things work.
sierra% pgc++ -o test test.cpp -std=c++11
and test is built.
On Linux pgc++ will not support -std=c++11 unless you are
g++ 4.8 or newer. For -std=c++14 you need g++ 5.2 or newer.
This OS X Xcode version works, but the
" --with-gxx-include-dir=/usr/include/c++/4.2.1" is confusing.
dave