[Insight-developers] Re: cmake error building ITK for slicer
Luis Ibanez
luis.ibanez at kitware.com
Sat Dec 3 15:47:02 EST 2005
Hi Hans,
Steve Pieper is reporting the following problem
with the recent modifications that you added to
the main CMakeLists.txt file in ITK in order to
deal with the GCC options
-frename-registers
-ffloat-store
It seems that the IF has a CMake syntax error...
Although it doesn't look wrong to me...
Since this is only relevant for GCC, I'm encapsulating
the test inside IF/ENDIF for the GCC compiler.
This has been entered in the phpBugTracker as BUG# 2552
http://public.kitware.com/Bug/bug.php?op=show&bugid=2552&pos=0
Please let me know if you see a better option.
Thanks
Luis
Steve: What version of CMake were you using ?
---------------------
Steve Pieper wrote:
> Hi Andy, Luis -
>
> I've attached a diff for a patch that we've been needing to apply to ITK
> to support windows builds. There seems to be a cmake syntax error that
> gets triggered by having a windows build option specified.
>
> I'm not sure if it's a problem for anyone else, but if it turns out it's
> something slicer specific, is there a way we can work around it? If
> not, maybe we can just put the patch into a slicer branch of ITK (as a
> last resort).
>
> Thanks,
> Steve
>
> The error message:
>
> running:
> C:/pieper/bwh/slicer2/latest/slicer2/Lib/win32/CMake-build/bin/cmake.exe
> {-GVisual Studio 7 .NET 2003} {-DCMAKE_CXX_COMPILER:STRING=c:/Program
> Files/Microsoft Visual Studio .NET 2003/Common7/Vc7/bin/cl}
> {-DCMAKE_CXX_COMPILER_FULLPATH:FILEPATH=c:/Program Files/Microsoft
> Visual Studio .NET 2003/Common7/Vc7/bin/cl} -DBUILD_SHARED_LIBS:BOOL=ON
> -DBUILD_EXAMPLES:BOOL=OFF -DBUILD_TESTING:BOOL=OFF
> -DCMAKE_BUILD_TYPE:STRING=Debug ../Insight
> -- Check for working C compiler: cl -- works
> -- Check for working CXX compiler: c:/Program Files/Microsoft Visual
> Studio .NET 2003/Common7/Vc7/bin/cl -- works
> -- Configuring done
>
> CMake Error: Error in cmake code at
> :0:
> IF An IF command had incorrect arguments: "/W3" STREQUAL
> "-frename-registers"
> -frename-registers causes runtime bugs. It must be removed from your
> compilation options.
> running: {c:/Program Files/Microsoft Visual Studio .NET
> 2003/Common7/IDE/devenv} ITK.SLN /build Debug
>
> Microsoft (R) Development Environment Version 7.10.3077.
> Copyright (C) Microsoft Corp 1984-2001. All rights reserved.
>
> The following files specified on the command line:
>
> ITK.SLN
>
> could not be found and will not be loaded.
> child process exited abnormally
>
>
>
>
>
> ======= the patch I've been using to get around it:
>
> # [ /cygdrive/c/pieper/bwh/slicer2/latest/slicer2/Lib/win32/Insight]$
> cvs diff CMakeLists.txt
> Index: CMakeLists.txt
> ===================================================================
> RCS file: /cvsroot/Insight/Insight/CMakeLists.txt,v
> retrieving revision 1.209
> diff -r1.209 CMakeLists.txt
> 531,536c531,536
> < IF("${COMP_OPTION}" STREQUAL "-frename-registers")
> < MESSAGE(FATAL_ERROR "-frename-registers causes runtime bugs. It
> must be removed from your compilation options.")
> < ENDIF("${COMP_OPTION}" STREQUAL "-frename-registers")
> < IF("${COMP_OPTION}" STREQUAL "-ffloat-store")
> < MESSAGE(FATAL_ERROR "-ffloat-store causes runtime bugs on gcc
> 3.2.3 (appearently not on gcc 3.4.3, but the exact criteria is not
> known). It must be removed from your compilation options.")
> < ENDIF("${COMP_OPTION}" STREQUAL "-ffloat-store")
> ---
> > #IF("${COMP_OPTION}" STREQUAL "-frename-registers")
> > #MESSAGE(FATAL_ERROR "-frename-registers causes runtime bugs.
> It must be removed from your compilation options.")
> > #ENDIF("${COMP_OPTION}" STREQUAL "-frename-registers")
> > #IF("${COMP_OPTION}" STREQUAL "-ffloat-store")
> > #MESSAGE(FATAL_ERROR "-ffloat-store causes runtime bugs on gcc
> 3.2.3 (appearently not on gcc 3.4.3, but the exact criteria is not
> known). It must be removed from your compilation options.")
> > #ENDIF("${COMP_OPTION}" STREQUAL "-ffloat-store")
>
>
More information about the Insight-developers
mailing list