[Insight-users] Cannot build ITK for MAC OS X Tiger 64 bit

Alex Lisovich alex.lisovich at gmail.com
Tue Jul 10 17:33:14 EDT 2007


Hi Sean,

> Ahhhh, I think I know what you are seeing:
> <http://www.vtk.org/Bug/bug.php?op=show&bugid=3618>
>
> As a workaround, you must pass at least two things in
> CMAKE_OSX_ARCHITECTURES say "x86_64;ppc64".  I encourage you to vote for
> this bug and/or bug Bill. :)

I tried that (CXX and C flags left empty), and:
- It builds for both architectures, and I definitely do not need
ppc64, so I would prefer to set CMAKE_CXX_FLAGS and CMAKE_C_FLAGS,
which does exactly what I need, i.e. builds for x86_64 only

- If  tests are included (no examples, no shared libraries), the build
of ITK fails as before (see earlier message in this thread) producing
exactly the same report, this time for both architectures:
ld64-62.1 failed: duplicate symbol
itk::Object::SetGlobalWarningDisplay(bool) in
/Users/Alex/Sources/ITKCVS/Insight_built/bin/libITKCommon.a(itkObject.o)
and /Users/Alex/Sources/ITKCVS/Insight_built/bin/libITKCommon.a(itkObject.o)

As probably other people are trying to use ITK on intel-based Mac in
64 bit mode and as I was finally able to succesfully run few our
ITK-based applications in 64 bit mode after all, I would like to
summarize the experience below, using the message # in this thread as
a reference to the solution:

1. Modify ../Code/Common/CMakeLists.txt and
../Code/Common/itlMultiThreader.cxx as per Message #2 (Seen MkBride)

2. Be carefull to avoid duplications in CMakeLists.txt files as per
Message #7 (Luis Ibanez)

3. Do not try to build ITK tests in 64 bit mode as per Message #8 and
#12, at least do not hesitate to turn the tests off if the first
attempt fails

4.  Use
CMAKE_CXX_FLAGS=-arch x86_64
CMAKE_C_FLAGS=-arch x86_64
if you are using make and
ARCHS="x86_64" if using xcodebuild as per Message #8. If using Xcode
IDE, set the project architecture to "x86_64"

Have a nice evening

Alex


More information about the Insight-users mailing list