[cmake-developers] [CMake 0012992]: CHECK_C_COMPILER_FLAG broken for icc

Mantis Bug Tracker mantis at public.kitware.com
Tue Feb 21 14:56:25 EST 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=12992 
====================================================================== 
Reported By:                Christopher Sean Morrison
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12992
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-02-21 14:56 EST
Last Modified:              2012-02-21 14:56 EST
====================================================================== 
Summary:                    CHECK_C_COMPILER_FLAG broken for icc
Description: 
It looks like the CHECK_C_COMPILER_FLAG is outright broken for the Intel
compiler (icc).

Similar to llvm's C compiler, icc *recognizes* many command-line flags supported
by gcc, but it does nothing with them.  The compiler outputs a warning during
compilation (haven't found a way to turn it into an error) and the compilation
proceeds.  See the Additional Information for an example using the famliar
"-pedantic" gcc flag.

While for most flags, the failed test merely results in flags getting add added
that do nothing, from a build system perspective it results in tests passing
that should not have.  This results in incorrect build system behavior and
*excessively* noisy build output for all the various unsupported flags being
warned about repeatedly.

One of our compilation modes, for example, puts the compiler into strict
standards conformance mode so we can perform source code regression and
portability testing.  Being able to select the right compilation flags is
necessary for that mode to work correctly.  With other flags (e.g., -kPIC,
-fPIC, etc), you get outright wrong behavior that makes the linker cry when
linking against libraries compiled wrong.


Additional Information: 
STATUS: Performing Test PEDANTIC_COMPILER_FLAG_FOUND
STATUS: Performing Test PEDANTIC_COMPILER_FLAG_FOUND - Success
Performing C SOURCE FILE Test PEDANTIC_COMPILER_FLAG_FOUND succeded with the
following output:
Change Dir: /home/morrison/brlcad/.cmake/CMakeFiles/CMakeTmp

Run Build Command:/usr/bin/gmake "cmTryCompileExec/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make
CMakeFiles/cmTryCompileExec.dir/build
gmake[1]: Entering directory `/home/morrison/brlcad/.cmake/CMakeFiles/CMakeTmp'
/home/morrison/Applications/bin/cmake -E cmake_progress_report
/home/morrison/brlcad/.cmake/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec.dir/src.c.o
/opt/intel/bin/icc   -DPEDANTIC_COMPILER_FLAG_FOUND -I/usr/local/include   
-pedantic -o CMakeFiles/cmTryCompileExec.dir/src.c.o   -c
/home/morrison/brlcad/.cmake/CMakeFiles/CMakeTmp/src.c
icc: command line remark http://public.kitware.com/Bug/view.php?id=10148: option
'-pedantic' not supported
Linking C executable cmTryCompileExec
/home/morrison/Applications/bin/cmake -E cmake_link_script
CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1
/opt/intel/bin/icc     -DPEDANTIC_COMPILER_FLAG_FOUND   
CMakeFiles/cmTryCompileExec.dir/src.c.o  -o cmTryCompileExec -rdynamic 
gmake[1]: Leaving directory `/home/morrison/brlcad/.cmake/CMakeFiles/CMakeTmp'

Source file was:
int main(void) { return 0; }

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-02-21 14:56 Christopher Sean MorrisonNew Issue                             
      
======================================================================




More information about the cmake-developers mailing list