Hi All,
I just wanted to pass along tip I just discovered why compiling Octaviz on an AMD64 linux machine. I was getting a lot of errors compiling Octaviz related to
vtkIdType <> int and this was with latest CVS version. After some investigation, I realized that when building the latest vtk-nightly, I had enabled the cmake option:
<br>
VTK_USE_64BIT_IDS = ON
<br>
thinking that would be good on a 64Bit machine. Well
vtk works fine with this option, but Octave doesn't like it.
I spent all day yesterday, thinking it was the new vtk
nightly causing the problems and had fixxed most the errors with by kludging a lot of casts. I eventually got
it to work believe it or not, but it would crash on vtk_mesh.
<BR>
Anyway to avoid the compilation problems with Octave,
be sure to turn VTK_USE_64BIT_IDS = OFF when you
compile VTK.
<br>
I also had another problem in octaviz.cc that maybe compiler related (I'm using gcc-3.4.3 on Mandrake 10.2 x86_64). The message follows:
<br>
-----
<br>
<pre>
octaviz/Common/octaviz.cc: In member function `virtual unsigned int vtk_object::uint_value(bool, bool) const':
octaviz/Common/octaviz.cc:183: error: reinterpret_cast from `vtkObjectBase*' to `unsigned int' loses precision
octaviz/Common/octaviz.cc: In member function `virtual octave_uint32 vtk_object::uint32_scalar_value() const':
octaviz/Common/octaviz.cc:193: error: reinterpret_cast from `vtkObjectBase*' to `octave_uint32_t' loses precision
</pre><br>
------
Note: These are errors not warnings. This is what I did to get around it. I'm open to hearing other ideas:<br>
I recenty checked the CVS version of octaviz and I had the same problen, comiling it on AMD64 (Fedora 3). I changed octaviz.cc into the following in oder to compile it:
I introduced the macros to make sure that the code gives exacty the same on 32 bit.
In principle the vtk_object::uint_value method should never be called on a 64 bit machine since it reduce 64 bit addresses to 32 bit integers (= the return value).
But I had other problems to make the new version of octaviz work (I will send a separate post for this problems).
Cheers
Alex
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi All,
I just wanted to pass along tip I just discovered why compiling Octaviz on an AMD64 linux machine. I was getting a lot of errors compiling Octaviz related to
vtkIdType <> int and this was with latest CVS version. After some investigation, I realized that when building the latest vtk-nightly, I had enabled the cmake option:
<br>
VTK_USE_64BIT_IDS = ON
<br>
thinking that would be good on a 64Bit machine. Well
vtk works fine with this option, but Octave doesn't like it.
I spent all day yesterday, thinking it was the new vtk
nightly causing the problems and had fixxed most the errors with by kludging a lot of casts. I eventually got
it to work believe it or not, but it would crash on vtk_mesh.
<BR>
Anyway to avoid the compilation problems with Octave,
be sure to turn VTK_USE_64BIT_IDS = OFF when you
compile VTK.
<br>
I also had another problem in octaviz.cc that maybe compiler related (I'm using gcc-3.4.3 on Mandrake 10.2 x86_64). The message follows:
<br>
-----
<br>
<pre>
octaviz/Common/octaviz.cc: In member function `virtual unsigned int vtk_object::uint_value(bool, bool) const':
octaviz/Common/octaviz.cc:183: error: reinterpret_cast from `vtkObjectBase*' to `unsigned int' loses precision
octaviz/Common/octaviz.cc: In member function `virtual octave_uint32 vtk_object::uint32_scalar_value() const':
octaviz/Common/octaviz.cc:193: error: reinterpret_cast from `vtkObjectBase*' to `octave_uint32_t' loses precision
</pre><br>
------
Note: These are errors not warnings. This is what I did to get around it. I'm open to hearing other ideas:<br>
In octaviz/Common/octaviz.cc around line 183;<br>
<pre>
183,184c183
< // return reinterpret_cast<unsigned int>(vtk_pointer);
< return (unsigned int)(vtk_pointer);
---
> return reinterpret_cast<unsigned int>(vtk_pointer);
194,195c193
< // return reinterpret_cast<octave_uint32_t>(vtk_pointer);
< return (octave_uint32_t)(vtk_pointer);
---
> return reinterpret_cast<octave_uint32_t>(vtk_pointer);
</pre>
Hope this helps. Best Regards.
Chuck Sites
Hi,
I recenty checked the CVS version of octaviz and I had the same problen, comiling it on AMD64 (Fedora 3). I changed octaviz.cc into the following in oder to compile it:
unsigned int vtk_object::uint_value (bool req_int, bool frc_str_conv ) const
{
#if __WORDSIZE == 32
return reinterpret_cast<unsigned int>(vtk_pointer);
#else
return reinterpret_cast<uintptr_t>(vtk_pointer);
#endif
}
octave_uint64 vtk_object::uint64_scalar_value (void) const
{
return reinterpret_cast<octave_uint64_t>(vtk_pointer);
}
octave_uint32 vtk_object::uint32_scalar_value (void) const
{
#if __WORDSIZE == 32
return reinterpret_cast<octave_uint32_t>(vtk_pointer);
#else
return reinterpret_cast<uintptr_t>(vtk_pointer);
#endif
}
I introduced the macros to make sure that the code gives exacty the same on 32 bit.
In principle the vtk_object::uint_value method should never be called on a 64 bit machine since it reduce 64 bit addresses to 32 bit integers (= the return value).
But I had other problems to make the new version of octaviz work (I will send a separate post for this problems).
Cheers
Alex