pythran icon indicating copy to clipboard operation
pythran copied to clipboard

Instructions for Windows 10 users MKL / OpenBLAS properly formatted

Open mattslezak-shell opened this issue 3 years ago • 2 comments

Instructions given so OpenMP will work on Windows 10 with both MKL and OpenBLAS.

mattslezak-shell avatar Feb 22 '22 04:02 mattslezak-shell

Change whatever you feel is appropriate. I did notice on a very large project with OpenBLAS I had to change some settings around to get OpenMP working like this:

library_dirs='C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\lib\x64' ldflags=\libomp.lib

So link the standard Windows Visual Studio OpenMP library instead of the LLVM one. Why this works on larger projects (100 lines of code) and not the LLVM one I have no idea. So rather than figure it out, I'd just provide it as an alternative if the first method fails... Someone smarter than me may be able to figure out why, although I imagine most users just want config settings to plug in to get their module built and could care less what happens behind the scenes, as long as it's using OpenMP.

mattslezak-shell avatar Feb 24 '22 23:02 mattslezak-shell

I found that some random modules in my project were actually loading the libiomp5md.lib, causing my interpreter to crash when I tried to link libomp.lib in my Pythran modules. Note these are actually the same OpenMP files, but having both loaded into an environment at once will cause a crash (Windows can't tell they are the same, so multiple OpenMP DLLs loaded causes erratic behavior, OpenMP crashes the kernel). So I found a workaround for those that already installed the Intel OneAPI Intel MKL library by modifying the pythran-win32.cfg file as such:

library_dirs='C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\compiler\lib\intel64_win'
ldflags=\libiomp5md.lib

My original instructions only showed how to link libomp.lib so this is how you go about linking the other OpenMP library. If I need to update the documentation let me know and I will when I get a chance.

mattslezak-shell avatar Feb 26 '22 22:02 mattslezak-shell