pgc++ --version
pgc++ 18.10-1 64-bit target on x86-64 Linux -tp sandybridge
PGI Compilers and Tools
Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
and a simple test code
#include <memory>
#include <vector>
#include <cstddef>
size_t size();
void x() {
std::size_t n=2;
std::shared_ptr<std::vector<double> > p = std::make_shared<std::vector<double> >(n);
std::shared_ptr<std::vector<double> > q = std::make_shared<std::vector<double> >(size());
std::shared_ptr<std::vector<double> > r = std::make_shared<std::vector<double> >((n=size()));
std::vector<double>* s = new std::vector<double>(size());
}
Compiling with pgc++ gave me:
pgc++ --c++11 -c test.cpp
“./test.cpp”, line 8: error: namespace “std” has no member “shared_ptr”
std::shared_ptr<std::vector > p = std::make_shared<std::vector >(n);
…
I’m able to compile this file here so I suspect something else is wrong.
What version of g++ do you have installed? Does the code compile with g++?
In order to be inter-operable, we use the STL that ships with g++. Hence if you have an older g++ version that doesn’t support C++ 11 (pre 4.8.5), then this would cause this error.
-Mat
% g++ --version
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
% pgc++ -V18.10 --c++11 test.cpp -c
%
$which g++
/opt/gcc/7.1/bin/g++
$g++ --version
g++ (GCC) 7.1.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
The same code compiles fine with this g++.
However,