[vtkusers] Re: OSX universal binaires for VTK, cmake , ITK
Sean McBride
sean at rogue-research.com
Tue Jan 30 14:48:51 EST 2007
Dan,
Please don't crosspost, it makes things complicated for people not on
both lists. I am replying to the VTK list only.
>so i wanted to ask you how you have been getting on with building
>universal binaires -arch ppc;i386
>and also very fat binaries -arch ppc;ppc64;i386;x86_64
>for VTK, CMake etc (we are also building ITK)
>
>Previously i thought there was a problem in CMake that prevented the
>proper generation of universal binaries ppc;i386
>because it made the assumption that the build arch was the same as
>the arch for execution of the binaries generated.
>So a PPC could make i386 binaries, but they wouldn't run properly?
>
>I might have misunderstood the situation...?
>Is this, or was it ever an issue?
>
>Can we just use
>CMAKE_OSX_ARCHITECTURES ppc;ppc64;i386;x86_64
>
>or do we have to set the -arch ppc;ppc64;i386;x86_64
>in the CFLAGS and CXXFLAGS and linker flags?
>
>any info on the current state of affairs and how to do this the right
>way would be very welcome!
CMAKE_OSX_ARCHITECTURES ppc;ppc64;i386;x86_64 "works" in theory, from
the CMake point of view. But:
- even specifying just ppc;i386 will not really work. It will build as
universal, but the "other half" won't work properly. So if you build on
a PPC, the code won't run properly on intel, and vice versa. This is
due to TRY_RUN use by VTK. VTK tests the endianness of the building
machine and then uses that for both the ppc and intel builds, so it's
always wrong for one half. (bug 3059)
- building VTK as 64 bit in OS 10.4 can only be done if you turn off
VTK_USE_RENDERING, as Carbon/Cocoa are not available as 64 bit in 10.4.
- building VTK (with VTK_USE_CARBON) as 64 bit in OS 10.5 is impossible
because QuickDraw is used (and no longer available) (bug 4001)
- building VTK (with VTK_USE_COCOA) as 64 bit in OS 10.5 almost works.
You have to stub out freetype (bug 3670). I suspect there will be
runtime bugs even then.
- CMake itself does not build as 64 bit (bug 4348)
- I've never used ITK, so I have no idea there
So basically, you need to build for ppc on a ppc, for intel on an intel,
then use 'lipo' to put them together. 64 bit builds basically don't work.
So there is a A LOT of work to be done! Care to help? :)
--
____________________________________________________________
Sean McBride, B. Eng sean at rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
More information about the vtkusers
mailing list