MantisBT - CMake
View Issue Details
0009913CMakeCMakepublic2009-11-17 18:392009-11-23 11:47
Sean McBride 
Brad King 
normalmajoralways
closedfixed 
10.6
CMake-2-8 
 
0009913: CMake 2.8 cannot build itself as mixed-size Universal Binary because "CHECK_TYPE_SIZE found different results"
- install CMake 2.8 on Mac OS X 10.6
- download CMake CVS code
- type:
  cmake -DCMAKE_OSX_ARCHITECTURES='x86_64;i386' ../CMake

Expected:
- success

Actual:
- it reports "-- Configuring incomplete, errors occurred!"

There are several errors, all of the same type. The first is:

CMake Error at /Applications/CMake 2.8-0.app/Contents/share/cmake-2.8/Modules/CheckTypeSize.cmake:102 (MESSAGE):
  CHECK_TYPE_SIZE found different results, consider setting
  CMAKE_OSX_ARCHITECTURES or CMAKE_TRY_COMPILE_OSX_ARCHITECTURES to one or no
  architecture !
Call Stack (most recent call first):
  Source/kwsys/CMakeLists.txt:481 (CHECK_TYPE_SIZE)
No tags attached.
Issue History
2009-11-17 18:39Sean McBrideNew Issue
2009-11-17 19:57Bill HoffmanStatusnew => assigned
2009-11-17 19:57Bill HoffmanAssigned To => Brad King
2009-11-17 19:59Bill HoffmanNote Added: 0018468
2009-11-18 14:08Brad KingNote Added: 0018475
2009-11-18 14:33Brad KingSummaryCMake 2.8 cannot build itself as Universal Binary because "CHECK_TYPE_SIZE found different results" => CMake 2.8 cannot build itself as mixed-size Universal Binary because "CHECK_TYPE_SIZE found different results"
2009-11-18 15:26Sean McBrideNote Added: 0018477
2009-11-18 15:33Brad KingNote Added: 0018479
2009-11-18 16:41Sean McBrideNote Added: 0018482
2009-11-20 08:39Brad KingNote Added: 0018492
2009-11-23 11:36Brad KingNote Added: 0018547
2009-11-23 11:47Brad KingNote Added: 0018548
2009-11-23 11:47Brad KingStatusassigned => closed
2009-11-23 11:47Brad KingResolutionopen => fixed

Notes
(0018468)
Bill Hoffman   
2009-11-17 19:59   
I don't see where these sizes are actually used in the CMake c++ but maybe I am missing something. I guess the header should be updated to include the ifdef __APPLE stuff to get the size of stuff done.
(0018475)
Brad King   
2009-11-18 14:08   
KWSys needs to be taught to get the size of long and some other types without a try-compile in order to support universal binaries.

For now, try adding "-DCMAKE_TRY_COMPILE_OSX_ARCHITECTURES=i386" to work around the problem.
(0018477)
Sean McBride   
2009-11-18 15:26   
Could KWSys be changed to use fixed sized types like int32_t and int64_t (when it needs something of a fixed size)? Why does it care how big 'long' is?
(0018479)
Brad King   
2009-11-18 15:33   
It's a component of KWSys called "FundamentalType" that provides type information about the native types, plus its own equivalent of int32_t and int64_t that does not depend on system headers.

CMake doesn't actually use the component (yet), but since CMake builds on more platforms than any other project that uses KWSys, we enabled all of KWSys for testing purposes. Perhaps this should only be done for dashboard builds, but then the dashboard builds would not be representative of user builds.
(0018482)
Sean McBride   
2009-11-18 16:41   
I looked at FundamentalType.h.in, but only partly understand it....

For sure CMake needs to support a wide variety of systems/compilers/etc. and therefore will need to test the size of native C types to create its own KWint32 (or whatever). But could it not do so only if the standard C99/C++0x types are not present?
(0018492)
Brad King   
2009-11-20 08:39   
The following commits fix KWSys FundamentalType. More changes are needed to fix the same problem in Utilities/cmlibarchive.

Enable loose loop constructs in KWSys
/cvsroot/CMake/CMake/Source/kwsys/CMakeLists.txt,v <-- Source/kwsys/CMakeLists.txt
new revision: 1.151; previous revision: 1.150

Check for 'long long' without computing size
/cvsroot/CMake/CMake/Source/kwsys/CMakeLists.txt,v <-- Source/kwsys/CMakeLists.txt
new revision: 1.152; previous revision: 1.151
/cvsroot/CMake/CMake/Source/kwsys/kwsysPlatformTestsCXX.cxx,v <-- Source/kwsys/kwsysPlatformTestsCXX.cxx
new revision: 1.7; previous revision: 1.6

Create KWSYS_PLATFORM_INFO_TEST macro
/cvsroot/CMake/CMake/Source/kwsys/kwsysPlatformTests.cmake,v <-- Source/kwsys/kwsysPlatformTests.cmake
new revision: 1.4; previous revision: 1.3

Fix KWSys FundamentalType for Universal Binaries
/cvsroot/CMake/CMake/Source/kwsys/CMakeLists.txt,v <-- Source/kwsys/CMakeLists.txt
new revision: 1.153; previous revision: 1.152
/cvsroot/CMake/CMake/Source/kwsys/FundamentalType.h.in,v <-- Source/kwsys/FundamentalType.h.in
new revision: 1.4; previous revision: 1.3
/cvsroot/CMake/CMake/Source/kwsys/kwsysPlatformTestsC.c,v <-- Source/kwsys/kwsysPlatformTestsC.c
new revision: 1.4; previous revision: 1.3
(0018547)
Brad King   
2009-11-23 11:36   
The following commit addresses the problem in Utilities/cmlibarchive:

libarchive: Use one architecture for try-compiles
/cvsroot/CMake/CMake/Utilities/cmlibarchive/CMakeLists.txt,v <-- Utilities/cmlibarchive/CMakeLists.txt
new revision: 1.14; previous revision: 1.13
(0018548)
Brad King   
2009-11-23 11:47   
I've scheduled these fixes for 2.8.1.

I also converted one of our universal binary nightly dashboard builds to use "x86_64;i386" as its list of architectures. This should ensure that the combination continues to work.