Tag Archives: openmp

[Solved] Mac Cmake Complie openmp Error: fatal error: ‘omp.h‘ file not found

Mac OS 11.5.2, cmake default compiler appleclang 12.0.5

Make keeps reporting errors after compiling

fatal error: 'omp.h' file not found
#include<omp.h>

The reason is that a.cpp file introduces OpenMP, OMP.H

It can be compiled successfully through G + +, but the make default clang compilation in MAcc is not successful. In other words, it cannot be compiled through cmake on Mac

Try to resolve:

Adding before the project line of cmake has no effect

SET(CMAKE_C_COMPILER "/usr/bin/gcc")
SET(CMAKE_CXX_COMPILER "/usr/bin/g++")

On the command line, the export cxx = “usr/bin/G + +” variable also has no effect

Solution

Brew install libomp

brew install libomp

Change the path corresponding to OMP. H where. CPP introduces OMP. H

#include</usr/local/opt/libomp/include/omp.h>

Detailed steps for installing Visual Studio 2010 + Intel parallel studio Xe 2013 and configuring mpich2

Pre-installation Instructions
Before installation, it is necessary to determine whether your VS and IVF version matches, as shown in the figure below. Also, the MPICH version is very important, this article USES the 32-bit, if the installation of 64-bit cannot be configured, it will be mentioned later.

Install Visual Studio 2010

    download Visual studio 2010 unzip and double-click setup.exe “Next” until finished, select exit;

Install Intel Parallel Studio XE 2013

    close VS(otherwise cannot load ivf template) unzip w_fcompxe_novsshell_2013.2.149.zip double-click the installation file, open it, select license configuration, and select lic under the installation file; When it comes to Options, look at the Installation Summary list for instructions added to VS, which is the part with the red coil. If so, it means that after IVF you will be able to use Fortran in VS.
    starts the installation to check whether the FORTRAN module has been successfully added, as shown in the figure below

Install and configure MPICH2

    double-click and install mpich2-1.4.1p1-win-ia32.msi(the installation file provided in the network disk linked in this paper requires mpich of version 32, and the hosts of “Get setting” of the 64-bit version cannot be changed to green when wmpiconfig. Exe is used); After installation, strictly follow the configuration file (win7_vS2010_mpich2.pdf) given;