How to set CUDA in Eclipse

Here I describe steps to get Eclipse working with CUDA. I am working on Ubuntu 8.04 and Eclipse: 3.2.2.

  1. Install latest CUDA - www.nvidia.com/cuda
  2. Install Eclipse if not already installed - www.eclipse.org
  3. set all necessary paths in /etc/ld.conf  and execute ldconfig as root (sudo)  during the CUDA installation.
  4. In Eclipse to enable code highlighting:  Window -> Preferences -> in C/C++ -> File Types -> New -> enter "*.cu" and select "C++ Source File"
  5. Make a copy of NVidias template project and set this project in eclipse
    • cd NVIDIA_CUDA_SDK/projects/
    • cp -r template/   my project/
    • New -> C++ Project ->
      • uncheck "Use default location" and set project name
      • next, on Make builder tab removed "all" target.
  6. after the project creation right click on project and open properties menu and in "Include paths and symbols" add external include path /usr/local/cuda/bin
  7. To set up Eclipse to run it:
    Run -> Run Configurations -> select "C/C++ Local Application" -> "ew launch configuration" (click the leftmost icon on the top)

    • set name
    • set project
    • set path to binary e.g /.../bin/linux/release/name
  8. Edit Makefile to reflect the name of executable and other names.