joy

joy的数字花园

一直游到海水变蓝
github

Why OpenMP is not found by Clang

Why OpenMP is not Found by Clang#

当使用 clang 作为 C++ 编译器时,CMAKE 无法找到 OpenMP, 如下:

[cmake] -- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES) 

Solution#

  1. When using Clang with OpenMP you need to use -fopenmp=libomp
  2. 切换 C++ 编译器为 g++, cmake .. -DCMAKE_C_COMPILER=which gcc -DCMAKE_CXX_COMPILER=which g++

Refs#

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.