LLVM / Clang 8 Compilation of OpenMP Code in Windows


I have an issue using OpenMP with Clang 8 under Windows.
I descried the issue in https://stackoverflow.com/questions/55976484 and I’d like to describe it here more carefully and specifically.

Let’s say I run those 2 commands to compile a simple code:

clang-cl -Xclang -fopenmp -o bla.obj -c bla.c
clang-cl -Xclang -fopenmp -o bla.exe bla.obj

The linker will link against the supplied libomp.lib (Inside LLVM\lib).
Then the resulting EXE file will have the requirement of libomp.dll which isn’t supplied in LLVM for Windows installation.

The OpenMP Dynamic Library supplied with LLVM 8 / Clang 8 for Windows is libiomp5md.dll.
This is great as this is Intel’s OpenMP library.

Yet they DLL the EXE requires doesn’t match the DLL supplied (The EXE requires libomp.dll while the supplied is libiomp5md.dll).
Since many applications out there use Intel OpenMP library it will be great if instead of having libomp.lib we’ll have libiomp5md.lib which requires libiomp5md.dll as supplied.

I’m sure this incompatibility will be resolved but the most important things is to have Clang compiled applications (And libraries) compiled with OpenMP to be able to run under a host program which already loads libiomp5md library with no conflicts.

Thank You.