This is my code:
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
void main()
{
int x,nt,tid;
int ris;
omp_set_nested(1);
ris=omp_get_nested();
if (ris)
printf("Nested parallelism enabled\n");
omp_set_num_threads(5);
#pragma omp parallel private (nt,tid)
{
tid = omp_get_thread_num();
printf("Ciao sono il thread %d\n",tid);
nt = omp_get_num_threads();
if (omp_get_thread_num()==1)
printf("Il numero di threads e': %d\n",nt);
}
omp_set_num_threads(3);
#pragma omp parallel private (x)
{
x=x+1;
printf("Valore = %d\n",x);
}
}
and this is the response of the compiler:
Prova.c undefined reference to 'omp_set_nested'
Prova.c undefined reference to 'omp_get_nested'
Prova.c undefined reference to 'omp_set_num_threads'
Prova.c undefined reference to 'GOMP_parallel_start'
Prova.c undefined reference to 'GOMP_parallel_end'
Prova.c undefined reference to 'omp_set_num_threads'
Prova.c undefined reference to 'GOMP_parallel_start'
Prova.c undefined reference to 'GOMP_parallel_end'
build finished: 8 errors, 0 warnings