CMake 2.8rc2 and "CHECK_TYPE_SIZE found different results" error

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

CMake 2.8rc2 and "CHECK_TYPE_SIZE found different results" error

Sean McBride
Hi all,

I've just tried building VTK with 2.8rc1 and it gives an error:

-- Check size of long
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):
  CMake/CMakeBackwardCompatibilityC.cmake:14 (CHECK_TYPE_SIZE)
  CMakeLists.txt:403 (INCLUDE)

I don't recall this happening in earlier versions.

Indeed I have set CMAKE_OSX_ARCHITECTURES to "i386;x86_64" and this
error does go away if I use only one arch.  It is also correct that
'long' has a different size between those 2 architectures.
Nevertheless, I want/need to build VTK in both architectures.

What is the correct fix here?  I guess it's VTK that needs to change?

Thanks,

--
____________________________________________________________
Sean McBride, B. Eng                 [hidden email]
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: CMake 2.8rc2 and "CHECK_TYPE_SIZE found different results" error

Brad King
Sean McBride wrote:

> Hi all,
>
> I've just tried building VTK with 2.8rc1 and it gives an error:
>
> -- Check size of long
> 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):
>   CMake/CMakeBackwardCompatibilityC.cmake:14 (CHECK_TYPE_SIZE)
>   CMakeLists.txt:403 (INCLUDE)
>
> I don't recall this happening in earlier versions.

Have you used the combination of 32-bit and 64-bit archs before?
What does 2.6.4 do?

> Indeed I have set CMAKE_OSX_ARCHITECTURES to "i386;x86_64" and this
> error does go away if I use only one arch.  It is also correct that
> 'long' has a different size between those 2 architectures.
> Nevertheless, I want/need to build VTK in both architectures.
>
> What is the correct fix here?  I guess it's VTK that needs to change?

The problem is that the project is querying the size of a type with
a try-compile assuming that there is only one target architecture.
Any decision made in the CMakeLists.txt file based on this result
may not work for both architectures.

In order to support universal binaries VTK needs to be taught about
them.  Endian-ness and type size need to be selected at preprocessing
time.  That doesn't mean try-compile can't be used at all for ABI
related queries, but if it is then it should be run once for each
architecture by setting CMAKE_TRY_COMPILE_OSX_ARCHITECTURES to one
value at a time.

Please bring this up on the VTK develpoers list.

-Brad

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake