[CMake] Specifying build architectures on Mac OS X (ppc7400 does
not work?)
Bill Hoffman
bill.hoffman at kitware.com
Tue May 15 16:52:56 EDT 2007
Sean McBride wrote:
> On 2007-05-15 14:22, Bill Hoffman said:
>
>
>> Did you try a make VERBOSE=1 to see what flags were being used during
>> the building of stuff to find out where it went wrong?
>>
>
> Hi Bill,
>
> Thanks for your quick reply. I have just tried your suggestion. I
> changed one vtk source file: vtkImageReslice.cxx. I did "make
> VERBOSE=1". It sure is verbose. :) The relevant parts seem to be:
>
> ---------
> [ 20%] Building CXX object Imaging/CMakeFiles/vtkImaging.dir/vtkImageReslice.o
>
> /usr/bin/c++ -arch ppc7400 -arch i386 -isysroot /Developer/SDKs/
> MacOSX10.4u.sdk <SNIP>
>
> Linking CXX static library ../bin/libvtkImaging.a
>
> cd /Users/sean/kitware/VTK-pristine-bin/Imaging && /Users/sean/kitware/
> CMake-install/bin/cmake -P CMakeFiles/vtkImaging.dir/cmake_clean_target.cmake
>
> cd /Users/sean/kitware/VTK-pristine-bin/Imaging && /Users/sean/kitware/
> CMake-install/bin/cmake -E cmake_link_script CMakeFiles/vtkImaging.dir/
> link.txt --verbose=1
>
> /usr/bin/ar cr ../bin/libvtkImaging.a <SNIP> "CMakeFiles/vtkImaging.dir/
> vtkImageReslice.o" <SNIP>
>
> /usr/bin/ranlib ../bin/libvtkImaging.a
> ---------
>
> It seems to be passing "-arch ppc7400" correctly. Also,
>
> lipo -info /Users/sean/kitware/VTK-pristine-bin/Imaging/CMakeFiles/
> vtkImaging.dir/vtkImageReslice.o
>
> says:
>
> Architectures in the fat file: /Users/sean/kitware/VTK-pristine-bin/
> Imaging/CMakeFiles/vtkImaging.dir/vtkImageReslice.o are: ppc7400 i386
>
> Good, the .o file is ok! Yet,
>
> lipo -info /Users/sean/kitware/VTK-pristine-bin/bin/libvtkImaging.a
>
> incorrectly gives:
>
> Architectures in the fat file: /Users/sean/kitware/VTK-pristine-bin/bin/
> libvtkImaging.a are: ppc i386
>
> Could 'ar' or 'ranlib' have done something weird?
>
I can't see how ar or ranlib could change the nature of .a files. I
think you can use ar to extract the .o files back out of a .a. ar x,
sort of like tar. Maybe it is just a bug in lipo and the libs are
really ok. Actually that seems far more likely as the executables are
created from the .a files are fine.
-Bill
More information about the CMake
mailing list