[Insight-users] Problem of compiling ITK-2.0.1 on Mac OS X.

Zhu, Yuanxin Yuanxin.Zhu at kla-tencor.com
Fri Jun 17 16:44:58 EDT 2005


Hello,

I'm having the same problem of compiling ITK-2.0.1 on Mac OS X as other
users reported previously (see attachment at the bottom.). This time, I
downloaded ITK-2.0.1, installed CMake, then made a clear directory
"InsightBinary" to build ITK. I used almost all the default compiling
options, except for enabling compiling test codes.  Particularly,
building "Shared Library" is OFF.

Again, the error message is listed below:

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)

Any help with this problem would be highly appreciated.

Thanks,

Yuanxin Zhu


[Insight-users] Problems compiling ITK on OSX
Kathryn Hayes hayes at bwh.harvard.edu 
Fri Jun 3 17:56:30 EDT 2005 


*	Previous message: [Insight-users] Question:
Deformation fields 
*	Next message: [Insight-users] Question: Deformation
fields 
*	Messages sorted by: [ date ] [ thread ] [ subject ]
[ author ] 

------------------------------------------------------------------------

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/li
bitkvnl.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/l
ibitkvnl.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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20050617/1ec20c27/attachment.html


More information about the Insight-users mailing list