MantisBT - ITK
View Issue Details
0011336ITKpublic2010-10-19 09:292010-11-04 08:52
John Stark. 
Brad King 
normalminoralways
closedfixed 
ITK-3-20 
 
backlog
0011336: itkCheckCXXAcceptsFlags only works in English
itkCheckCXXAcceptsFlags.cmake uses predefined english strings to check if given compiler options are valid.

For other languages this causes the script to erroneously report an option as valid, causing compiler warnings. This may only affect windows users who use localized versions of visual studio?




Output during configure using visual studio French:
Checking to see if CXX compiler accepts flag -features=no%anachronisms
Checking to see if CXX compiler accepts flag -features=no%anachronisms - Yes
Checking to see if CXX compiler accepts flag -library=stlport4
Checking to see if CXX compiler accepts flag -library=stlport4 - Yes
Checking to see if this platform supports large bit-fields (>32 bits)
Checking to see if this platform supports large bit-fields (>32 bits) - yes

Error from cl.exe :
cl : Ligne de commande warning D9002 : option '-library=stlport4' inconnue ignorée

Perhaps the script should check for "warning D9002" ?

This was the root cause of Joaquin Panduro Civico's build warning messages described here:
http://www.itk.org/pipermail/insight-users/2009-August/031951.html [^]
No tags attached.
related to 0006267closed Bill Lorensen ITK should not force -no-cpp-precomp compiler flag on Mac OS X 
Issue History
2010-10-19 09:29John Stark.New Issue
2010-10-19 09:29John Stark.Sprint Status => backlog
2010-10-19 10:10John Stark.Note Added: 0022537
2010-11-02 11:58Hans JohnsonStatusnew => assigned
2010-11-02 11:58Hans JohnsonAssigned To => Brad King
2010-11-03 09:46Brad KingRelationship addedrelated to 0006267
2010-11-03 09:48Brad KingNote Added: 0022815
2010-11-03 10:44John Stark.Note Added: 0022818
2010-11-03 10:45John Stark.Note Edited: 0022818
2010-11-03 10:51John Stark.Note Added: 0022819
2010-11-03 12:09Brad KingNote Added: 0022820
2010-11-03 12:16Brad KingNote Added: 0022821
2010-11-04 05:14John Stark.Note Added: 0022828
2010-11-04 08:21Brad KingNote Added: 0022829
2010-11-04 08:52Brad KingNote Added: 0022831
2010-11-04 08:52Brad KingStatusassigned => closed
2010-11-04 08:52Brad KingResolutionopen => fixed

Notes
(0022537)
John Stark.   
2010-10-19 10:10   
Same for the VTK version : vtkCheckCXXAcceptsFlags.cmake
(0022815)
Brad King   
2010-11-03 09:48   
On POSIX systems one can set "LANG=C" or "LCALL=C" in the environment to get simple english messages. Is there an equivalent for MSVC on Windows?
(0022818)
John Stark.   
2010-11-03 10:44   
(edited on: 2010-11-03 10:45)
I don't think that an environment setting to switch language like that exists for MSVC on windows. The different languages use completely different installers. As far as I know it's not even possible to switch language without re-installing visual studio. I couldn't see any options for the c++ compiler (cl.exe) to switch to english either.

If you test for the string "warning D9002 :" you'll catch 3 languages at least (English, French, Spanish) that I know of, with relatively little risk.

(0022819)
John Stark.   
2010-11-03 10:51   
I've just read that you can get free language packs for VS 2010 that allow you to manually switch language. I still don't know if it can be done at the command line.
(0022820)
Brad King   
2010-11-03 12:09   
I'm not surprised, but thanks for checking. We don't want to depend on a language pack being installed anyway.

The "warning D9002" approach sounds good.
(0022821)
Brad King   
2010-11-03 12:16   
Please try the proposed patch here:

  http://review.source.kitware.com/295 [^]
(0022828)
John Stark.   
2010-11-04 05:14   
That patch works correctly. I get :
 Checking to see if CXX compiler accepts flag -features=no%anachronisms
 Checking to see if CXX compiler accepts flag -features=no%anachronisms - No

Can you patch VTK too please? Or do I need another bug report?
(0022829)
Brad King   
2010-11-04 08:21   
Thanks for testing. I'll put it in VTK too.
(0022831)
Brad King   
2010-11-04 08:52   
Fixed for ITK and VTK:

http://itk.org/gitweb?p=ITK.git;a=commitdiff;h=06f4d548 [^]
http://vtk.org/gitweb?p=VTK.git;a=commitdiff;h=c0fcaa4e [^]

and CMake:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=79e02333 [^]