CUDA Netbeans
CUDA Netbeans
Version 1.0
Department of Electromagnetism
Faculty of Physics
University of Salamanca
Index
4.2. A CUDA project from existing code files that already have a
Makefile.. ........................................................................................... 7
4.3. A CUDA project from existing code files that have not a Makefile ..... 8
I
NETBEANS AND CUDA - HOW TO BUILD OR OPEN A CUDA PROJECT IN THE
GRAPHICAL DEVELOPMENT ENVIRONMENT NETBEANS
1. Introduction
This document details a little tutorial of how can create a new CUDA
project or load one already create in the tool or development environment
NetBeans.
This allows programming within a graphical environment, offering many
facilities such as integration of all elements and tasks required during
development in the same environment. Enables us to program, compile, debug
an run applications from the same development environment, without the need
for multiple windows, consoles and text editors open.
Currently, at the time of writing this document, the installed version of the
development environment is 6.5.1.
In first, any graphical development environment is ready to develop in
CUDA, so it must be configured to recognize the extensions ".cu" and compile
using the NVIDIA compiler (nvcc). In this tutorial there is a section dedicated to
it.
1
VERSION: 1.0
JAVIER GÓMEZ MARTÍN
2
NETBEANS AND CUDA - HOW TO BUILD OR OPEN A CUDA PROJECT IN THE
GRAPHICAL DEVELOPMENT ENVIRONMENT NETBEANS
• /usr/include
• /usr/local/cuda/include
3
VERSION: 1.0
JAVIER GÓMEZ MARTÍN
Finally, in the tab "Other", in "C++ File Extensions" edit and add the
extension ".cu". It should be something like this:
4
NETBEANS AND CUDA - HOW TO BUILD OR OPEN A CUDA PROJECT IN THE
GRAPHICAL DEVELOPMENT ENVIRONMENT NETBEANS
5
VERSION: 1.0
JAVIER GÓMEZ MARTÍN
Finally, we have created the project, we have got the latest details. Let
the projects options on menu “File Æ Project Properties”, in the category
"Build" check that the Tool Collection selected is CUDA and the option "Enable
Make Dependency Checking" is unchecked.
We can add both source files (.cpp and .cu) and header files (.h) to our
project.
6
NETBEANS AND CUDA - HOW TO BUILD OR OPEN A CUDA PROJECT IN THE
GRAPHICAL DEVELOPMENT ENVIRONMENT NETBEANS
Simply go to the menu “File Æ Open Project” and search in our file
system the NetBeans project that we want to open.
The process would be the same as for creating a new CUDA project, but
now when selecting the type of C/C++ application in the menu “File Æ New
Project” would select the option “C/C++ Project From Existing Code”.
Then we follow the steps that the wizard give us to select the path of the
"Makefile" and source files. In first, the rest of configuration and compilation
options would not have to change anything.
Finally it should be set up "Project Properties" as in the case of a new
project. For this see section 3 of this document.
7
VERSION: 1.0
JAVIER GÓMEZ MARTÍN
The process would be the same as for creating a new CUDA project, but
instead of adding new files to the project, add the existing files.
Finally it should be set up "Project Properties" as in the case of a new
project. For this see section 3 of this document.