Setting up GCC, Eclipse IDE, and graphical dependencies (Linux)

Open up a Terminal from the Ubuntu desktop (Ctrl + Alt + T). We first update the apt repository as follows:

sudo apt-get update

Now we can install everything we need for CUDA with one additional line:

sudo apt-get install build-essential binutils gdb eclipse-cdt

Here, build-essential is the package with the gcc and g++ compilers, and other utilities such as make; binutils has some generally useful utilities, such as the LD linker, gdb is the debugger, and Eclipse is the IDE that we will be using.

Let's also install a few additional dependencies that will allow us to run some of the graphical (OpenGL) demos included with the CUDA Toolkit with this line:

sudo apt-get install freeglut3 ...

Get Hands-On GPU Programming with Python and CUDA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.