[Insight-developers] Problem again in NRRDIO

Gordon L. Kindlmann glk at uchicago.edu
Thu Mar 25 15:04:21 EDT 2010


Hi,

I'm not an expert on parsing the output of nm, but I can say that  
these types of lines should not be appearing in a name-mangler header  
file, because "_airSanity.6121" is not a symbol that NrrdIO defines;  
"airSanity" is.  There is lots of information in the nm output that  
isn't relevant for name-mangling, and we just need to find which  
information it actually is.  From Bill it sounds like there isn't a  
standard uniform automated procedure for this, which is why we're  
struggling a bit.

Every nm implementation is different, and (I think) necessarily OS- 
specific in the finer details.  If Daniel has access to a comparable  
linux box that he'd be in a position to help figure out which letter  
codes (used by nm to identify the symbol type, and by mangle.pl on  
line 66) are the rights ones to avoid name clashes.  I'm not currently  
able to work on this except try to keep up with the emails.

Certainly, you can rule out a symbol that ends with ".N" where N is  
some integer; I don't think that's legit C syntax for anything.  But  
if such lines are appearing at all, I think its because an overly  
large set of letter codes is being pulled out by mangle.pl, and that's  
really the problem that needs fixing.

Gordon

On Mar 25, 2010, at 1:36 PM, Michel Audette wrote:

> Gordon, can you interpret this error for me? Is this because of the . 
> 6121 and .8527?
> #define _airSanity.6121 itk__airSanity.6121
> #define _nrrdSanity.8527 itk__nrrdSanity.8527
> ?
> So what's need is a further check that no number occurs?
>
> If so, I can do that too...
>
> Michel
>
> On Thu, Mar 25, 2010 at 9:16 AM, Daniel Blezek  
> <Blezek.Daniel at mayo.edu> wrote:
> My compiler didn’t like this line
>
> #define _airSanity.6121 itk__airSanity.6121
>
> [ 25%] Building C object Utilities/NrrdIO/CMakeFiles/ITKNrrdIO.dir/ 
> mop.o
> In file included from /Users/blezek/Source/Insight/Utilities/NrrdIO/ 
> NrrdIO.h:59,
>                  from /Users/blezek/Source/Insight/Utilities/NrrdIO/ 
> mop.c:25:
> /Users/blezek/Source/Insight/Utilities/NrrdIO/itk_NrrdIO_mangle.h: 
> 94:19: warning: missing whitespace after the macro name
> /Users/blezek/Source/Insight/Utilities/NrrdIO/itk_NrrdIO_mangle.h: 
> 555:20: warning: missing whitespace after the macro name
> In file included from /Users/blezek/Source/Insight/Utilities/NrrdIO/ 
> NrrdIO.h:59,
>                  from /Users/blezek/Source/Insight/Utilities/NrrdIO/ 
> 754.c:25:
> /Users/blezek/Source/Insight/Utilities/NrrdIO/itk_NrrdIO_mangle.h: 
> 94:19: warning: missing whitespace after the macro name
> /Users/blezek/Source/Insight/Utilities/NrrdIO/itk_NrrdIO_mangle.h: 
> 555:20: warning: missing whitespace after the macro name
>
>
>
>
>
> On 3/24/10 5:35 PM, "Michel Audette" <michel.audette at kitware.com>  
> wrote:
>
> Daniel, I have a new perl script that both looks for [TBDRStb] in  
> the middle entry, and if not found, looks for nrrd in the 3rd entry.  
> The perl style is not elegant, but it might do the job...
>
> Please give that a whirl.
>
> Michel
>
>
> On Wed, Mar 24, 2010 at 6:04 PM, Michel Audette <michel.audette at kitware.com 
> > wrote:
> Why are there a few _nrrd variables that appear with a "r"? Is this  
> what should be addressed at the source, rather than in the mangle?
>
>
> On Wed, Mar 24, 2010 at 5:56 PM, Daniel Blezek  
> <Blezek.Daniel at mayo.edu> wrote:
> Hi Gordon,
>
>   If it's worth doing, it's worth doing correctly.  I'm on a Mac  
> 10.5 with
> gcc 4.0.1.
>
> I can send you whatever you need.
> -dan
>
>
> On 3/24/10 4:35 PM, "Gordon L. Kindlmann" <glk at uchicago.edu> wrote:
>
> >
> > ah, ok.
> >
> > Still, Daniel, if you have any more patience for this, I'd like to  
> get
> > your help in understanding exactly what symbol types are really
> > mattering here, if you have a platform that roughly matches what
> > Michel is using.  I'm especially nervous about all the non-Teem non-
> > NrrdIO symbols "CSWTCH.37" that are showing up there.
> >
> > Gordon
> >
> > On Mar 24, 2010, at 4:27 PM, Daniel Blezek wrote:
> >
> >> Great!  this fixed it.  Thanks for the help.
> >>
> >> -dan
> >>
> >>
> >> On 3/24/10 3:45 PM, "Michel Audette" <michel.audette at kitware.com>
> >> wrote:
> >>
> >>> Daniel,
> >>>
> >>> please give this one a try...
> >>>
> >>> Best wishes,
> >>>
> >>> Michel
> >>>
> >>> On Wed, Mar 24, 2010 at 4:42 PM, Michel Audette <michel.audette at kitware.com
> >>>> wrote:
> >>>> Think that I found it.
> >>>>
> >>>> Needs a t, b and r at least in the perl script...
> >>>>
> >>>>  t _nrrdSprintCH
> >>>> ...
> >>>> b _nrrdSanity.8527
> >>>> ...
> >>>> r _nrrdGzErrMsg
> >>>>
> >>>> Michel
> >>>>
> >>>>
> >>>> On Tue, Mar 23, 2010 at 6:55 PM, Daniel Blezek <Blezek.Daniel at mayo.edu
> >>>>> wrote:
> >>>>> Ok, dumped itk header in NrrdIO.  Here are the remaining naked
> >>>>> teem symbols (or at least some of them).
> >>>>>
> >>>>> revelation:Insight-macosx blezek$ make -C Utilities/NrrdIO/  
> clean
> >>>>> && make -C Utilities/NrrdIO/
> >>>>> <snip>
> >>>>> [100%] Built target ITKNrrdIO
> >>>>> revelation:Insight-macosx blezek$ date
> >>>>> Tue Mar 23 16:53:30 CDT 2010
> >>>>> revelation:Insight-macosx blezek$ ls -ltr bin/libITKNrrdIO.a
> >>>>> -rw-r--r--  1 blezek  staff  321600 Mar 23 16:52 bin/ 
> libITKNrrdIO.a
> >>>>> revelation:Insight-macosx blezek$ nm bin/libITKNrrdIO.a | grep  
> -v
> >>>>> itk | grep nrrd
> >>>>> 00001bd0 t __nrrdSprintCH
> >>>>> 00001980 t __nrrdSprintDB
> >>>>> 000019c0 t __nrrdSprintFL
> >>>>> 00001ad0 t __nrrdSprintIN
> >>>>> 00001a50 t __nrrdSprintLL
> >>>>> 00001b50 t __nrrdSprintSH
> >>>>> 00001b90 t __nrrdSprintUC
> >>>>> 00001a90 t __nrrdSprintUI
> >>>>> 00001a10 t __nrrdSprintUL
> >>>>> 00001b10 t __nrrdSprintUS
> >>>>> 00003c88 b __nrrdSanity.6421
> >>>>> 000004e0 t __nrrdGzCheckHeader
> >>>>> 00000130 t __nrrdGzDestroy
> >>>>> 00001e40 s __nrrdGzErrMsg
> >>>>> revelation:Insight-macosx blezek$ nm bin/libITKNrrdIO.a | grep  
> -v
> >>>>> itk | grep air
> >>>>> 00000fac b __airSanity.5193
> >>>>> revelation:Insight-macosx blezek$ nm bin/libITKNrrdIO.a | grep  
> -v
> >>>>> itk | grep biff
> >>>>> bin/libITKNrrdIO.a(biffbiff.o):
> >>>>> bin/libITKNrrdIO.a(biffmsg.o):
> >>>>> revelation:Insight-macosx blezek$ nm bin/libITKNrrdIO.a | grep  
> -v
> >>>>> itk | grep bmsg
> >>>>> 00001594 b __bmsg
> >>>>> 00001598 b __bmsgArr
> >>>>> 00001590 b __bmsgNum
> >>>>> revelation:Insight-macosx blezek$
> >>>>>
> >>>>>
> >>>>>
> >>>>> On 3/23/10 3:38 PM, "Michel Audette" <michel.audette at kitware.com
> >>>>> <http://michel.audette@kitware.com <http://kitware.com>
> >>>>>>> wrote:
> >>>>>
> >>>>>> Hi Daniel,
> >>>>>>
> >>>>>> I have another file for you. I meant to send it before to you,
> >>>>>> but mistakenly only sent it to Gordon.
> >>>>>>
> >>>>>> Please try the enclosed.
> >>>>>>
> >>>>>> Michel
> >>>>>>
> >>>>>> On Tue, Mar 23, 2010 at 5:00 PM, Michel Audette
> >>>>>> <michel.audette at kitware.com
> >>>>>>  <http://michel.audette@kitware.com <http://kitware.com> > >  
> wrote:
> >>>>>>> With both lines modified in the manner suggested by Gordon,
> >>>>>>>     if (m/ [TBDRS] /) {
> >>>>>>>         s|.* [TBDRS] (.*)|$1|g;
> >>>>>>> the outcome is a little different.
> >>>>>>>
> >>>>>>> michel at michel-desktop:~/tools/Insight_ALL/generatedNrrdIO$  
> diff
> >>>>>>> itk_NrrdIO_mangle.h itk_NrrdIO_mangleOld.h
> >>>>>>> 89d88
> >>>>>>> < #define airDisableDio itk_airDisableDio
> >>>>>>> 109d107
> >>>>>>> < #define airStrtokQuoting itk_airStrtokQuoting
> >>>>>>> 153d150
> >>>>>>> < #define _biffMsgNoop itk__biffMsgNoop
> >>>>>>> 353,357d349
> >>>>>>> < #define nrrdStateDisableContent itk_nrrdStateDisableContent
> >>>>>>> < #define nrrdStateGrayscaleImage3D  
> itk_nrrdStateGrayscaleImage3D
> >>>>>>> < #define nrrdStateKeyValuePairsPropagate
> >>>>>>> itk_nrrdStateKeyValuePairsPropagate
> >>>>>>> < #define nrrdStateKeyValueReturnInternalPointers
> >>>>>>> itk_nrrdStateKeyValueReturnInternalPointers
> >>>>>>> < #define nrrdStateKindNoop itk_nrrdStateKindNoop
> >>>>>>> 359d350
> >>>>>>> < #define nrrdStateVerboseIO itk_nrrdStateVerboseIO
> >>>>>>>
> >>>>>>> Try that?
> >>>>>>>
> >>>>>>> Michel
> >>>>>>>
> >>>>>>>
> >>>>>>> On Tue, Mar 23, 2010 at 4:56 PM, Michel Audette
> >>>>>>> <michel.audette at kitware.com
> >>>>>>>  <http://michel.audette@kitware.com <http://kitware.com> > >  
> wrote:
> >>>>>>>> Hi Gordon,
> >>>>>>>>
> >>>>>>>> only the line substitution that you suggested was implemented
> >>>>>>>> in the mangle.pl <http://mangle.pl>  <http://mangle.pl>  <http://mangle.pl 
> > . Had
>
> >>>>>>>> you intende to apply the same change to the if line just
> >>>>>>>> above. I didn't notice until now.
> >>>>>>>>
> >>>>>>>> Michel
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> On Tue, Mar 23, 2010 at 5:53 PM, Daniel Blezek <Blezek.Daniel at mayo.edu
> >>>>>>>>  <http://Blezek.Daniel@mayo.edu <http://mayo.edu> > > wrote:
> >>>>>>>>> Ok,  at least one symbol made it through unscathed.
> >>>>>>>>>
> >>>>>>>>> ld: duplicate symbol _airStrtokQuoting in /Users/blezek/
> >>>>>>>>> Source/Insight-macosx/bin/libITKNrrdIO.a(string.o) and ../ 
> bin/
> >>>>>>>>> libteem.a(string.o)
> >>>>>>>>>
> >>>>>>>>> Here are the non-itk procteced symbols:
> >>>>>>>>>
> >>>>>>>>> nm /Users/blezek/Source/Insight-macosx/bin/libITKNrrdIO.a |
> >>>>>>>>> grep -v itk > Tmp.txt
> >>>>>>>>>
> >>>>>>>>> + some editing.
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> On 3/23/10 2:33 PM, "Michel Audette" <michel.audette at kitware.com
> >>>>>>>>>  <http://michel.audette@kitware.com <http://kitware.com> >
> >>>>>>>>> <http://michel.audette@kitware.com <http://kitware.com>
> >>>>>>>>>>> wrote:
> >>>>>>>>>
> >> Hi Daniel,
> >>
> >> here it is...
> >>
> >> Michel
> >>
> >> On Tue, Mar 23, 2010 at 4:29 PM, Gordon L. Kindlmann
> >> <glk at uchicago.edu <http://glk@uchicago.edu <http://uchicago.edu>  
> >  <http://
>
> >> glk at uchicago.edu> > wrote:
> >> Hi,
> >>
> >> so can you try changing in mangle.pl <http://mangle.pl>  <http://mangle.pl 
> >  <http://mangle.pl
> >>>  <http://mangle.pl>
> >>
> >>         s|.* [TDRS] (.*)|$1|g;
> >>
> >> to
> >>
> >>         s|.* [TBDRS] (.*)|$1|g;
> >>
> >> and send the resulting itk_NrrdIO_mangle.h to Daniel so he can see
> >> if it fixes the problem?
> >>
> >> Gordon
> >>
> >>
> >>
> >> On Mar 23, 2010, at 3:25 PM, Michel Audette wrote:
> >>
> >> defaultsNrrd.o:
> >> 0000000000000010 D nrrdDefaultCenter
> >> 0000000000000018 D nrrdDefaultSpacing
> >> 0000000000000004 D nrrdDefaultWriteBareText
> >> 0000000000000008 D nrrdDefaultWriteCharsPerLine
> >> 0000000000000000 D nrrdDefaultWriteEncodingType
> >> 000000000000000c D nrrdDefaultWriteValsPerLine
> >> 0000000000000020 D nrrdStateAlwaysSetContent
> >> 0000000000000008 B nrrdStateDisableContent
> >> 000000000000000c B nrrdStateGrayscaleImage3D
> >> 0000000000000004 B nrrdStateKeyValuePairsPropagate
> >> 0000000000000010 B nrrdStateKeyValueReturnInternalPointers
> >> 0000000000000014 B nrrdStateKindNoop
> >> 0000000000000028 D nrrdStateUnknownContent
> >> 0000000000000000 B nrrdStateVerboseIO
> >>
> >> We can talk on the phone if you prefer... Let me know.
> >>
> >> Cheers,
> >>
> >> Michel
> >>
> >> On Tue, Mar 23, 2010 at 4:23 PM, Gordon L. Kindlmann
> >> <glk at uchicago.edu <http://glk@uchicago.edu <http://uchicago.edu>  
> >  <http://
>
> >> glk at uchicago.edu> > wrote:
> >> Hello,
> >>
> >> Ok, so the question is, *how* is nrrdStateGrayscaleImage3D listed?
> >> there is probably some cryptic single letter code that identifies
> >> the type of symbol.  mangle.pl <http://mangle.pl>  <http://mangle.pl 
> >  <http://
> >> mangle.pl <http://mangle.pl> >  <http://mangle.pl>  is using  
> these letter codes to
>
> >> distinguish between symbols that the NrrdIO library is actually
> >> supplying, versus merely using, and the problem is that
> >> nrrdStateGrayscaleImage3D is actually being supplied, but is not
> >> being recorded as such in the output of mangle.pl <http:// 
> mangle.pl>  <http://
> >> mangle.pl <http://mangle.pl> >  <http://mangle.pl>  <http://mangle.pl 
> > .  Line 66 of
> >> mangle.pl <http://mangle.pl>  <http://mangle.pl>  <http:// 
> mangle.pl>  <http://
>
> >> mangle.pl <http://mangle.pl> >  is where this decision is made;  
> so it may need tweaking.
> >>
> >>
> >>
> >> Gordon
> >>
> >>
> >> On Mar 23, 2010, at 3:18 PM, Michel Audette wrote:
> >>
> >> Hi Gordon,
> >>
> >> According to this procedure, _nrrdStateGrayscaleImage3D fails to
> >> appear, although nrrdStateGrayscaleImage3D is listed in the result
> >> of nm.
> >>
> >> What next?
> >>
> >> Michel
> >>
> >> On Tue, Mar 23, 2010 at 2:07 PM, Gordon L. Kindlmann
> >> <glk at uchicago.edu <http://glk@uchicago.edu <http://uchicago.edu>  
> >  <http://
>
> >> glk at uchicago.edu> > wrote:
> >> Hello,
> >>
> >> Shoot- sorry about this; I was just thinking the NrrdIO update was
> >> finished!
> >>
> >> There indeed probably aren't any tests for checking compiling
> >> applications against both Teem (containing the air, biff, and nrrd
> >> libraries that these symbols are coming from) and ITK (containing
> >> NrrdIO, the fraction of Teem required for Nrrd file IO).  Aren't
> >> Slicer builds doing this?  Are there analogous tests for, say,
> >> compiling applications against non-ITK zlib and ITK name-mangled
> >> zlib, which can be copied from?
> >>
> >> I can tell that these names are for the global variables that exist
> >> in NrrdIO.  These are probably not getting correctly picked up from
> >> the list of symbols in the NrrdIO library, which mangle.pl <http://mangle.pl 
> >  <http://mangle.pl
> >>>  <http://mangle.pl>  <http://mangle.pl>  does by using "nm".
> >>
> >> Michel, can go through the NrrdIO process on whatever platform you
> >> used last, and at the point of running mangle.pl <http:// 
> mangle.pl>  <http://mangle.pl>
> >> <http://mangle.pl>  <http://mangle.pl> , can you run "nm" manually
> >> and grep for, say, _nrrdStateGrayscaleImage3D, and see how that
> >> symbol is identified?  Line 66 of mangle.pl <http://mangle.pl>  <http://mangle.pl 
> >
> >> <http://mangle.pl
> >>>  <http://mangle.pl>  apparently is missing this.
> >>
> >>
> >>
> >> Gordon
> >>
> >>
> >> On Mar 23, 2010, at 12:33 PM, Daniel Blezek wrote:
> >>
> >> Hi,
> >>
> >>  We link both against NRRD and ITK in our applications.  At the end
> >> of February, the mangled ITK names were changed from what I fixed.
> >> Clearly, this is not tested properly, because today I updated ITK
> >> and re-built:
> >>
> >> 34>ITKNrrdIO.lib(string.obj) : error LNK2005: _airStrtokQuoting
> >> already defined in teem.lib(string.obj)
> >> 34>ITKNrrdIO.lib(defaultsNrrd.obj) : error LNK2005:
> >> _nrrdStateVerboseIO already defined in teem.lib(defaultsNrrd.obj)
> >> 34>ITKNrrdIO.lib(defaultsNrrd.obj) : error LNK2005:
> >> _nrrdStateKeyValuePairsPropagate already defined in
> >> teem.lib(defaultsNrrd.obj)
> >> 34>ITKNrrdIO.lib(defaultsNrrd.obj) : error LNK2005:
> >> _nrrdStateDisableContent already defined in  
> teem.lib(defaultsNrrd.obj)
> >> 34>ITKNrrdIO.lib(defaultsNrrd.obj) : error LNK2005:
> >> _nrrdStateGrayscaleImage3D already defined in
> >> teem.lib(defaultsNrrd.obj)
> >> 34>ITKNrrdIO.lib(defaultsNrrd.obj) : error LNK2005:
> >> _nrrdStateKeyValueReturnInternalPointers already defined in
> >> teem.lib(defaultsNrrd.obj)
> >> 34>ITKNrrdIO.lib(defaultsNrrd.obj) : error LNK2005:
> >> _nrrdStateKindNoop already defined in teem.lib(defaultsNrrd.obj)
> >> 34>ITKNrrdIO.lib(biffmsg.obj) : error LNK2005: __biffMsgNoop  
> already
> >> defined in teem.lib(biffmsg.obj)
> >> 34>ITKNrrdIO.lib(dio.obj) : error LNK2005: _airDisableDio already
> >> defined in teem.lib(dio.obj)
> >>
> >> Could “Michel” (according to CVS) please have a closer look at
> >> this?  I had tweaked this once before, and my changes were blown
> >> away by the (broken) mangle.pl <http://mangle.pl>  <http://mangle.pl 
> >  <http://
> >> mangle.pl <http://mangle.pl> >  <http://mangle.pl>  script.
>
> >>
> >>
> >>
> >> I’ll go back through and manually add the names if necessary.
> >>
> >> Cheers,
> >> -dan
> >>
> >> --
> >> Daniel Blezek, PhD
> >> Medical Imaging Informatics Innovation Center
> >>
> >> P 127 or (77) 8 8886
> >> T 507 538 8886
> >> E blezek.daniel at mayo.edu
> >>
> >> Mayo Clinic
> >> 200 First St. S.W.
> >> Harwick SL-44
> >> Rochester, MN 55905
> >> mayoclinic.org <http://mayoclinic.org>
> >>
> >
>
> --
> Daniel Blezek, PhD
> Medical Imaging Informatics Innovation Center
>
> P 127 or (77) 8 8886
> T 507 538 8886
> E blezek.daniel at mayo.edu
>
> Mayo Clinic
> 200 First St. S.W.
> Harwick SL-44
> Rochester, MN 55905
> mayoclinic.org <http://mayoclinic.org>
>
>
>
>
>
> -- 
> Daniel Blezek, PhD
> Medical Imaging Informatics Innovation Center
>
> P 127 or (77) 8 8886
> T 507 538 8886
> E blezek.daniel at mayo.edu
>
> Mayo Clinic
> 200 First St. S.W.
> Harwick SL-44
> Rochester, MN 55905
> mayoclinic.org
>
>
>
>
> -- 
> Michel Audette, Ph.D.
> R & D Engineer,
> Kitware Inc.,
> Chapel Hill, N.C.
>



More information about the Insight-developers mailing list