[vtkusers] VtkExodusReader.cxx compile error with Intel Compiler on OS X

David Cole david.cole at kitware.com
Fri Oct 6 13:13:05 EDT 2006


I just committed the fix to CVS after verifying with Visual Studio on 
Windows... We'll let the dashboards tell us if there's anything else 
wrong with this (besides the poor design of using a global string to 
return an internal buffer from a C++ class method...) ;)

Thanks for the report,
David

Mike Jackson wrote:

>OK, I took the code located at line 633 of VtkExodusReader.cxx and moved it
>up to line 50, which for me is just above the #define DEBUG 0 code.
>
>I compiled with the Intel Compiler and all seems to compile fine. So this
>fix seems to work fine. I have NOT recompiled with GCC on OS X yet to test
>this.. I will assume that you will take care of that..?
>
>Thanks for the Help
>Mike Jackson
>
>
>On 10/6/06 12:06 PM, "David Cole" <david.cole at kitware.com> wrote:
>
>  
>
>>Oops. Sorry. I didn't look at the context of this before I suggested
>>simply removing the "static" -- I assumed it was at the "file global
>>scope" level when in fact it's declaring a static variable (a global)
>>with local scope. We'll either have to put it out at file global scope
>>level to keep it safe or re-design this method of the exodus reader.
>>
>>As it stands, it's somewhat unsafe right now. We're returning an
>>internal buffer from a method that will change with the same call to the
>>next method. All callers must understand that it's a temporary value and
>>they'll have to make their own copy for it to be safe...
>>
>>Could you please try one more thing? Moving it out into file scope by
>>copying it from where it is out in between the #define and the beginning
>>of the class definition at the top of the file?? If you can verify that
>>that still fixes your problem and works, then I can commit it to CVS for
>>you...
>>
>>Thanks,
>>David Cole
>>Kitware, Inc.
>>
>>
>>Mike Jackson wrote:
>>
>>    
>>
>>>I now have:
>>>
>>>vtkStdString blocks = "";
>>>
>>>And it compiles just fine now..
>>>
>>>This is with OS X 10.4.8 and the Intel Compiler on a MacBook Pro. Just FYI.
>>>
>>>Should I post a bug or will this get put into CVS by someone?
>>>
>>>Thanks
>>>Mike Jackson
>>>
>>>On 10/6/06 9:44 AM, "David Cole" <david.cole at kitware.com> wrote:
>>>
>>> 
>>>
>>>      
>>>
>>>>Have you tried this:
>>>>vtkStdString blocks;
>>>>
>>>>or this:
>>>>vtkStdString blocks = "";
>>>>
>>>>Just eliminate the "static" keyword if that works... It's only used in
>>>>this sort of construct to prevent people from accessing it from another
>>>>.cxx file with:
>>>>extern vtkStdString blocks;
>>>>
>>>>And since nobody is doing that and we don't really care if somebody
>>>>tries to do that... it should be ok to eliminate "static" if that makes
>>>>it work...
>>>>
>>>>
>>>>David
>>>>
>>>>
>>>>Mike Jackson wrote:
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>>>On 10/6/06 9:26 AM, "Mathieu Malaterre" <mathieu.malaterre at kitware.com>
>>>>>wrote:
>>>>>
>>>>>
>>>>>
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>>>>Mike Jackson wrote:
>>>>>>  
>>>>>>
>>>>>>       
>>>>>>
>>>>>>            
>>>>>>
>>>>>>>I am trying to compile vtk 5.0.2 with the Intel Compiler on OS X. The
>>>>>>>compile made it all the way to vtkHybrib where it threw a linker error:
>>>>>>>
>>>>>>>ld: common symbols not allowed with MH_DYLIB output format with the
>>>>>>>-multi_module option
>>>>>>>CMakeFiles/vtkHybrid.dir/vtkExodusReader.o definition of common
>>>>>>>__ZGVZN17vtkExodusMetadata16GetPartBlockInfoEiE6blocks (size 16)
>>>>>>>CMakeFiles/vtkHybrid.dir/vtkExodusReader.o definition of common
>>>>>>>__ZZN17vtkExodusMetadata16GetPartBlockInfoEiE6blocks (size 16)
>>>>>>>libtool: internal link edit command failed
>>>>>>>
>>>>>>>Googling for this type of error reveals that the offending line of code
>>>>>>>is
>>>>>>>at line 633 of vtkExodusReader.cxx which is:
>>>>>>>
>>>>>>>static vtkStdString blocks;
>>>>>>>    
>>>>>>>
>>>>>>>         
>>>>>>>
>>>>>>>              
>>>>>>>
>>>>>>can you try this:
>>>>>>
>>>>>>static vtkStdString blocks = "";
>>>>>>
>>>>>>
>>>>>>thx
>>>>>>-Mathieu
>>>>>>  
>>>>>>
>>>>>>       
>>>>>>
>>>>>>            
>>>>>>
>>>>>Same error...
>>>>>
>>>>>Can we use a vtkSmartPointer for this?
>>>>>
>>>>>VtkSmartPointer<vtkStdString> blocks =
>>>>>vtkSmartPointer<vtkStdString>::New();
>>>>>
>>>>>Since I do not know the code I guess I don't understand why "blocks" has to
>>>>>be static.
>>>>>
>>>>>
>>>>>
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>
>>>
>>>_______________________________________________
>>>This is the private VTK discussion list.
>>>Please keep messages on-topic. Check the FAQ at:
>>>http://www.vtk.org/Wiki/VTK_FAQ
>>>Follow this link to subscribe/unsubscribe:
>>>http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>> 
>>>
>>>      
>>>
>
>  
>



More information about the vtkusers mailing list