Compiling OpenBLAS 0.3.21 with OpenMP support using Intel oneAPI

Compiling OpenBLAS 0.3.21 with OpenMP support using Intel oneAPI

OpenBLAS is a CPU-level optimized replacement to BLAS/LAPACK. In most cases it can substitute BLAS and/or LAPACK in attempt to achieve higher productivity, which is the main goal of most HPC applications. The last release of OpenBLAS (that is 0.3.21) has some critical problem with configuring the compilation whenever USE_OPENMP=1 is passed to make, in case Intel oneAPI compilers are employed.

The problem is in the Makefile. At some point there the ifort compiler becomes invoked without passing the necessary OpenMP flags, which in turn breaks the linking process afterwards. It is possible to fix that problematic make configuration, but there is an easier way to complete the compilation without modifying the files included in the OpenBLAS distribution.

OpenBLAS distribution comes with CMake support. It is considered experimental, but nevertheless it seems to work quite properly in this particular case (compiling the code against OpenMP using Initel oneAPI):


The -static-intel flag passed to the C and Fortran compilers is there in attempt to force compiler-rt libraries of Intel oneAPI to become part of the binary code. Note that not all compiler-rt libraries could be linked statically.

The complete recipe used to compile and install OpenBLAS 0.3.21 in Discoverer HPC software repository is available on-line at:

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress Appliance - Powered by TurnKey Linux