gcc 4.4.2 = which version of OpenMP

Discuss the OpenMP 3.0 API Specifications with the OpenMP Arch. Review Board. (Read Only)

gcc 4.4.2 = which version of OpenMP

Postby sd9 » Mon Jan 11, 2010 12:23 am

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?
sd9
 
Posts: 47
Joined: Tue Jun 23, 2009 3:39 am

Re: gcc 4.4.2 = which version of OpenMP

Postby cterboven » Mon Jan 11, 2010 12:52 am

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
cterboven
 
Posts: 11
Joined: Thu Sep 04, 2008 8:27 am
Location: Aachen, Germany

Re: gcc 4.4.2 = which version of OpenMP

Postby sd9 » Mon Jan 11, 2010 2:39 am

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)
sd9
 
Posts: 47
Joined: Tue Jun 23, 2009 3:39 am

Re: gcc 4.4.2 = which version of OpenMP

Postby nathanweeks » Tue Jan 12, 2010 6:24 am

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/
nathanweeks
 
Posts: 41
Joined: Sun May 17, 2009 6:19 am
Location: Iowa State University

Re: gcc 4.4.2 = which version of OpenMP

Postby sd9 » Wed Jan 13, 2010 4:55 am

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.
sd9
 
Posts: 47
Joined: Tue Jun 23, 2009 3:39 am

Re: gcc 4.4.2 = which version of OpenMP

Postby nathanweeks » Wed Jan 13, 2010 7:30 pm

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/
nathanweeks
 
Posts: 41
Joined: Sun May 17, 2009 6:19 am
Location: Iowa State University

Re: gcc 4.4.2 = which version of OpenMP

Postby sd9 » Wed Jan 13, 2010 11:54 pm

I tried it too. Same result. Thank you so much :)
Although I do wish there were version numbers :)
sd9
 
Posts: 47
Joined: Tue Jun 23, 2009 3:39 am


Return to OpenMP 3.0 API Specifications

Who is online

Users browsing this forum: No registered users and 2 guests

cron