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.
- Install latest CUDA - www.nvidia.com/cuda
- Install Eclipse if not already installed - www.eclipse.org
- set all necessary paths in /etc/ld.conf and execute ldconfig as root (sudo) during the CUDA installation.
- In Eclipse to enable code highlighting: Window ->
Preferences -> in C/C++ -> File Types -> New -> enter "*.cu"
and select "C++ Source File"
- 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.
- 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
- 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
- Edit Makefile to reflect the name of executable and other names.