Using OpenMP 3/4 in Visual Studio 2017
Update: The integration has been improved and you can now even install it via the VS installer. Also they are working on /MP support.
You may obtain clang-cl from http://llvm.org/builds/
But you may run into integration issues starting with VS2017:
- https://bugs.llvm.org/show_bug.cgi?id=33672
- https://www.reddit.com/r/cpp/comments/6oepq4/making_windows_clang_401_play_nice_with_visual/
- There is an attempt at solving this: https://github.com/WubbaLubba/LlvmForVS2017
/fallback is a clang-cl option which makes it fall back to Microsoft's compiler if it can't compile something itself.
But keep in mind there is no support for the /MP hack: http://clang-developers.42468.n3.nabble.com/clang-windows-clang-cl-support-for-MP-tp4045651p4045659.html
Related videos on Youtube
Comments
-
Roi Danton almost 2 years
Trying to use features from OpenMP 3
#pragma omp parallel for collapse(2)
in Visual Studio 2017; i'm getting
error c3005: 'collapse' unexpected token encountered on openmp 'parallel for' directive
It seems Visual Studio 2017 only supports OpenMP2. In a request to support OpenMP4.5 it was said from VS team
We have no plans at this time.
Another answer said
Fortunately clang-cl has become a viable alternative with OpenMP 4 support. In the worst case you can still enable the /fallback option.
How to use clang-cl with Visual Studio 2017 and what is the fallback option?
-
Z boson about 7 yearsYou can use the Intel compiler on Windows.
clang-cl
is probably Clang on Windows. You can also use GCC on Windows. Basically, they are telling you to use another compiler that supports OpenMP on Windows. Visual Studio serves only as an IDE in that case.cl
is the command line name for the Visual-C++ compiler.
-
-
Dan M. almost 6 yearsLLVM/Clang can now be trivially enabled in VS via marketplace.visualstudio.com/… extension.