Pgi compiler Error: "shared_ptr" is ambiguous

Hello, I’m trying to compile some software package named “xios” with fcm. And it compiles well with g++, but I could not make it work with pgi compiler. I got the following error.

“/usr/local/xios-2.5/inc/object_template.hpp”, line 85: error: “shared_ptr” is
ambiguous
shared_ptr getShared(void) ;

#######this it the working setup for g++ compiler#
%CCOMPILER mpicc
%FCOMPILER mpif90
%LINKER mpif90

%BASE_CFLAGS -ansi -w
%PROD_CFLAGS -O3 -DBOOST_DISABLE_ASSERTS
%DEV_CFLAGS -g -O2
%DEBUG_CFLAGS -g

%BASE_FFLAGS -D__NONE__
%PROD_FFLAGS -O3
%DEV_FFLAGS -g -O2
%DEBUG_FFLAGS -g

%BASE_INC -D__NONE__
%BASE_LD -lstdc++

%CPP cpp
%FPP cpp -P
%MAKE make

#########this is the PGI configuration I am trying to us##
%CCOMPILER mpicxx -noswitcherror
%FCOMPILER mpif90 -noswitcherror
%LINKER mpif90 -noswitcherror

%BASE_CFLAGS --c++11 -D__NONE__
%PROD_CFLAGS -O3 -DBOOST_DISABLE_ASSERTS
%DEV_CFLAGS -g -traceback
%DEBUG_CFLAGS -DBZ_DEBUG -g -traceback -fno-inline

%BASE_FFLAGS -D__NONE__
%PROD_FFLAGS -O3
%DEV_FFLAGS -g -O2 -traceback
%DEBUG_FFLAGS -g -traceback

%BASE_INC -D__NONE__
%BASE_LD -c++libs

%CPP cpp
%FPP cpp -P
%MAKE make

Hi y.juntao,

While I’m not familiar with XIOS, I did find the source from this page: documentation – XIOS

I copied the “arch-GCC-LINUX” files to a “PGI” version, then updated the fcm file to include the flags you have above and configured it to use Boost 1.68. I’m using nvc++ 20.5 and have it configured to use the GNU 9.2 STL. For good or bad, the code compiles fine for me.

What pgc++ version are you using? What GNU STL version do you have it configured to use (by default it will use the system GNU)? What version of Boost are you using?

I can try again to reproduce the error once you give more details, but I suspect that you’re configured using an older GNU (like 4.8.5) which did not fully support C++11. You might try again on a system with a newer GNU, such as 4.9.3 or later. Though you may need a newer Boost version as well.

-Mat