anum
anum

Reputation:

OpenMp Coding: warning: ignoring #pragma omp parallel

I am getting this warning during compilation of a C code with OpenMP directives on Linux:

warning: ignoring #pragma omp parallel

Gcc version is 4.4.

Is it only a warning I should not care about? Will the execution be in parallel?. I would like a solution with a some explanation.

I have provide -fopenmp with the make command, but gcc doesn't accept that, otherwise for single compilation of file, i.e. gcc -fopenmp works alright.

Upvotes: 25

Views: 43426

Answers (3)

Elina_syr
Elina_syr

Reputation: 76

This is probably a resolved/closed issue, because indeed the most common reason for this warning is the omission of the -fopenmp flag.

However, when I came across this problem the root cause for this was that the module openmp was not loaded, meaning: load module openmp.

Upvotes: 0

Brandon Pelfrey
Brandon Pelfrey

Reputation: 2599

Make sure that lib-gomp and lib-gomp-dev is installed. In some strange distributions it is removed. It is the essential runtime and development library.

Upvotes: 0

Manuel
Manuel

Reputation: 6443

IIRC you have to pass -fopenmp to the g++ call to actually enable OpenMP. This will also link against the OpenMP runtime system.

Upvotes: 42

Related Questions