Project

General

Profile

Actions

Bug #459

closed

Wrong "Host type" on Windows 7 (64 bit) system with 64 bit binaries

Added by Jörg Riesmeier almost 13 years ago. Updated almost 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Uli Schlachter
Category:
Configuration
Target version:
Start date:
2012-11-01
Due date:
% Done:

100%

Estimated time:
Module:
Operating System:
Compiler:

Description

The --version output of a command line tool is "Host type: x86-Windows", i.e. there is no indication on 64 bit support.

Actions #1

Updated by Jörg Riesmeier almost 13 years ago

  • Assignee set to Uli Schlachter
Actions #2

Updated by Uli Schlachter almost 13 years ago

  • Priority changed from Normal to Low

ofconapp.cc: (*output) << OFendl << "Host type: " << CANONICAL_HOST_TYPE << OFendl;

So we are looking at CANONICAL_HOST_TYPE which comes from the configure machinery. CMake sets it via:

SET(CANONICAL_HOST_TYPE "${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_SYSTEM_NAME}")

CMAKE_SYSTEM_PROCESSOR is documented as:

The name of the CPU CMake is building for.
On systems that support uname, this variable is set to the output of
uname -p, on windows it is set to the value of the environment
variable PROCESSOR_ARCHITECTURE

So I guess the 64 bit binaries were built on a 32 bit system?

Looking through the list of variables CMake defines, I don't really see anything which sounds more appropriate. And apparently CMake can't tell you if you are building 64 bit binaries or not (well, the CMake mailing list suggests looking at the size of a void pointer...).

Actions #3

Updated by Jörg Riesmeier almost 13 years ago

No, the DCMTK binary was really build on a 64-bit Windows system with Visual Studio 2010 Professional (64-bit). The selected CMake generator was (something like): Visual Studio 2010 (Win64)

Actions #4

Updated by Jörg Riesmeier almost 13 years ago

  • Priority changed from Low to Normal
Actions #5

Updated by Uli Schlachter almost 13 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

CMake says: "Works as documented" http://public.kitware.com/Bug/print_bug_page.php?bug_id=9065

MSDN says: http://msdn.microsoft.com/en-us/library/aa384274(VS.85).aspx

commit aeb0390fb70f5390b7e253e67da6c261f3228183
Author: Uli Schlachter <dicom@offis.de>
Date:   Tue Nov 6 10:18:28 2012 +0100

    Correctly detect the processor type on 64 bit windows.
[...]
+# Windows being windows, it lies about its processor type to 32 bit binaries
+SET(SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITEW6432}")
+IF(NOT SYSTEM_PROCESSOR)
+  SET(SYSTEM_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}")
+ENDIF(NOT SYSTEM_PROCESSOR)
 # CMake doesn't provide a configure-style system type string
-SET(CANONICAL_HOST_TYPE "${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_SYSTEM_NAME}")
+SET(CANONICAL_HOST_TYPE "${SYSTEM_PROCESSOR}-${CMAKE_SYSTEM_NAME}")
+UNSET(SYSTEM_PROCESSOR)
Actions

Also available in: Atom PDF