[Insight-users] Problems compiling ITK on OSX

Kathryn Hayes hayes at bwh.harvard.edu
Fri Jun 3 17:56:30 EDT 2005


Hi,

We took a security patch on our Mac OSX 10.3 machine last night, and we're
now having problems compiling ITK (ITK-Slicer-2-5).  I found a couple of
other references to this problem in the archives (e.g.
http://public.kitware.com/pipermail/insight-users/2005-May/013042.html),
but no solution.

The error is:

Building shared library /Users/hayes/dev-cvs-nightly/slicer2/Lib/darwin-ppc/Insight-build/bin/libitkvnl.dylib...
ld: vnl_math.o illegal reference for -dynamic code (section difference
reference from section (__TEXT,__eh_frame) relocation entry (0) to symbol:
___isnan defined in dylib: /usr/lib/libm.dylib)
/usr/bin/libtool: internal link edit command failed
make[9]: *** [/Users/hayes/dev-cvs-nightly/slicer2/Lib/darwin-ppc/Insight-build/bin/libitkvnl.dylib] Error 1

I believe that this may be related to a known issue in
/usr/include/gcc/darwin/3.3/c++/cmath that #undefs isnan().

Here is a small example of the behavior:

-----------------------------------
#include <cmath>

int main(int argc, char **argv) {
  int x = isnan(10.0);
}
-----------------------------------

Result:

mimer:/tmp hayes$ c++ zz.cxx -o zz.o -lm
zz.cxx: In function `int main(int, char**)':
zz.cxx:4: error: `isnan' undeclared (first use this function)
zz.cxx:4: error: (Each undeclared identifier is reported only once for
each function it appears in.)

-----------------------------------
#include <cmath>

int main(int argc, char **argv) {
  int x = __isnan(10.0);
}
-----------------------------------

Result:

mimer:/tmp hayes$ c++ zz.cxx -o zz.o -lm
ld: /var/tmp//ccmT5loo.o illegal reference for -dynamic code (section
difference reference from section (__TEXT,__eh_frame) relocation entry (0)
to symbol: ___isnan defined in dylib: /usr/lib/libm.dylib)

Both __isnand and __isnanf do work, however.  Any ideas?

Katie




More information about the Insight-users mailing list