[vtkusers] compiling VTK against CUDA 4.2

Cook, Rich cook47 at llnl.gov
Mon Jul 30 21:18:42 EDT 2012


Hello
I'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.  

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'm not a VTK expert and am not sure specifically what she plans to do with the result.  

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: 

../VTK/Graphics/vtkYoungsMaterialInterface.cxx:77204:#ifdef __CUDACC__

So, I tried a naive approach: 

export CC=nvcc
export CXX=nvcc
export CPP=nvcc

mkdir vtk-build
cd vtk-build
cmake ../VTK

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'm going down the right path. 
Any help is greatly appreciated. 

rcook at edge84 (vtk-build): cmake ../VTK/
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /opt/cudatoolkit-4.2/bin/nvcc
-- Check for working C compiler: /opt/cudatoolkit-4.2/bin/nvcc -- broken
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):
  The C compiler "/opt/cudatoolkit-4.2/bin/nvcc" is not able to compile a
  simple test program.

  It fails with the following output:

   Change Dir: /nfs/tmp2/rcook/VTK/5.10/vtk-build/CMakeFiles/CMakeTmp

  

  Run Build Command:/usr/bin/gmake "cmTryCompileExec/fast"

  /usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  gmake[1]: Entering directory
  `/nfs/tmp2/rcook/VTK/5.10/vtk-build/CMakeFiles/CMakeTmp'

  /collab/usr/global/tools/Kitware/CMake/2.8.7/chaos_5_x86_64_ib/bin/cmake -E
  cmake_progress_report
  /nfs/tmp2/rcook/VTK/5.10/vtk-build/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o
  /opt/cudatoolkit-4.2/bin/nvcc -o
  CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -c
  /nfs/tmp2/rcook/VTK/5.10/vtk-build/CMakeFiles/CMakeTmp/testCCompiler.c

  Linking C executable cmTryCompileExec

  /collab/usr/global/tools/Kitware/CMake/2.8.7/chaos_5_x86_64_ib/bin/cmake -E
  cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1

  /opt/cudatoolkit-4.2/bin/nvcc
  CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -o cmTryCompileExec
  -rdynamic

  nvcc fatal : Unknown option 'rdynamic'

  gmake[1]: *** [cmTryCompileExec] Error 255

  gmake[1]: Leaving directory
  `/nfs/tmp2/rcook/VTK/5.10/vtk-build/CMakeFiles/CMakeTmp'

  gmake: *** [cmTryCompileExec/fast] Error 2

  

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:15 (PROJECT)



-- 
✐Richard Cook   
✇ Lawrence Livermore National Laboratory
Bldg-453 Rm-4024, Mail Stop L-557        
7000 East Avenue,  Livermore, CA, 94550, USA
☎ (office) (925) 423-9605    
☎ (fax) (925) 423-6961
---
Information Management & Graphics Grp., Services & Development Div., Integrated Computing & Communications Dept.
(opinions expressed herein are mine and not those of LLNL)





More information about the vtkusers mailing list