Using Eclipse CDT with CUDA makefile projects is straightforward after a couple key steps.

  1. Enable .cu filenames for CDT
    1. Window -> Preferences -> C/C++ -> File Types
      1. New...  : add  *.cu as a C Source File type
  2. Add Includes for the CUDA and SDK libraries
    1. Project -> Properties -> C/C++ General -> Path and Symbols
      1. Add... : CUDA includes for your project (as shown, or discover clues to them with a command like "which mpicc" )
  3. Disable some of the error checking as shown below (optional, project will build anyway using the makefile you provide )
    1. Project -> Properties -> C/C++ General -> Code Analysis (select radio button: use project settings)
      1. Syntax and Semantic Errors
        1. Symbol is not resolved
        2. Type cannot be resolved
        3. Field cannot be resolved
  4. If the makefile project doesn't support the target "all" (as with the SDK examples), change the build behaviour.
    1. Project -> Properties -> C/C++ Build -> Behaviour tab -> Build field (remove "all") , incremental build

CDT without makefile projects is more involved, because you don't have a correct compiler toolchain for nvcc . Using a makefile is a simple workaround.

  • No labels