[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AX_CXX_COMPILE_STDCXX false positive with cray compiler

From: Andy May
Subject: AX_CXX_COMPILE_STDCXX false positive with cray compiler
Date: Fri, 1 Jun 2018 09:59:19 +0100


We have in


and when running configure on a Cray XC50 system with cray compiler we get in config.log:

configure:3678: checking whether /opt/cray/pe/craype/2.5.14/bin/CC supports C++11 features with +std=c++11
configure:3974: /opt/cray/pe/craype/2.5.14/bin/CC +std=c++11 -c -O3  conftest.cpp >&5
configure:3974: $? = 0
configure:3983: result: yes

i.e. it detects +std=c++11 as the required flag which is not the case, it's in fact the next in the list involving -h:

      for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do

It appears that +s* options just get ignored and are assumed to be for the linker, and in fact the compiler can pass the test then effectively with no extra flags (it fails with -std=c++11 because -s* is not recognised). Of course later when one tries to link with the modified CXX='CC +std=c++11' there is trouble because the linker does not understand this.

I'm not sure how you handle the case of a flag which is silently accepted by a compiler, and then causes trouble to the linker.

Is there a reason the macro does not first test with no extra flags? In this case no flags are needed for C++11 support and it wouldn't then try these flags. It would also provide a route for the user to specify flags unknown to the macro via CXX='CC -new-flag' on the command line.

Many thanks,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]