CMake results different under Windows 7

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Rich in Soquel
Posts: 15
Joined: Mon, 2009-08-17, 21:40
Location: California

CMake results different under Windows 7

#1 Post by Rich in Soquel »

I have two development systems, side-by-side. One is running XP, the other Windows 7.

Both have Microsoft Visual Studio 2010, and Microsoft SDK 7.1 installed. Both have CMake cmake-2.8.10.2-win32-x86 installed. Both have your DCMTK 3.6.0 source. The Win XP is 32-bit, the Win 7 is 64-bit.

When I run CMake on the Windows XP system, I can build the ALL_BUILD target successfully.

When I do what I think is the identical series of steps on the Win 7 system, I get hundreds of errors trying to build the ALL_BUILD target. I get a radically different looking osconfig.h that has on the order of 50 lines that differ from that on the Win XP system. Although the CMake steps say the test compiles worked, the osconfig.h looks like CMake didn't find many of the include files that are in the standard locations.

For example, on the Win 7 system one section of osconfig.h looks like this:

/* Define to 1 if you have the <sstream> header file. */
/* #undef HAVE_SSTREAM */

/* Define to 1 if you have the <sstream.h> header file. */
/* #undef HAVE_SSTREAM_H */

/* Define to 1 if you have the `stat' function. */
/* #undef HAVE_STAT */

/* define if the compiler supports static_cast<> */
#define HAVE_STATIC_CAST 1

On the Win XP system, these lines look like this:

/* Define to 1 if you have the <sstream> header file. */
#define HAVE_SSTREAM 1

/* Define to 1 if you have the <sstream.h> header file. */
/* #undef HAVE_SSTREAM_H */

/* Define to 1 if you have the `stat' function. */
#define HAVE_STAT 1

/* define if the compiler supports static_cast<> */
#define HAVE_STATIC_CAST 1

I have two questions:
1 Do you have any suggestions of what could be causing the difference (and how to eliminate the problem)?
2 Would it be "safe" to copy the Win XP ofconfig.h file and try to massage it to work on the Win 7 system?

Thanks for any help you can give.

Uli Schlachter
DCMTK Developer
Posts: 120
Joined: Thu, 2009-11-26, 08:15

Re: CMake results different under Windows 7

#2 Post by Uli Schlachter »

Hi Rich,
Rich in Soquel wrote: 1 Do you have any suggestions of what could be causing the difference (and how to eliminate the problem)?
In your CMake build directory, there are two files which can answer these questions: CMakeFiles/CMakeError.log and CMakeFiles/CMakeOutput.log.

The first file contains the compiler output for all failed tests, the second one for working ones. So I would suggest that you open CMakeError.log with your favorite text editor and search for e.g. static_cast. The error message you find might tell us more.
Rich in Soquel wrote: 2 Would it be "safe" to copy the Win XP ofconfig.h file and try to massage it to work on the Win 7 system?
It would be "safe" in the sense that the resulting binaries should work fine *if* they compile fine. However, I doubt a lot that the code will compile fine. After all, the compiler errors don't just happen because of cosmic rays, but for an actual reason. It is possible that this reason only affects the CMake tests and not the rest of the toolkit, but I doubt this a lot.

Uli

Rich in Soquel
Posts: 15
Joined: Mon, 2009-08-17, 21:40
Location: California

Re: CMake results different under Windows 7

#3 Post by Rich in Soquel »

Thanks for your guidance.

The two log files on the Win 7 system have identical time stamps.

The CMakeOutput log starts like this:


Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler:
Build flags:
Id flags:

The output was:
0


Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CompilerIdC.vcxproj"

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded.
Compiler:
Build flags:
Id flags:

The output was:
0


whereas the CMakeError log starts like this:

The C compiler identification could not be found in "C:/source/3rd Party/dcmtk/BUILD/CMakeFiles/2.8.10.2/CompilerIdC/CompilerIdC.vcxproj"

The CXX compiler identification could not be found in "C:/source/3rd Party/dcmtk/BUILD/CMakeFiles/2.8.10.2/CompilerIdCXX/CompilerIdCXX.vcxproj"

Determining if the include file sys/types.h exists failed with the following output:


Determining if the include file stdint.h exists failed with the following output:


Determining if the include file stddef.h exists failed with the following output:

I don't find any occurrence of "static_cast" in either log file.

Clearly when things fail, CMake is not finding any of the Microsoft include files, for example, I see many lines like these:


Determining if the include file windows.h exists failed with the following output:


Determining if the include file winsock.h exists failed with the following output:


Determining if the include file errno.h exists failed with the following output:


Determining if the include file dirent.h exists failed with the following output:

Does this behavior suggest anything to you?

Chung-Yueh Lien
Posts: 61
Joined: Wed, 2010-05-19, 09:27
Location: Taipei, Taiwan

Re: CMake results different under Windows 7

#4 Post by Chung-Yueh Lien »

Rich in Soquel wrote: I have two questions:
1 Do you have any suggestions of what could be causing the difference (and how to eliminate the problem)?
Please check the pathway of osconfig.h included in your VS project for winxp whether is the same with project for win 7.

Rich in Soquel
Posts: 15
Joined: Mon, 2009-08-17, 21:40
Location: California

Re: CMake results different under Windows 7

#5 Post by Rich in Soquel »

On both systems, the project is finding osconfig.h in c:\source\3rd Party\dcmtk\BUILD\include\dcmtk\config\osconfig.h

Uli Schlachter
DCMTK Developer
Posts: 120
Joined: Thu, 2009-11-26, 08:15

Re: CMake results different under Windows 7

#6 Post by Uli Schlachter »

Rich in Soquel wrote:Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler:
Build flags:
Id flags:

The output was:
0
Doesn't this basically say "compiler not found"? Can you build other software with CMake?

I don't think I know enough about CMake internals to know why this fails. Someone from CMake might know more reasons for such a failure (sadly, Google doesn't help).

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest