users > compiler error on Windows XP with VS2008
Showing 1-11 of 11 posts
Apr 4, 2011 06:04 PM | Dominique Belhachemi
compiler error on Windows XP with VS2008
Hi,
CMTK doesn't compile on my Windows computer.
1>6>..\..\..\CMTK\libs\Registration\cmtkGroupwiseRegistrationFunctionalBase.cxx(477) : error C3016: 'param' : index variable in OpenMP 'for' statement must have signed integral type
1>6>cmtkGroupwiseRegistrationFunctionalAffineInitializer.cxx
1>10>c:\Program Files\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>10>dctypes.cc
Please find the full logs attached.
Thanks
Dominique
CMTK doesn't compile on my Windows computer.
1>6>..\..\..\CMTK\libs\Registration\cmtkGroupwiseRegistrationFunctionalBase.cxx(477) : error C3016: 'param' : index variable in OpenMP 'for' statement must have signed integral type
1>6>cmtkGroupwiseRegistrationFunctionalAffineInitializer.cxx
1>10>c:\Program Files\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>10>dctypes.cc
Please find the full logs attached.
Thanks
Dominique
Apr 4, 2011 06:04 PM | Torsten Rohlfing
RE: compiler error on Windows XP with VS2008
Dominique:
It seems that the problem is that VS 2008 requires OpenMP loop variables to be signed integers, not unsigned integers. The older OpenMP Standard required this, but it was never enforced by other implementations, such as gcc's. The newer OpenMP 3 Standard allows unsigned integers, and I think that's what VS 2010 supports.
So the possible solutions here are:
1. Build without OpenMP support (you lose some SMP speedup, but not much, because most SMP code uses low-level threads anyway).
2. Build with VisualStudio 2010 is you have it available.
3. Change all loop variables to signed integers. I am a bit hesitant to do this, though, because it's an awful lot of loops, and changing the loop variable type will lead to further compiler warnings, because then loop index and loop bound will often have mismatched types.
Do you think you can live with either option 1. or 2.? I guess in the long run Option 2 will happen by itself anyway?
TR
It seems that the problem is that VS 2008 requires OpenMP loop variables to be signed integers, not unsigned integers. The older OpenMP Standard required this, but it was never enforced by other implementations, such as gcc's. The newer OpenMP 3 Standard allows unsigned integers, and I think that's what VS 2010 supports.
So the possible solutions here are:
1. Build without OpenMP support (you lose some SMP speedup, but not much, because most SMP code uses low-level threads anyway).
2. Build with VisualStudio 2010 is you have it available.
3. Change all loop variables to signed integers. I am a bit hesitant to do this, though, because it's an awful lot of loops, and changing the loop variable type will lead to further compiler warnings, because then loop index and loop bound will often have mismatched types.
Do you think you can live with either option 1. or 2.? I guess in the long run Option 2 will happen by itself anyway?
TR
Apr 4, 2011 06:04 PM | Dominique Belhachemi
RE: compiler error on Windows XP with VS2008
Hi Torsten,
I tried to compile it without OpenMP.
Is this the right option ?
-DCMTK_USE_OPENMP:BOOL=OFF
I am getting the same compiler error.
Dominique
I tried to compile it without OpenMP.
Is this the right option ?
-DCMTK_USE_OPENMP:BOOL=OFF
I am getting the same compiler error.
Dominique
Apr 4, 2011 07:04 PM | Torsten Rohlfing
RE: compiler error on Windows XP with VS2008
The CMake option looks about right, but I think it works like this
only in an empty build tree. Is that what you're doing? If you are
re-using an existing tree, you probably have to use the cmake GUI
to change the project setting for this variable.
If none of these apply, can you send me your CMakeCache.txt file?
Thanks!
If none of these apply, can you send me your CMakeCache.txt file?
Thanks!
Apr 4, 2011 11:04 PM | Dominique Belhachemi
RE: compiler error on Windows XP with VS2008
I tried it again with some tiny changes in my
build script and it is working.
-DCMTK_USE_OPENMP:BOOL=OFF and a clean build did the trick.
Thanks
Dominique
-DCMTK_USE_OPENMP:BOOL=OFF and a clean build did the trick.
Thanks
Dominique
Apr 4, 2011 11:04 PM | Torsten Rohlfing
RE: compiler error on Windows XP with VS2008
Great.
Sorry you have to live without OMP for now. You shouldn't experience too much of a slowdown anyway, though.
TR
Sorry you have to live without OMP for now. You shouldn't experience too much of a slowdown anyway, though.
TR
Apr 6, 2011 05:04 PM | Jonathan Chappelow
RE: compiler error on Windows XP with VS2008
Hi Torsten,
Unfortunately, VS2010 does not seem to support OpenMP 3 either. It looks like it might be quite some time until it is added, since it did not make it into the recently released VS2010 SP1: http://connect.microsoft.com/VisualStudi...
-Jon
Unfortunately, VS2010 does not seem to support OpenMP 3 either. It looks like it might be quite some time until it is added, since it did not make it into the recently released VS2010 SP1: http://connect.microsoft.com/VisualStudi...
-Jon
Apr 6, 2011 06:04 PM | Torsten Rohlfing
RE: compiler error on Windows XP with VS2008
Well isn't that nice...
Thanks for the hint Jonathan.
I guess I'll look into falling back to signed loop variables after all. Bummer.
I'll track progress on this in the following tracker item:
http://www.nitrc.org/tracker/index.php?f...
Thanks for the hint Jonathan.
I guess I'll look into falling back to signed loop variables after all. Bummer.
I'll track progress on this in the following tracker item:
http://www.nitrc.org/tracker/index.php?f...
Apr 6, 2011 08:04 PM | Torsten Rohlfing
RE: compiler error on Windows XP with VS2008
Dominique:
Okay, I have to run right now, but there's a good chance OpenMP works with VisualStudio as of CMTK svn/trunk r3097.
Give it a shot if you like. Any remaining errors, please send me the compile log file.
Thanks!
TR
Okay, I have to run right now, but there's a good chance OpenMP works with VisualStudio as of CMTK svn/trunk r3097.
Give it a shot if you like. Any remaining errors, please send me the compile log file.
Thanks!
TR
Apr 11, 2011 09:04 PM | Jonathan Chappelow
RE: compiler error on Windows XP with VS2008
Hi Torsten,
With your changes to the loop variable, CMTK compiles without error now in VS2010 SP. Output of warp for a test set is identical to before with OpenMP OFF.
Thanks for the quick fix!
-Jon
With your changes to the loop variable, CMTK compiles without error now in VS2010 SP. Output of warp for a test set is identical to before with OpenMP OFF.
Thanks for the quick fix!
-Jon
Apr 12, 2011 05:04 AM | Torsten Rohlfing
RE: compiler error on Windows XP with VS2008
Thanks for the feedback Jon -
Now if I could only figure out why the VC++ build takes 3x more time to run the same computations than the Linux build on the same machine... any ideas?
Cheers,
Torsten
Now if I could only figure out why the VC++ build takes 3x more time to run the same computations than the Linux build on the same machine... any ideas?
Cheers,
Torsten