[Insight-developers] ITK with free VC++ compiler

Julien Jomier jjomier at cs.unc.edu
Fri Aug 13 18:39:46 EDT 2004


Hi Bill,

Just a quick follow-up on that:
I replaced the CMAKE_CXX_FLAGS and CMAKE_C_FLAGS by /MT instead of /MD in
'Modules/Platform/Windows-cl.cmake' and it works without specifying any
cache.

An InsightApplications dashboard with FLTK and VTK turned ON is coming
soon...

Julien

> -----Original Message-----
> From: insight-developers-bounces at itk.org 
> [mailto:insight-developers-bounces at itk.org] On Behalf Of 
> William A. Hoffman
> Sent: Tuesday, August 10, 2004 8:57 PM
> To: Julien Jomier; 'Insight Developers List'
> Subject: RE: [Insight-developers] ITK with free VC++ compiler
> 
> 
> Looks like for now you will have to create a CMakeCache.txt 
> file with the
> correct settings for the CXX and C flags and put it in the 
> binary directory before
> running cmake.
> 
> -Bill
> 
> 
> At 11:31 AM 8/10/2004, Julien Jomier wrote:
> >Hi Bill,
> >
> >> CMakeSetup -C InitialCacheVCFreeTools.cmake
> >I tried CMakeSetup -CInitialCacheVCFreeTools.cmake but it seems that
> >CMakeSetup is not loading the initial cache.
> >I tried CMake -CInitialCacheVCFreeTools.cmake -G"NMake Makefiles"
> >../Insight, the cache is now correct but TRY_COMPILE still 
> fails asking for
> >the wrong lib (msvcprtd.lib). I'm using CMake 2.0.3.
> >
> >Let me know if I should try something else,
> >
> >Thanks for the help,
> >
> >Julien
> >
> >> -----Original Message-----
> >> From: insight-developers-bounces at itk.org 
> >> [mailto:insight-developers-bounces at itk.org] On Behalf Of 
> >> William A. Hoffman
> >> Sent: Tuesday, August 10, 2004 7:53 AM
> >> To: Julien Jomier; 'Insight Developers List'
> >> Subject: Re: [Insight-developers] ITK with free VC++ compiler
> >> 
> >> 
> >> For now, you will have to do something like this.
> >> Create a file that presets the flags to something different.  
> >> Create a file like this:
> >> (change all the flags to what they need to be,
> >> and save this in a file called InitialCacheVCFreeTools.cmake)
> >> 
> >>   SET (CMAKE_CXX_FLAGS "/W3 /Zm1000 /GX /GR" CACHE STRING
> >>      "Flags used by the compiler during all build types.")
> >>   SET (CMAKE_CXX_FLAGS_DEBUG "/MDd /Zi /Od /GZ" CACHE STRING
> >>      "Flags used by the compiler during debug builds.")
> >>   SET (CMAKE_CXX_FLAGS_MINSIZEREL "/MD /O1 /D NDEBUG" CACHE STRING
> >>       "Flags used by the compiler during release minsize builds.")
> >>   SET (CMAKE_CXX_FLAGS_RELEASE "/MD /O2 /D NDEBUG" CACHE STRING
> >>      "Flags used by the compiler during release builds (/MD 
> >> /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but 
> >> smaller files).")
> >>   SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /Zi /O2 /D NDEBUG" 
> >> CACHE STRING
> >>      "Flags used by the compiler during Release with Debug 
> >> Info builds.")
> >>   SET (CMAKE_C_FLAGS "/W3 /Zm1000")
> >>   SET (CMAKE_C_FLAGS_DEBUG "/MDd /Zi /Od /GZ" STRING
> >>       "Flags used by the compiler during debug builds.")
> >>   SET (CMAKE_C_FLAGS_MINSIZEREL "/MD /O1 /D NDEBUG" CACHE STRING
> >>       "Flags used by the compiler during release minsize builds.")
> >>   SET (CMAKE_C_FLAGS_RELEASE "/MD /O2 /D NDEBUG" CACHE STRING
> >>      "Flags used by the compiler during release builds (/MD 
> >> /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but 
> >> smaller files).")
> >>   SET (CMAKE_C_FLAGS_RELWITHDEBINFO "/MD /Zi /O2 /D NDEBUG" 
> >> CACHE STRING
> >>      "Flags used by the compiler during Release with Debug 
> >> Info builds.")
> >> 
> >> 
> >> CMakeSetup -C InitialCacheVCFreeTools.cmake
> >> 
> >> Let me know if this works for you.
> >> I will look into a patch for CMake to support this setup in a 
> >> cleaner way.
> >> 
> >> -Bill
> >> 
> >> At 05:06 PM 8/9/2004, Julien Jomier wrote:
> >> >Hello,
> >> >
> >> >I successfully compiled ITK with the free VC++ compiler. 
> >> However I had to
> >> >manually modify the CMakeCache.txt because all the 
> >> TRY_COMPILE are failing
> >> >the first time I run CMake.
> >> >
> >> >Here's the full story. The free vc compiler doesn't work with the
> >> >Multithreaded DLL run-time library because msvcprt.lib 
> (and the debug
> >> >version msvcprtd.lib) are not included with the free 
> >> compiler. On the other
> >> >hand, the multithreaded libraries (msvcrt.lib and 
> >> msvcrtd.lib) are included.
> >> >By default CMake sets the CMAKE_CXX_FLAGS (and 
> CMAKE_C_FLAGS) to /MD
> >> >(Multithreaded DLL) and therefore all TRY_COMPILE fail because the
> >> >msvcprt.lib is not found. Then when changing the CXX_FLAGS to /MT
> >> >(Mutithreaded), this doesn't cause CMake to redo the 
> >> TRY_COMPILE because the
> >> >values are cached.
> >> >
> >> >Is there any easy way to fix this?
> >> >
> >> >I'll setup a dashboard for this compiler.
> >> >
> >> >Thanks,
> >> >
> >> >Julien
> >> >
> >> >_______________________________________________
> >> >Insight-developers mailing list
> >> >Insight-developers at itk.org
> >> >http://www.itk.org/mailman/listinfo/insight-developers 
> >> 
> >> _______________________________________________
> >> Insight-developers mailing list
> >> Insight-developers at itk.org
> >> http://www.itk.org/mailman/listinfo/insight-developers
> >> 
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
> 



More information about the Insight-developers mailing list