All,
I recently updated a set of libraries I build for GEOS, a climate model, and I’m hitting all sorts of issues with PGI and a few of them (NCO, CDO, SDPToolkit). I’m going to start with CDO since it dies at configure, not in the build, and seems to be C++ related (as NCO is).
The issue I’m seeing is that it says it is not a C++11 compiler:
..snip..
checking for mpic++ option to produce PIC... -fPIC -DPIC
checking if mpic++ PIC flag -fPIC -DPIC works... yes
checking if mpic++ static flag -static works... no
checking if mpic++ supports -c -o file.o... yes
checking if mpic++ supports -c -o file.o... (cached) yes
checking whether the mpic++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for C/C++ restrict keyword... __restrict
checking whether mpic++ supports C++11 features by default... no
checking whether mpic++ supports C++11 features with -std=gnu++11... no
checking whether mpic++ supports C++11 features with -std=gnu++0x... no
checking whether mpic++ supports C++11 features with -std=c++11... no
checking whether mpic++ supports C++11 features with +std=c++11... no
checking whether mpic++ supports C++11 features with -h std=c++11... no
checking whether mpic++ supports C++11 features with -std=c++0x... no
checking whether mpic++ supports C++11 features with +std=c++0x... no
checking whether mpic++ supports C++11 features with -h std=c++0x... no
configure: error: *** A compiler with support for C++11 language features is required.
make[1]: *** [cdo.config] Error 1
As far as I know, -std=c++11 is a good flag for pgc++, so hmm. Digging through config.log, it seems to be tripping at:
// If the compiler admits that it is not ready for C++11, why torture it?
// Hopefully, this will speed up the test.
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus < 201103L
#error "This is not a C++11 compiler"
#else
...
when I run:
(79)((HEAD detached at d5a54b9)) $ mpic++ -std=c++11 ~/conftest.cpp
"/home/mathomp4/conftest.cpp", line 36: catastrophic error: #error directive:
"This is not a C++11 compiler"
#error "This is not a C++11 compiler"
^
1 catastrophic error detected in the compilation of "/home/mathomp4/conftest.cpp".
Compilation terminated.
Now, for your edification:
(105)((no branch)) $ mpic++ --version
pgc++ 17.5-0 64-bit target on x86-64 Linux -tp nehalem
PGI Compilers and Tools
Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
(106)((no branch)) $ g++ --version
g++ (GCC) 6.3.0
Copyright (C) 2016 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.
My first thought was perhaps GCC 6.3.0 is too new for PGI 17.5, but even if I downgrade to GCC 6.1.0 or 5.3.0, I get the same error. (I even tried 7.1.0 in a fit of pique.) Any ideas?
I have asked for PGI 17.7 to be installed on this box, so I’ll test that soon.
Matt