How to get clang with OpenMP working on MSVC 2015

∥☆過路亽.° 提交于 2019-12-04 17:13:13
allo

It is really a bit tricky and the cmake autodetection doesn't seem to work very well. What helped is

OpenMP_CXX_FLAGS="-Xclang -fopenmp"
OpenMP_C_FLAGS="-Xclang -fopenmp"

And making sure that libomp.lib is in the link libraries.

-Xclang tells the clang binary, that the following options are in clang format and not in MSVC format and -fopenmp is then just the usual OpenMP flag. Setting it any other way did not work, though.

The general pattern is: -Xclang -clangFlag1 -Xclang -clangFlag2.... Namely each Clang Style flag requires its own -Xclang.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!