Can I check which version of OpenMP I have installed?

38,896

Solution 1

With gcc, I suppose you should be looking for the compiler version

gcc -v

Perhaps in combination with the version of libgomp

ls -ltr /usr/lib/libgomp.so.1*

e.g.

-rw-r--r-- 1 root root 46652 2010-09-27 23:00 /usr/lib/libgomp.so.1.0.0

Depending on your distro this might give more info:

dpkg --status libgomp

E.g:

Package: libgomp1
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 84
Maintainer: Ubuntu Core developers <[email protected]>
Architecture: i386
Source: gcc-4.5
Version: 4.5.1-7ubuntu2
Depends: gcc-4.5-base (= 4.5.1-7ubuntu2), libc6 (>= 2.6)
Description: GCC OpenMP (GOMP) support library
 GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers
 in the GNU Compiler Collection.
Homepage: http://gcc.gnu.org/
Original-Maintainer: Debian GCC Maintainers <[email protected]>

In my case it confirms that the version matches gcc

Solution 2

Quoting from the GCC wiki page containing information on the OpenMP specification:

As of GCC 4.2, the compiler implements version 2.5 of the OpenMP specification, as of 4.4 it implements version 3.0 and since GCC 4.7 it supports the OpenMP 3.1 specification. GCC 4.9 supports OpenMP 4.0 with the follow exceptions (as of 2013-11-28): the new 4.0 directives are not yet supported in Fortran and omp target will always run on the host

Share:
38,896
lmirosevic
Author by

lmirosevic

Updated on October 28, 2020

Comments

  • lmirosevic
    lmirosevic over 3 years

    I am trying to find out which version of OpenMP is installed on my machine. It's a Linux box I am connected to using ssh.

    I am using gcc to compile using -fopenmp.

  • lmirosevic
    lmirosevic almost 13 years
    libgomp.so isn't in that path for me, any ideas where else it could be?
  • ejd
    ejd almost 13 years
    Add -### to the invocation of gcc - like "gcc -### a.c" - and look for where it is picking up crtbegin.o and/or the directory specified with -L. That should give you the path to where the libraries are. Once you know the gcc version you can either check the documentation for gcc to see which version of OpenMP is support or write a small program printing out the value of _OPENMP. The value corresponds to the date of the OpenMP spec supported.
  • sehe
    sehe almost 13 years
    @codenoob: ldconfig -p | grep gomp or otherwise install it (e.g. apt-get install libgomp1)
  • Massimiliano
    Massimiliano over 10 years
    You may want to have a look here. In particular "Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline."
  • wgodoy
    wgodoy over 10 years
    This is an official gcc document, I think it's relevant and answers the question. I provided some context, I don't know what else to add that is relevant and not redundant. The first paragraph of that link lists the support for the OpenMP standard that GCC provides (mentioned in my comment). I don't understand your negative vote. Otherwise, how would you post referring to the link? It's very easy to copy and paste what you put.
  • Massimiliano
    Massimiliano over 10 years
    The negative vote was for the link only answer, which is explicitly discouraged by SO.
  • Andrew Barber
    Andrew Barber over 10 years
    Please compare your answer to the accepted one which was posted above. @Massimiliano is entirely correct with the comments above.