Project

General

Profile

Bug #2103

xlc/xlC: shellfc.cpp: empty array initializer "expression not supported"

Added by James Ostrander almost 3 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Affected version - extra info:
Affected version:
Difficulty:
simple
Close

Description

I can get most of the way through the build process with xlc/xlC by disabling SIMD, but eventually:

[ 91%] Building CXX object src/gromacs/CMakeFiles/libgromacs.dir/mdlib/shellfc.cpp.o
/home/u0017592/projects/gromacs/src/gromacs/mdlib/shellfc.cpp:327:46: error: 1540-2991 The expression is not supported.
    shfc->x        = new PaddedRVecVector[2] {};
                                             ^
1 error generated.
Error while processing /home/u0017592/projects/gromacs/src/gromacs/mdlib/shellfc.cpp.
make[2]: *** [src/gromacs/CMakeFiles/libgromacs.dir/mdlib/shellfc.cpp.o] Error 1
make[1]: *** [src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2
make: *** [all] Error 2

Setting -DCMAKE_CXX_FLAGS="-qlanglvl=extended0x" doesn't make this go away. Neither does -std=c++1y, gnu++0x, gnu++11, etc.
If I compile a simple test with the empty initializer ({}) in latest gcc, it works.
Older versions of gcc need to have C++14 specified.


Related issues

Related to GROMACS - Task #2102: decide future of xlc+power supportClosed

History

#1 Updated by James Ostrander almost 3 years ago

The formatting was butchered, but the error's arrow should be pointing at the {}.

#2 Updated by Mark Abraham almost 3 years ago

  • Related to Task #2102: decide future of xlc+power support added

#3 Updated by Mark Abraham almost 3 years ago

  • Description updated (diff)

#4 Updated by Mark Abraham almost 3 years ago

That sounds like a limitation of (at least this version of) xlc, given that that code compiles fine on suitably recent versions of gcc, clang, msvc and icc in our continuous-integration testing.

However, probably that idiom will not be used in the source code for long, since there are doubts about some versions of clang + gcc stdlib with similar code.

Since xlc being useful is anyway blocked by the fixes needed for #2102, for now I can only recommend using gcc 4.9+ on POWER*

#5 Updated by Erik Lindahl about 2 years ago

  • Status changed from New to Rejected

This is indeed a bug, but unfortunately it's in the xlC compiler rather than Gromacs. We can consider adding a test for it in CMake to identify bad compilers.

Every time we have tested g++ has produced faster code than xlC, so there's no real reason to use it.

#6 Updated by Erik Lindahl about 2 years ago

  • Status changed from Rejected to Closed

Also available in: Atom PDF