gcc 4.4.2 = which version of OpenMP

Discuss the OpenMP 3.0 API Specifications with the OpenMP Arch. Review Board. (Read Only)
Forum rules
The OpenMP Forums are now closed to new posts. Please visit Stack Overflow if you are in need of help: https://stackoverflow.com/questions/tagged/openmp
Locked
sd9

gcc 4.4.2 = which version of OpenMP

Post by sd9 »

I wanted to try out OpenMP tasks, so I installed the latest version of gcc (version 4.4.2) on my Linux system.

A post on stackoverflow.com says that the gcc manual speaks of the OpenMP version. When I checked the manual, it said something about version 2.5.

Code: Select all

-fopenmp Enable handling of OpenMP directives #pragma omp in C/C++ and !$omp
         in Fortran. When ‘-fopenmp’ is specified, the compiler generates parallel
         code according to the OpenMP Application Program Interface [b]v2.5[/b]
         http://www.openmp.org/. This option implies ‘-pthread’, and thus is only
         supported on targets that have support for ‘-pthread’.
Is that true? Does the latest version of gcc not have OpenMP 3? If so, where could I get it from?

cterboven
Posts: 12
Joined: Thu Sep 04, 2008 8:27 am
Location: Aachen, Germany
Contact:

Re: gcc 4.4.2 = which version of OpenMP

Post by cterboven »

I do not think that this information is correct.
While I cannot prove that gcc 4.4.x has full OpenMP 3.0 support, I successfully used the task capabilities with gcc 4.4.1. The GOMP project webseite also states that gcc 4.4.x supports OpenMP 3.0: http://gcc.gnu.org/projects/gomp/.

Kind regards,
Christian

sd9

Re: gcc 4.4.2 = which version of OpenMP

Post by sd9 »

Thanks cterboven. In that case, my program should have worked. But it gives this error:
task: /usr/lib/libgomp.so.1: version `GOMP_2.0' not found (required by task)

nathanweeks
Posts: 41
Joined: Sun May 17, 2009 6:19 am
Location: Iowa State University
Contact:

Re: gcc 4.4.2 = which version of OpenMP

Post by nathanweeks »

They claim to support OpenMP 3.0 here:

http://gcc.gnu.org/gcc-4.4/changes.html

I submitted a bug report 7 months ago asking them to update the manual,
but it apparently hasn't been updated yet...
--
Nathan Weeks
Iowa State University HPC Group
http://weeks.public.iastate.edu/

sd9

Re: gcc 4.4.2 = which version of OpenMP

Post by sd9 »

Hey thanks...that was useful.
Personally I feel that it is OpenMP's responsibility to mention in either a header file (omp.h) or a readme file bundled with gcc, about which version of OpenMP is being carried by that gcc.
I wonder why they didn't do that.

nathanweeks
Posts: 41
Joined: Sun May 17, 2009 6:19 am
Location: Iowa State University
Contact:

Re: gcc 4.4.2 = which version of OpenMP

Post by nathanweeks »

The supported version of OpenMP will be available via the "_OPENMP" macro; e.g.,
with gcc 4.4.2:

Code: Select all

$ cat openmp_version.c
#include <stdio.h>
int main(void) {
    printf("%i\n", _OPENMP);
    return 0;
}
$ gcc -fopenmp openmp_version.c
$ ./a.out
200805
This is year/month of the supported version. "200805" is OpenMP 3.0.
--
Nathan Weeks
Iowa State University HPC Group
http://weeks.public.iastate.edu/

sd9

Re: gcc 4.4.2 = which version of OpenMP

Post by sd9 »

I tried it too. Same result. Thank you so much :)
Although I do wish there were version numbers :)

Locked