×

Search anything:

Install OpenMP from source

Internship at OpenGenus

Get this book -> Problems on Array: For Interviews and Competitive Programming

Reading time: 10 minutes

In this guide, we will walk you through the installation steps of OpenMP in three simple steps.

OpenMP (Open Multi-Processing) is a library that is used to make programs execute in a parallel fashion. It supports multi-platform shared memory multiprocessing programming in C, C++, and Fortran on most platforms, instruction set architectures (like AVX) and operating systems (like Solaris, AIX, HP-UX, Linux, macOS, and Windows). It consists of a set of compiler directives, library routines, and environment variables that influence run-time behavior.

OpenMP_logo

Get your source code

You need to clone the source code of OpenMP to your local workspace using the following command:


git clone https://github.com/llvm-mirror/openmp.git
cd openmp

Build and prepare OpenMP

As the next step, you need to build the source of OpenMP using the following command:


mkdir build
cd build
cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ ..

Install OpenMP

You need to install OpenMP and get the shared library:


make
make install

If you want the shared library to a particular location (say <path_to_your_destination>), then replace "make install" by:


make PREFIX=<path_to_your_destination> install

Enjoy the power of parallel execution, you have install OpenMP

OpenGenus Tech Review Team

OpenGenus Tech Review Team

The official account of OpenGenus's Technical Review Team. This team review all technical articles and incorporates peer feedback. The team consist of experts in the leading domains of Computing.

Read More

Improved & Reviewed by:


Install OpenMP from source
Share this