<font><font face="verdana,sans-serif">Even if you did somehow succeed at building CMake using nvcc, it would make no difference. What that error is saying is: nvcc cannot compile even a simple <a href="http://en.wikipedia.org/wiki/Hello_world_program">C Hello World</a>.</font></font><div>

<font><font face="verdana,sans-serif"><br></font></font></div><div><font><font face="verdana,sans-serif">I know that efficient interfacing between a scenegraph library and CUDA is <a href="http://www.cg.informatik.uni-siegen.de/svt/osgcompute/">not simple</a>.<br>

</font></font><br><div class="gmail_quote">On Tue, Jul 31, 2012 at 3:18 AM, Cook, Rich <span dir="ltr">&lt;<a href="mailto:cook47@llnl.gov" target="_blank">cook47@llnl.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hello<br>
I&#39;m new to the list and apologize if this is obvious or seen before.  I Googled around a bit for the answer but cannot find it.<br>
<br>
My question seemed simple before I tried it.  How does one compile VTK in order to use CUDA? A user of mine requested this;  I&#39;m not a VTK expert and am not sure specifically what she plans to do with the result.<br>


<br>
I see CUDA stuff like this in the source, making me think this should be possible and the question at least makes sense to ask:<br>
<br>
../VTK/Graphics/vtkYoungsMaterialInterface.cxx:77204:#ifdef __CUDACC__<br>
<br>
So, I tried a naive approach:<br>
<br>
export CC=nvcc<br>
export CXX=nvcc<br>
export CPP=nvcc<br>
<br>
mkdir vtk-build<br>
cd vtk-build<br>
cmake ../VTK<br>
<br>
cmake fails as follows, making me think maybe I have to build CMake with nvcc as well?  That would be a bit ugly, but I just want to make sure I&#39;m going down the right path.<br>
Any help is greatly appreciated.<br>
<br>
rcook@edge84 (vtk-build): cmake ../VTK/<br>
-- The C compiler identification is GNU<br>
-- The CXX compiler identification is GNU<br>
-- Check for working C compiler: /opt/cudatoolkit-4.2/bin/nvcc<br>
-- Check for working C compiler: /opt/cudatoolkit-4.2/bin/nvcc -- broken<br>
CMake Error at /collab/usr/global/tools/Kitware/CMake/2.8.7/chaos_5_x86_64_ib/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):<br>
  The C compiler &quot;/opt/cudatoolkit-4.2/bin/nvcc&quot; is not able to compile a<br>
  simple test program.<br>
<br>
  It fails with the following output:<br>
<br>
   Change Dir: /nfs/tmp2/rcook/VTK/5.10/vtk-build/CMakeFiles/CMakeTmp<br>
<br>
<br>
<br>
  Run Build Command:/usr/bin/gmake &quot;cmTryCompileExec/fast&quot;<br>
<br>
  /usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make<br>
  CMakeFiles/cmTryCompileExec.dir/build<br>
<br>
  gmake[1]: Entering directory<br>
  `/nfs/tmp2/rcook/VTK/5.10/vtk-build/CMakeFiles/CMakeTmp&#39;<br>
<br>
  /collab/usr/global/tools/Kitware/CMake/2.8.7/chaos_5_x86_64_ib/bin/cmake -E<br>
  cmake_progress_report<br>
  /nfs/tmp2/rcook/VTK/5.10/vtk-build/CMakeFiles/CMakeTmp/CMakeFiles 1<br>
<br>
  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o<br>
  /opt/cudatoolkit-4.2/bin/nvcc -o<br>
  CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -c<br>
  /nfs/tmp2/rcook/VTK/5.10/vtk-build/CMakeFiles/CMakeTmp/testCCompiler.c<br>
<br>
  Linking C executable cmTryCompileExec<br>
<br>
  /collab/usr/global/tools/Kitware/CMake/2.8.7/chaos_5_x86_64_ib/bin/cmake -E<br>
  cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1<br>
<br>
  /opt/cudatoolkit-4.2/bin/nvcc<br>
  CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -o cmTryCompileExec<br>
  -rdynamic<br>
<br>
  nvcc fatal : Unknown option &#39;rdynamic&#39;<br>
<br>
  gmake[1]: *** [cmTryCompileExec] Error 255<br>
<br>
  gmake[1]: Leaving directory<br>
  `/nfs/tmp2/rcook/VTK/5.10/vtk-build/CMakeFiles/CMakeTmp&#39;<br>
<br>
  gmake: *** [cmTryCompileExec/fast] Error 2<br>
<br>
<br>
<br>
<br>
<br>
  CMake will not be able to correctly generate this project.<br>
Call Stack (most recent call first):<br>
  CMakeLists.txt:15 (PROJECT)<br>
<br>
<br>
<br>
--<br>
✐Richard Cook<br>
✇ Lawrence Livermore National Laboratory<br>
Bldg-453 Rm-4024, Mail Stop L-557<br>
7000 East Avenue,  Livermore, CA, 94550, USA<br>
☎ (office) (925) 423-9605<br>
☎ (fax) (925) 423-6961<br>
---<br>
Information Management &amp; Graphics Grp., Services &amp; Development Div., Integrated Computing &amp; Communications Dept.<br>
(opinions expressed herein are mine and not those of LLNL)<br>
<br>
<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div>