Installing Developer Tools on Ubuntu

GNU Compilers

By default Ubuntu installs some development tools but some key components might be missing.  For example I didn’t see g++, GNU’s C++ compiler.  Luckily it’s easy to fix by installing it directly:

ilya@ilya-ubuntu:~$ sudo apt-get install g++

If you plan to use the system for development it makes sense to just the build bundle:

ilya@ilya-ubuntu:~$ sudo apt-get install build-essential

A good practice is to issue update and upgrade commands prior to installing any packages.

ilya@ilya-ubuntu:~$ sudo apt-get update
ilya@ilya-ubuntu:~$ sudo apt-get upgrade

Intel Compilers

Most Intel developments tools are commercial products and you need a valid license to use them.  If you have it, the tools are very easy to install.  Htere’s the installation process for the Intel Parallel Studio XE 2016.  Untar the distribution file and run the installation script:

ilya@ilya-ubuntu:~$ tar -xvf parallel_studio_xe_2016_update1.tgz
ilya@ilya-ubuntu:~$ cd parallel_studio_xe_2016_update1/ 
ilya@ilya-ubuntu:~$ ./install.sh

Before using Intel compilers one needs to set environment variables:

ilya@ilya-ubuntu:~$ source /opt/intel/bin/compilervars.sh intel64

A corresponding record in the shell rc file will ensure that the variables are set every time the user logs in .

ilya@ilya-ubuntu:~$ diff ~/.bashrc ~/.bashrc.orig
115d114
< source /opt/intel/bin/compilervars.sh intel64

Now we can test the compiler with a simple hello world example:

ilya@ilya-ubuntu:/tmp$ cat hello.c
#include<stdio.h>
int main(){
printf("hello world\n");
return(0);}
ilya@ilya-ubuntu:/tmp$ icc hello.c -o hello_icc
ilya@ilya-ubuntu:/tmp$ ./hello_icc
hello world
ilya@ilya-ubuntu:/tmp$ gcc hello.c -o hello_gcc
ilya@ilya-ubuntu:/tmp$ ./hello_gcc
hello world

Other Tools

There are many other development tools and packages that might get hand.  Here’s a small sample:

ilya@ilya-ubuntu:~$ sudo apt-get install cmake git libgtk2.0-dev pkg-config 
ilya@ilya-ubuntu:~$ sudo apt-get install python-dev python-numpy
ilya@ilya-ubuntu:~$ sudo apt-get install libtbb2 libtbb-dev