Project

General

Profile

Bug #1461

CMake SIMD tests may add compiler flags that cause warnings

Added by Teemu Murtola over 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
build system
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

Currently, it can happen that although CMake configuration passes without any errors or warnings, it picks SIMD compiler flags that cause an excessive number of warnings during compilation. At least the Windows builds on Jenkins are affected: every file produces warnings like

cl : Command line warning D9002 : ignoring unknown option '-msse2'

I haven't checked whether this affects other builds than the Windows ones.

The test still correctly detects when the compiler can't compile the code, and moves on to test the next flag. But in these cases, it fails to detect whether the flag actually makes sense. This is probably because some compilers return a success even though they produced warnings; CheckCCompilerFlag has extra code to work around this, but our custom implementation doesn't have that.

This may not be critical, since the test should still work to find a flag that makes the compilation pass. But the warnings can be confusing for users, and it makes it painful to read the Jenkins console output. Currently, the Jenkins console output is required to diagnose quite a few different types of issues, and it is unnecessarily difficult to find the relevant text when it his hidden in a mass of these warnings.


Related issues

Related to GROMACS - Task #1483: Fix warnings ignored by Jenkins Closed

Associated revisions

Revision 964b797d (diff)
Added by Erik Lindahl almost 3 years ago

Detect non-fatal warnings when trying CFlags for source

We now first check the flag itself (and catch warnings),
after which we check if our SIMD source compiles with it.

Fixes #1461.

Change-Id: Ic6ae99f62c5657195a59dc83ab08399d3491249a

History

#1 Updated by Teemu Murtola about 3 years ago

  • Related to Task #1483: Fix warnings ignored by Jenkins added

#2 Updated by Erik Lindahl about 3 years ago

Our code uses CheckCCompilerFlag(), which in turn greps for warnings, so I'm not entirely sure how to fix this?

#3 Updated by Teemu Murtola about 3 years ago

No, the issue is that CheckCCompilerFlag is not used in gmxFindFlagsForSource.cmake, so those warnings are ignored for the result of the test.

#4 Updated by Gerrit Code Review Bot about 3 years ago

Gerrit received a related patchset '1' for Issue #1461.
Uploader: Erik Lindahl ()
Change-Id: Ic6ae99f62c5657195a59dc83ab08399d3491249a
Gerrit URL: https://gerrit.gromacs.org/3581

#5 Updated by Erik Lindahl about 3 years ago

  • Status changed from New to Fix uploaded

#6 Updated by Erik Lindahl almost 3 years ago

  • Status changed from Fix uploaded to Resolved

#7 Updated by Erik Lindahl almost 3 years ago

  • Status changed from Resolved to Closed

#8 Updated by Teemu Murtola almost 3 years ago

  • Target version set to 5.0

Also available in: Atom PDF