I&#39;m having some issues linking an application that uses OpenMP with VTK libraries. I have experienced the problem on two 64 but linux machines with 4, and 8 cores. I am compiling with gcc-4.5.0. I also compiled vtk with this compiler. <br>
<br>My library contains some classes with vtk members, but none of my OpenMP directives involve these members. Inclusion of vtk is optional and all vtk calls are #ifdef around so I can compile with and without vtk.<br><br>
Across the board if I link with vtk and enable more than 2 cores I get significant inefficiency. For example on my 8 core machine I have an application that uses my library. (There are no vtk calls)<br><br>time <br clear="all">
 real    0m4.320s<br>user    0m21.155s<br>sys    0m10.306s<br><br>But if I don&#39;t link against vtk (no vtk code anywhere)<br><br>time<br>real    0m1.792s<br>user    0m13.716s<br>sys    0m0.327s<br><br>In fact by using the preprocessor catches, I can link against vtk but not include any vtk objects in my library and I still see this behaviour: (Link against vtk, but no vtk code)<br>
<br>time<br>real    0m4.379s<br>user    0m21.539s<br>sys    0m10.313s<br><br>So simply the act of linking these libraries is causing me a lot of headache with OpenMP<br>-lvtkCommon -lvtkRendering -lvtkGraphics -lvtkHybrid -lvtkWidgets -lvtkFiltering -lvtkVolumeRendering<br>
<br>Does anyone have any idea why this could be? Or any solutions. I tried building vtk with and without the Parallel option, but that didn&#39;t help.<br><br>Thanks for any ideas. I&#39;ll try to assemble a minimal code example, but maybe someone has an idea offhand.<br>
<br>-Trevor<br><br>