Can I check which version of OpenMP I have installed?
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 <ubuntu-devel-discuss@lists.ubuntu.com>
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 <debian-gcc@lists.debian.org>
In my case it confirms that the version matches gcc
Clang OpenMP version, can not get latest
EDIT: replaced placeholder with reply.
After a bit of conversation with one of the clang developers, it's not really clear if this is a bug in clang or more a feature. IMHO, it could be that the version string for _OPENMP
was not correctly set, when clang 9.0 was branched from the mainline code version.
The mainline version in the repository correctly reports 201511
for _OPENMP
, which corresponds to OpenMP API Version 4.5. I think this is correct, as clang (to my knowledge) does not yet fully support OpenMP 5.0.
So, clang 10.0.0 will correctly report the version number. I'm not sure if there will be a bugfix release of clang 9.0.0 that will also fix this issue.
Hope that helps!
What the correlation between GCC and OpenMP versions?
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 for C/C++, GCC 4.9.1 also for Fortran. GCC 5 adds support for Offloading.
from https://gcc.gnu.org/wiki/openmp
OpenMP + linux - GOMP_4.0 not found
Since you have multiple GCC-compiler installations (4.3 and 4.9), it is likely that your problem arises because you compile with GCC 4.9 (which supports OpenMP 4.0) but at runtime the OS loader uses the GCC 4.3 libraries (which does not support OpenMP 4.0).
There are some alternatives to avoid this issue:
- Statically compile your binary by using
-static
at link time. Make O/S to search the appropriate libraries rather than the old libraries. You can use the command
find / name -name libgomp.so.1
to list the available libgomp libraries from your system and then add the directory where it is stored into the
LD_LIBRARY_PATH
environment variable.- Alternatively to 2), you can also tell the linker to generate a binary and letting it to know where to find additional shared libraries in addition to where LD_LIBRARY_PATH points to. You can also use gcc ...
-Wl,-rpath -Wl,<dir>/lib
(or lib64 rather than lib, if it applies) where<dir>
refers to the directory from point 2).
problems getting OpenMP 4.0 to run in eclipse (Linux Mint)
OpenMP 4.0 is fully supported since GCC 4.9.1 as shown in the following link. So you may not need to build your own GCC.
http://openmp.org/wp/openmp-compilers/
On the other hand, if you build your own GCC, you should try not use the system default version of OpenMP library libgomp.so
as indicated by the error message. You could use the linking option -L/path/to/new/libgomp
and -lgomp
to specify the location of the new library.
According to the above link, MSVC++ supports OpenMP 2.0 only until version 2015.
Related Topics
Fastest Way to Tell If Two Files Have the Same Contents in Unix/Linux
Ssh: Could Not Resolve Hostname [Hostname]: Nodename Nor Servname Provided, or Not Known
Copy Folder Structure (Without Files) from One Location to Another
Can't Su to User Jenkins After Installing Jenkins
Crontab Day of the Week Syntax
How to Connect to a Terminal to a Serial-To-Usb Device on Ubuntu 10.10 (Maverick Meerkat)
Linux Shell Script for Each File in a Directory Grab the Filename and Execute a Program
Use Grep to Find Content in Files and Move Them If They Match
Using Rsync Include and Exclude Options to Include Directory and File by Pattern
Read Line by Line in Bash Script
How Much Memory Is Consumed by the Linux Kernel Per Tcp/Ip Network Connection
Tcp_Tw_Reuse VS Tcp_Tw_Recycle:Which to Use (Or Both)
How to Create Threads Without System Calls in Linux X86 Gas Assembly
Rename Files to Md5 Sum + Extension (Bash)
How to Get the Physical Address from the Logical One in a Linux Kernel Module