In ubuntu, openmp is installed defaultly, so we don't need to install anything.
In your code, add
#include <omp.h>in headers.
And add
#pragma omp parallel forbefore your for loop.
like
And compile with flag -fopenmp.
gcc ctest.c -fopenmp .....Then it would run like this.