38

Im using Ubuntu 12.04 LTS. I don't know if it makes a difference but CPU's architecture is 64bit (Intel i3).

55

You don't install OpenMP. OpenMP is a feature of the compiler. Check that the compiler you are using implements OpenMP, which is an API for parallel programming in C/C++/Fortran.

Check with the OpenMP website, openmp.org for a list of compilers and platforms that support OpenMP programming.

6
  • I have installed gcc 4.6 by using the command sudo apt-get install gcc 4.6 and the output is:
    – Anita 7
    May 31 '12 at 19:46
  • anita@ubuntu:~$ sudo apt-get install gcc-4.6 Reading package lists... Done Building dependency tree Reading state information... Done gcc-4.6 is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 190 not upgraded.
    – Anita 7
    May 31 '12 at 19:46
  • 5
    gcc 4.6 implements version 3.0 of the OpenMP standart. You have to enable it by using: gcc -fopenmp foo.c
    – 0xf3f
    May 31 '12 at 20:51
  • Thank you so much but I had to install the version 11.04 and now the output is: ubuntu@ubuntu:~$ sudo apt-get install gcc-4.5 Reading package lists... Done Building dependency tree Reading state information... Done gcc-4.5 is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 278 not upgraded. The version of the OMP is the same? Can I still use the same command?
    – Anita 7
    May 31 '12 at 21:56
  • 4
    In case you ar using the gnu compiler, you can try with sudo apt-get install gcc-multilib Jul 2 '15 at 20:15
10

sudo apt install libomp-dev

apt show libomp-dev

Description: LLVM OpenMP runtime - dev package The runtime is the part of the OpenMP implementation that your code is linked against, and that manages the multiple threads in an OpenMP program while it is executing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.